Problem
When a workspace defines brightscript.bsdk, the extension should use the language server from that path.
If the user runs npm install in that SDK location and the BrighterScript version changes, the extension currently may keep running the old language server process.
Expected behavior
When brightscript.bsdk is set, detect dependency updates in that SDK and restart the language server once changes have settled.
Proposed approach
If brightscript.bsdk is configured, watch:
${bsdkPath}/package.json
- Optionally
${bsdkPath}/package-lock.json or other lockfiles
On change, start a debounce/settle flow instead of immediate restart:
- Wait for filesystem quiet period (e.g. 10–30s of no changes), with max timeout safety.
- During settle flow, monitor the root level node_modules where
${bsdkPath} resides for activity.
- After activity settles, restart the language server once.
- Avoid restart loops (coalesce multiple events into one restart).
- Handle missing paths / invalid SDK path gracefully.
Notes
npm install can take a while and produce many writes, so restart should happen after install activity stabilizes, not on first file event.
Acceptance criteria
- With
brightscript.bsdk set, running npm install that updates brighterscript eventually triggers exactly one language server restart.
- No restart occurs for transient/partial writes until filesystem activity settles.
- No repeated restart loop from install churn.
- No behavior change when
brightscript.bsdk is not set.
Problem
When a workspace defines
brightscript.bsdk, the extension should use the language server from that path.If the user runs
npm installin that SDK location and the BrighterScript version changes, the extension currently may keep running the old language server process.Expected behavior
When
brightscript.bsdkis set, detect dependency updates in that SDK and restart the language server once changes have settled.Proposed approach
If
brightscript.bsdkis configured, watch:${bsdkPath}/package.json${bsdkPath}/package-lock.jsonor other lockfilesOn change, start a debounce/settle flow instead of immediate restart:
${bsdkPath}resides for activity.Notes
npm installcan take a while and produce many writes, so restart should happen after install activity stabilizes, not on first file event.Acceptance criteria
brightscript.bsdkset, runningnpm installthat updates brighterscript eventually triggers exactly one language server restart.brightscript.bsdkis not set.