Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 Fix debug breakpoints not binding #1126

Merged

Conversation

TheAfroOfDoom
Copy link
Contributor

@TheAfroOfDoom TheAfroOfDoom commented May 10, 2024

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 it

after: setting a breakpoint catches successfully and pauses the server when it is hit

before
image
after
image

explanation

since packages/vscode-extension's watch script was calling npm run build (instead of npm run build:dev), it was calling esbuild.mjs with the prod arg (instead of dev).

"build": {
"command": "node esbuild.mjs prod",

this made esbuild not utilize our source maps, which broke the debugger

const isDev = mode !== 'prod'

when we switch to "watch": "npm run build:dev --watch", it calls the esbuild script with dev instead

"build:dev": {
"command": "node esbuild.mjs dev",

then source maps are enabled, and debug breakpoints work 🎉


supplementarily: some minor cleanup (surprised this isn't caught by the formatter/linter in CI)

@TheAfroOfDoom TheAfroOfDoom requested a review from SPGoding as a code owner May 10, 2024 14:47
@misode misode changed the title 🧱 Fix debug breakpoints not binding 🔨 Fix debug breakpoints not binding May 10, 2024
@MulverineX MulverineX merged commit f0d8613 into SpyglassMC:main May 10, 2024
3 checks passed
@TheAfroOfDoom TheAfroOfDoom deleted the fix-debugger-not-binding-breakpoints branch May 11, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants