Repository navigation
Qualify invokelatest in the variables request handler - #141
Merged
Merged
Conversation
Base only exports `invokelatest` from Julia 1.9 on, so on 1.0-1.8 every `variables` request threw `UndefVarError: invokelatest not defined` in the dispatcher before the handler ran. Call it as `Base.invokelatest`, like every other use in the package, and add a test that sends a `variables` request through the session's dispatcher. Co-Authored-By: Claude Opus 5.5 <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.
This PR was opened by Claude (Claude Code) on David's behalf.
Problem
Base.run(::DebugSession)registers thevariableshandler asBase only exports
invokelatestfrom Julia 1.9 on, and this package supports Julia 1.0+. On 1.0–1.8, everyvariablesrequest therefore threwUndefVarError: invokelatest not definedin the dispatcher beforevariables_requestran. The client got an error response and the variables pane never filled in. CI stayed green because the existing variables tests callvariables_requestdirectly and never go through this line. (PR #139 hit the same problem in a test and fixed it there.)Change
src/packagedef.jl: callBase.invokelatest, like every other use in the package. I greppedsrc/andtest/and this was the only unqualifiedinvokelatest.test/test_debugsession.jl: new test item, "a variables request sent to the session is answered". It uses the existingDapClientsnippet (with_debug_session(requests_after=...)) to send a realvariablesrequest over the wire after the debuggee has finished. It checks that the request gets a successful, empty response and that nothing reaches the session's error handler. This needed no new harness code.The test only covers the request after the debuggee has finished, with a stale reference, not while paused on a real frame. That is enough to exercise the dispatcher line, and the existing harness has no hook for sending requests while the debuggee is paused.
Verification (run locally on Windows)
UndefVarError(:invokelatest).🤖 Generated with Claude Code