-
Notifications
You must be signed in to change notification settings - Fork 0
DAP Debugger Setup
VimCode has built-in Debug Adapter Protocol (DAP) support with a VSCode-like debugging UI.
-
Install a debug adapter for your language:
:DapInstall rust " or python, go, javascript, java, csharp -
Set a breakpoint — press
F9on the line you want to break at -
Start debugging — press
F5(or click the play button in the debug sidebar) -
A
launch.jsonfile is generated automatically in.vimcode/launch.jsonon first run
| Language | Adapter | Registry name | Install command |
|---|---|---|---|
| Rust / C / C++ | codelldb | codelldb |
:DapInstall rust or :DapInstall cpp
|
| Python | debugpy | debugpy |
:DapInstall python |
| Go | delve | delve |
:DapInstall go |
| JavaScript / TypeScript | js-debug | js-debug |
:DapInstall javascript |
| Java | java-debug | java-debug |
:DapInstall java |
| C# | netcoredbg | netcoredbg |
:DapInstall csharp |
Open the debug sidebar by clicking the bug icon in the activity bar. It has four interactive sections:
- Shows local/scope variables with their current values
- Enter expands/collapses nested children (recursive)
- Additional scope groups (Statics, Registers, etc.) appear as expandable headers
- C# private fields are automatically grouped under Non-Public Members
- User-defined watch expressions
- Add with
:DapWatch <expr> -
xordremoves the selected expression
- Shows all stack frames
- Enter selects a frame and navigates to its source
- Active frame marked with
▶
- Lists all set breakpoints with conditions
- Enter jumps to the breakpoint's location
-
xordremoves the selected breakpoint
| Key | Action |
|---|---|
j / k
|
Navigate items |
Tab |
Switch between sections |
Enter |
Expand/select/jump |
x / d
|
Delete item (watch/breakpoint) |
q / Escape
|
Unfocus sidebar |
| Mouse click | Select item or section header |
-
F9— toggle a breakpoint on the current line - Breakpoints are shown in the gutter:
●(normal),◆(conditional)
:DapCondition x > 10 " Stop only when expression is truthy
:DapCondition " Clear condition on current line's BP
:DapHitCondition >= 5 " Stop after N hits
:DapHitCondition " Clear hit condition
:DapLogMessage Processing item " Print message instead of stopping (logpoint)
:DapLogMessage " Clear logpointPlace cursor on a line with a breakpoint, then run the command.
| Key | Action |
|---|---|
F5 |
Start debugging / continue |
Shift+F5 |
Stop debugging |
F6 |
Pause |
F9 |
Toggle breakpoint on current line |
F10 |
Step over |
F11 |
Step into |
Shift+F11 |
Step out |
| Command | Action |
|---|---|
:DapInstall <lang> |
Install debug adapter for language |
:DapInfo |
Show detected DAP adapters |
:DapEval <expr> |
Evaluate expression in current frame |
:DapWatch <expr> |
Add watch expression |
:DapCondition [expr] |
Set/clear condition on breakpoint at cursor |
:DapHitCondition [count] |
Set/clear hit-count condition |
:DapLogMessage [msg] |
Set/clear logpoint |
:DapBottomPanel terminal|output |
Switch bottom panel tab |
VimCode auto-generates a launch.json on first debug run:
.vimcode/launch.json
If you have an existing .vscode/launch.json, it is auto-migrated to .vimcode/ on first use.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "codelldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/myapp",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "build"
}
]
}| Variable | Value |
|---|---|
${workspaceFolder} |
Project root directory |
${workspaceFolderBasename} |
Project root directory name |
Add multiple entries to the configurations array. When starting debugging, VimCode uses the selected configuration from the debug sidebar dropdown.
If a launch configuration has "preLaunchTask": "build", VimCode loads .vimcode/tasks.json (auto-migrated from .vscode/tasks.json) and runs the matching task before starting the debug adapter.
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cargo build"
}
]
}Task output appears in the Debug Output panel. If the task fails, the debug session is aborted.
| Symbol | Meaning |
|---|---|
● |
Breakpoint set |
◆ |
Conditional breakpoint |
▶ |
Current execution line (stopped) |
◉ |
Breakpoint + current line |
When debugging, the bottom panel has two tabs:
- Terminal — integrated terminal
- Debug Output — adapter diagnostics and program output (scrollable, newest at bottom)
For Rust projects, VimCode auto-detects the debug binary using cargo metadata. The generated launch.json will point to the binary in target/debug/.
Make sure to build with debug info:
cargo build # debug profile includes debug info by defaultdebugpy requires Python 3.7+. Install:
pip install debugpydelve requires Go 1.16+. Install:
go install github.com/go-delve/delve/cmd/dlv@latestnetcoredbg requires .NET SDK. Install via your package manager or from the Samsung/netcoredbg releases.