Skip to content

Latest commit

 

History

History
94 lines (53 loc) · 4.05 KB

DAP.md

File metadata and controls

94 lines (53 loc) · 4.05 KB

Debug Adapter Protocol

LSP4IJ provides Debug Adapter Protocol support. You can read the DAP Support overview, describing which DAP features are implemented, and how.

The DAP support is available with the Debug Adapter Protocol run/debug configuration type:

DAP Configuration Type

After configuring the DAP configuration type, you can debug your file.
Here is an example with JavaScript debugging, which uses the VSCode JS Debug DAP server:

DAP Configuration Type

DAP Configuration Type:

To configure debugging with DAP, you need to fill in:

  • The Server tab to specify the DAP server:

    DAP Configuration Type/Server

  • The Mappings tab to specify the files which can be debugged to allow adding/removing breakpoints:

DAP Configuration Type/Mappings

  • The Configuration tab to specify the working directory and the file you want to run/debug:

    DAP Configuration Type/Configuration

Inline value

The values of the variables are displayed inline, but this is not perfect because a DAP server generally cannot handle variable positions (only their values). To retrieve the variable positions, LSP4IJ uses the syntax highlighting information from the editor (TextMate or others).

Here a de demo with JavaScript:

DAP inline value

Theoretically, inline values should be handled by a language server via textDocument/inlineValue but as no language servers seems implement this LSP request for the moment LSP4IJ doesn't use this strategy.

Evaluate expression

Evaluate expression is available by consuming the Evaluate request

Evaluate expression

Completion

If debug adapter supports the completions request, completion should be available in the expression editor by consuming the Completion request:

Completion

Set value

If debug adapter supports setting a variable to a value, the Set Value... contextual menu should be available:

Set Value/Menu

You should edit the variable:

Set Value/Edit

the edit apply will consume the SetVariable request:

Contextual Menu

Click on right button open existing / new DAP run configuration:

Run/Debug menu

DAP server traces

If you wish to show DAP request/response traces when you will debug:

Show DAP traces

you need to select Trace with verbose.

Set verbose traces

Templates

LSP4IJ provides DAP templates that allow to initialize a given DAP server very quickly: