Repository navigation
Conversation
DAPValue.computeSourcePosition gave the position to the navigatable in a thenAccept on the future of DAPStackFrame.getSourcePositionFor. When the variables context of the frame was still loading, that future completed on a pooled thread, outside a read action, and the inline values callback of XValueNodeImpl reported "Read access is allowed from inside read-action only" when it read the document. In 0.21.0 the future completed inside the read action of configureContext; redhat-developer#1781 moved it out. Now the navigatable is called in ReadAction.run, as JavaValue does. Fixes redhat-developer#2005 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
@coderabbitai review |
Action performed
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2006 +/- ##
=======================================
Coverage 49.13% 49.13%
=======================================
Files 812 812
Lines 32975 32975
Branches 5101 5101
=======================================
+ Hits 16201 16202 +1
+ Misses 14234 14230 -4
- Partials 2540 2543 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 22, 2026
lagergren
added a commit
that referenced
this pull request
Nov 24, 2026
… request "Jump to Source" on a variable which has a 'declarationLocationReference' now asks the debug adapter where the declaration is, with the 'locations' request, and opens the source of the answer at its line and column: a local file, or the text of a source reference. lldb-dap gives the reference to a variable whose declaration it knows. The request is sent off the EDT, with sendInExecutionEpoch, so that the reference of a value of an earlier stop is never sent. The position is given to the navigatable in a read action, as before (#2005, #2006). Without a reference, when the request fails or is refused because the stop has ended, and when the answer has no location which can be opened, Jump to Source searches the name of the variable in the file of its frame, as it did before. The inline values keep using that search only: a 'locations' request for each value shown inline would cost too much, and would move the values to their declarations. The 'locations' request of a value and the resolution of its answer to a position move from DAPJumpToValueSourceAction to DAPLocations, which both jumps use. DAP gives a 'declarationLocationReference' to a Variable only, not to the evaluate, setVariable and setExpression responses; Set Value updates the variable in place, which keeps it. Fixes #2115
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 #2005
Summary
When a DAP session stops and the editor shows inline values, the IDE often reports "Read access is allowed from inside read-action only" from
DAPValue.computeSourcePosition.DAPValuegave the source position to the navigatable in athenAccepton the future ofDAPStackFrame.getSourcePositionFor. While the variables context of the frame is still loading, that future completes on a pooled thread, outside a read action. The inline values callback ofXValueNodeImplthen reads the document of the position withFileDocumentManager.getDocument.New in 0.30.0: in 0.21.0 the future completed inside the read action of
configureContext. #1781 moved the completion out of it.Changes
DAPValue.setSourcePosition(future, navigatable)(new, package-private, static): gives the position to the navigatable inReadAction.runonce it is known, and gives nothing when there is no position. This matchesJavaValue, which calls the navigatable inReadAction.nonBlocking.DAPValue.computeSourcePositionuses it.computeInlineDebuggerDataand "Jump to Source" go through it as before.On the EDT (the context is already loaded) the read action costs nothing. On a pooled thread it waits only for a running write action. The callback does little work: it compares files, gets the document and schedules the inlay with
invokeLater.Tests
DAPValueSourcePositionTest:expected:<[true]> but was:<[false]>)../gradlew test --tests 'com.redhat.devtools.lsp4ij.dap.*': 329 tests, all pass../gradlew buildPlugin: passes.Checked in the IDE
Claude Code ran
runIde(IntelliJ IDEA Community 2024.2 sandbox) and debugged a Python loop with the debugpy bundled in IntelliJ IDEA 2026.3, with a line breakpoint in the loop and inline values on:main, 21a3f42): in 9 stops the error came 4 times, at 3 of the stops.🤖 Generated with Claude Code