Add brsconfigPath launch config to merge brsconfig.json values#786
Draft
TwitchBronBron wants to merge 7 commits into
Draft
Add brsconfigPath launch config to merge brsconfig.json values#786TwitchBronBron wants to merge 7 commits into
TwitchBronBron wants to merge 7 commits into
Conversation
Introduces a new `brsconfigPath` property in launch.json that pulls `files`, `rootDir`, `cwd`, and `logLevel` from a brsconfig.json file so vanilla BrightScript projects can keep project-structure metadata in one place instead of duplicating it across brsconfig and launch. Merge priority (lowest to highest): brsconfig < bsconfig < launch.json. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Debugging section explains brsconfigPath, but people looking for "how do I tell the language server about my project structure" won't look there. Add a brsconfig.json vs bsconfig.json section to the Editing docs and cross-link both directions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous "Choosing a config file" intro buried the lead. Walk through brsconfig.json with concrete examples first (matches the common case: vanilla BrightScript), then a brief bsconfig.json section for BrighterScript users that points back to the same property examples. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Also fix a now-broken anchor in the Debugging doc that pointed to a section removed in the prior Editing/index.md restructure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
brsconfigPath is an explicit opt-in for standard BrightScript projects. When set, the extension now uses brsconfig.json exclusively and skips the usual bsconfig.json lookup — the two configs are mutually exclusive rather than layered. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
brsconfig.json (and bsconfig.json) resolve paths relative to their own file location, so cwd was never a meaningful property to carry over. Removed from the code, schema, docs, and tests; added a test that proves cwd in brsconfig.json is now intentionally ignored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switches getBrsConfig from raw JSON.parse to bslangUtil.loadConfigFile so brsconfig.json gets the same handling as bsconfig.json: - JSONC (comments + trailing commas) - extends inheritance chains - rootDir resolved to absolute relative to the config file Adds tests for extends inheritance and JSONC parsing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
brsconfigPathproperty tolaunch.jsonthat points to abrsconfig.jsonfile. When set, the extension readsfiles,rootDir, andlogLevelfrom that file and merges them as base values into the launch config — eliminating duplication for standard BrightScript projects that already describe their structure via brsconfig.brsconfig.jsonis loaded with the same parser BrighterScript uses forbsconfig.json, so it supportsextendsinheritance, JSONC (comments and trailing commas), and resolvesrootDirrelative to the config file.When
brsconfigPathis set,bsconfig.jsonis not auto-loaded. The two configs are mutually exclusive:brsconfigPathis an explicit opt-in for standard BrightScript projects.Merge priority (lowest → highest): brsconfig < launch.json.
Why
brsconfig.jsonis a lightweight project-structure config for standard BrightScript (no compiler), distinct from BrighterScript'sbsconfig.json. TheBrsConfigProjectProvideralready usesbrsconfig.jsonfor project discovery (files,rootDir). This PR closes the loop so users writing their ownlaunch.jsoncan reference the same file viabrsconfigPathinstead of repeating values.Example
Changes
DebugConfigurationProvider.tsgetBrsConfig(config, workspaceFolder)method — loads viabslangUtil.loadConfigFile(soextendschains and JSONC work), resolves${workspaceFolder}and relative paths, extracts only the three supported properties, throws a clear error if the referenced file is missing or invalidsanitizeConfigurationnow selects brsconfig OR bsconfig (not both) based on whetherbrsconfigPathis setbrsconfigPath?: stringon theBrightScriptLaunchConfigurationinterfacepackage.json— adds thebrsconfigPathproperty to the launch config schemadocs/Editing/index.md— restructured to lead withbrsconfig.jsonfor standard BrightScript projects; bsconfig now a brief follow-on for BrighterScript usersdocs/Debugging/index.md— new section onbrsconfigPathcross-linked from the Editing doc🤖 Generated with Claude Code