fix(dap): step-over treating TCO continuations as new calls#48
Merged
Conversation
EVAL's TCO loop reuses the same Frame for `do`/`let`/`if`/fn-body and re-enters the hook with the same `Top()` pointer. The previous step controller looked only at depth, so step-over (`next`) paused on every TCO iteration — making F10 behave indistinguishably from F11. Snapshot the top-frame pointer at step time and treat re-entries on that same frame as TCO continuations: - step-over pauses only when Top() != stepFrame and depth <= target - step-in pauses only when Top() != stepFrame - step-out unaffected (depth-only condition) Also: vscode-lisp activationEvents needed `onDebugResolve:lisp` and `onDebugDynamicConfigurations:lisp` to actually activate before VSCode validates the launch.json — without them the user got "Configured debug type 'lisp' is not supported". New regression test: stepping over `(do 1 2 3 4)` with stopOnEntry now runs the program to termination instead of pausing on every literal subform. Co-Authored-By: Claude Opus 4.7 <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
Two bugs hit while smoke-testing the debugger from VSCode:
1) F10 acted like F11 (step-over entered every subform)
EVAL's TCO loop reuses the same Frame for
do/let/if/fn-body andre-enters the hook on the same
Top()pointer. The PR2 stepcontroller paused whenever
depth <= targetDepth, so it fired onevery TCO iteration — turning step-over into step-in.
Fix: snapshot the top frame at step time. Re-entries on that same
frame are TCO continuations and are skipped.
New regression test
TestServer_StepOverSkipsTCOContinuationruns(do 1 2 3 4)with stopOnEntry, sends onenext, and asserts theprogram terminates without pausing again.
2) VSCode reported "Configured debug type 'lisp' is not supported"
tools/vscode-lisp/package.jsonhadactivationEvents: ["onDebug", "onLanguage:lisp"].onDebugactivates after VSCode validates thelaunch.json, which is too late. Switched to
onDebugResolve:lispandonDebugDynamicConfigurations:lispso the extension is up beforelaunch validation runs.
Re-package and re-install:
cd tools/vscode-lisp npm run compile npx @vscode/vsce package code --install-extension vscode-lisp-0.1.0.vsix --forceTest plan
go build ./...andgo build -tags lispdebug ./...go test -tags lispdebug ./...— all green, including new regressiongo vet ./...andgo vet -tags lispdebug ./...gofmt -l .cleanF10 steps over the form, F11 steps in. (Reviewer to verify.)
🤖 Generated with Claude Code