Skip to content

[DAP] add inline values of variables during debugging #5927

Open
@filipdutescu

Description

@filipdutescu

Description

Similar to IntelliJ, VS Code, PyCharm etc. show values of variables used on each line during debugging. This should occur during a pause of the session (ie breakpoint was hit, waiting for next step into/out/over etc.). The values should probably only de shown for the current scope (the scope in which debugging is paused).

Design-wise, I propose the following alternatives, of which I prefer the first the best.

1:
image
2:
image
3:
image
4:
image

Proposal

Follow VSCode's approach to it (described in their documentation), which means using both language servers and debugging adapters, since the latter will probably not support it directly (source). The general mechanism appears to be:

  1. Request the list of variables local to the current scope.
  2. Request the values of said variables from the debug adapter
  3. Show the received values

From discussions with @pascalkuthe on the Matrix channel, it seems like this approach is pretty new and lacks mass adoption, at the time of writing. However, I still think there is value in implementing it prior to said adoption, to make it so Helix in ready to use it, as soon as it reaches the required parties.

External references

  1. VSCode's documentation
  2. DAP request for an inline values request
  3. DAP Variables request
  4. LSP Inline values request

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions