Skip to content

DAP: Jump to Source on a lazy variable uses its declaration location after Show value #2186

Done

Description

@lagergren

What happens

Jump to Source on a DAP variable opens its declaration when the variable has a declarationLocationReference (#2182).
For a lazy variable (presentationHint.lazy), after "Show value" the value shows the resolved child variable, and
Jump to Source uses that child's reference. If only the lazy variable had a declarationLocationReference, Jump to
Source falls back to searching the variable's name, although the debug adapter gave the declaration.

Expected

When the shown variable has no declarationLocationReference, use the lazy variable's own.

How it could be done

In DAPValue.getDeclarationSourcePosition, take the reference of the shown variable, else of the variable itself.
vscode-js-debug marks getters lazy, but doesn't give declarations; lldb-dap gives declarations. So check whether an
adapter gives both before relying on it.

Test

In DAPJumpToDeclarationSessionTest: a lazy variable with a declarationLocationReference, whose resolved child has
none. After "Show value", Jump to Source opens the declaration.

Related: #2115, #2182.

Activity

  1. added this to the 0.30.2 milestone on Nov 24, 2026
  2. added
    enhancement
    dap
    on Nov 24, 2026
  3. added a commit that references this issue on Nov 25, 2026
    d8c7551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dapenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions