Skip to content

DAP debugger variables are not showing inline in the editor #1432

Closed

Description

@SCWells72

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:

Image

Here is another debugger for the same language integrated via DAP and LSP4IJ at the same line of execution:

Image

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?

Activity

  1. angelozerr commented on Mar 10, 2026

    @angelozerr
    Contributor

    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.

  2. SCWells72 commented on Mar 10, 2026

    @SCWells72
    ContributorAuthor

    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?

  3. angelozerr commented on Mar 12, 2026

    @angelozerr
    Contributor

    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

    public @Nullable XSourcePosition getSourcePosition(String name) {

    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.

  4. added
    dap
    on Apr 25, 2026
  5. lagergren commented on Nov 2, 2026

    @lagergren
    Collaborator

    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.

  6. added this to the 0.30.0 milestone on Nov 2, 2026
  7. moved this to In Progress in Java Toolingon Nov 2, 2026
  8. moved this from In Progress to Done in Java Toolingon Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dap

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions