You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DAP debugger variables are not showing inline in the editor #1432
I thought this was implemented in LSP4IJ's DAP support, but perhaps not. In this debugger (from my own plugin), you can see variable values displayed inline in the editor:
Here is another debugger for the same language integrated via DAP and LSP4IJ at the same line of execution:
The variable values are known as shown in the debugger's Threads & Variables view, but they are not displayed inline in the editor.
Should that work? Is it something missing from this specific DAP server implementation? If so, what would be unimplemented there so I can log an issue in its public issue tracker?
First off, hi, Angelo! Nice to chat with you again.
Thanks for the quick response, and what you've said makes sense. It sounds like there's no strong correlation between a debugger variable and its actual declaration, correct? So you don't really know where to add the inline value view?
First off, hi, Angelo! Nice to chat with you again.
:)
Thanks for the quick response, and what you've said makes sense. It sounds like there's no strong correlation between a debugger variable and its actual declaration, correct? So you don't really know where to add the inline value view?
To display inline value, you need to retrieve position for a given variable name. See
Since #1781 (7469aab9, on main, not released yet), LSP4IJ asks the language server of the stopped file for textDocument/inlineValue when it supports it. Each variable of the frame is placed at its last lookup before the stop, with the syntax-highlighting scan as a fallback. It also expands the frame's Locals group, because IntelliJ computes inline data only for the variables it shows. Without such a language server, a custom VariableRangeRegistrar still works. I think this can be closed once 0.30.0 is out.
Activity
angelozerr commentedon Mar 10, 2026
DAP doesnt support inline value. The inline value is supported by LSP spec, which means that you need an LSP server to show inline value.
I find it is shame that it is required to have an lsp server to show debug inline value.
Thats why I have tried to implement this feature with a generic mean by using by default syntax highlight tokens.
It is working for most cases when token identifier matches some hard coded name but this strategy fails with advanced usecase
If you have integrated your dap server with lsp4ij dap extension point you can customize the strategy.
I did that for our qute debugger inside intellij quarkus.
SCWells72 commentedon Mar 10, 2026
First off, hi, Angelo! Nice to chat with you again.
Thanks for the quick response, and what you've said makes sense. It sounds like there's no strong correlation between a debugger variable and its actual declaration, correct? So you don't really know where to add the inline value view?
angelozerr commentedon Mar 12, 2026
:)
To display inline value, you need to retrieve position for a given variable name. See
lsp4ij/src/main/java/com/redhat/devtools/lsp4ij/dap/client/variables/providers/DebugVariableContext.java
Line 109 in 9f02bd1
The DebugVariableContext is created on each current stack frame. This context uses registered https://github.com/redhat-developer/lsp4ij/blob/main/src/main/java/com/redhat/devtools/lsp4ij/dap/client/variables/providers/DebugVariablePositionProvider.java
The default is https://github.com/redhat-developer/lsp4ij/blob/main/src/main/java/com/redhat/devtools/lsp4ij/dap/client/variables/providers/HighlighterDebugVariablePositionProvider.java which uses EditorHighlighter. basicly it loop for each IElementType and update the name/position variable context.
This higlighter provider uses VariableRangeRegistrar https://github.com/redhat-developer/lsp4ij/blob/main/src/main/java/com/redhat/devtools/lsp4ij/dap/client/variables/providers/VariableRangeRegistrar.java and it exists a registrar:
But you can implement your own registrar. We did that for Qute debugger https://github.com/redhat-developer/intellij-quarkus/blob/main/src/main/java/com/redhat/devtools/intellij/qute/run/QuteVariableRangeRegistrar.java
This registrar is registered by https://github.com/redhat-developer/intellij-quarkus/blob/main/src/main/java/com/redhat/devtools/intellij/qute/run/QuteDebugVariablePositionProvider.java which is registered here https://github.com/redhat-developer/intellij-quarkus/blob/1078cb51ccacc1bd97f56bda02702d6627cf1271/src/main/java/com/redhat/devtools/intellij/qute/run/QuteDebugAdapterVariableSupport.java#L61
I think you should do the same thing with your DAP server.
lagergren commentedon Nov 2, 2026
Since #1781 (
7469aab9, onmain, not released yet), LSP4IJ asks the language server of the stopped file fortextDocument/inlineValuewhen it supports it. Each variable of the frame is placed at its last lookup before the stop, with the syntax-highlighting scan as a fallback. It also expands the frame's Locals group, because IntelliJ computes inline data only for the variables it shows. Without such a language server, a customVariableRangeRegistrarstill works. I think this can be closed once 0.30.0 is out.