Repository navigation
feat: Jump to Source on a lazy DAP variable opens its declaration after Show value, when only the lazy variable gives one - #2205
Merged
lagergren merged 2 commits intoNov 24, 2026
Conversation
…er Show value, when only the lazy variable gives one After "Show value", a lazy variable (presentationHint.lazy) shows the variable with its value, and Jump to Source used only that variable's declarationLocationReference. When the debug adapter gave the reference to the lazy variable alone, Jump to Source searched the name instead. It now asks for the declaration of the shown variable, or else of the lazy variable. Before "Show value", and when the shown variable has its own reference, nothing changes. Fixes redhat-developer#2186
…its value after Show value, or else its own
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2205 +/- ##
=========================================
Coverage 54.59% 54.60%
=========================================
Files 834 834
Lines 35385 35386 +1
Branches 7300 5547 -1753
=========================================
+ Hits 19320 19321 +1
+ Misses 13223 13222 -1
- Partials 2842 2843 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
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.
Fixes #2186
What
Since #2182, Jump to Source on a DAP variable opens its declaration when the variable has a
declarationLocationReference. A lazy variable (presentationHint.lazy) shows its resolved child after "Show value", and Jump to Source then used only that child's reference. If only the lazy variable had one, Jump to Source fell back to searching the variable's name, although the debug adapter had given the declaration.Change
DAPValue.getDeclarationSourcePositionuses thedeclarationLocationReferenceof the shown variable, or else the variable's own.DAPLocations.locatecovers both.Not in this PR:
valueLocationReference) still uses only the shown variable, since a lazy placeholder's own value location isn't the value's.lazyanddeclarationLocationReferenceon one variable. lldb-dap gives declarations but doesn't mark variables lazy, and vscode-js-debug marks getters lazy but gives no declarations. So this follows the protocol ahead of the adapters.Tests
DAPJumpToDeclarationSessionTestgets two lazy locals and two tests:Red-green: without the change, the first test fails, because the name search finds nothing. With it, all 14 tests of the class pass, also headless.
The
dap.*tests pass on IC 2024.2, 2025.3 and IU 2026.3: 473 tests each, with 0 failures or skipped.Behaviour change
declarationLocationReference, Jump to Source searches the variable's name, although the lazy variable has a declaration