🔨 Fix debug breakpoints not binding #1126
Merged
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.
This PR re-enables debugging through VSCode's builtin debugger with breakpoints
before: setting a breakpoint in a
.ts
file wouldn't actually bind and the language server would not hit itafter: setting a breakpoint catches successfully and pauses the server when it is hit
explanation
since
packages/vscode-extension
'swatch
script was callingnpm run build
(instead ofnpm run build:dev
), it was callingesbuild.mjs
with theprod
arg (instead ofdev
).Spyglass/packages/vscode-extension/package.json
Lines 17 to 18 in 3f4cc12
this made esbuild not utilize our source maps, which broke the debugger
Spyglass/packages/vscode-extension/esbuild.mjs
Line 10 in 02952bf
Spyglass/packages/vscode-extension/esbuild.mjs
Line 21 in 02952bf
when we switch to
"watch": "npm run build:dev --watch"
, it calls the esbuild script withdev
insteadSpyglass/packages/vscode-extension/package.json
Lines 31 to 32 in 3f4cc12
then source maps are enabled, and debug breakpoints work 🎉
supplementarily: some minor cleanup (surprised this isn't caught by the formatter/linter in CI)