Skip to content

DAP Debugger Setup

John Donaghy edited this page Mar 11, 2026 · 1 revision

DAP Debugger Setup

VimCode has built-in Debug Adapter Protocol (DAP) support with a VSCode-like debugging UI.

Quick start

  1. Install a debug adapter for your language:

    :DapInstall rust       " or python, go, javascript, java, csharp
  2. Set a breakpoint — press F9 on the line you want to break at

  3. Start debugging — press F5 (or click the play button in the debug sidebar)

  4. A launch.json file is generated automatically in .vimcode/launch.json on first run

Supported adapters

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

Debug sidebar

Open the debug sidebar by clicking the bug icon in the activity bar. It has four interactive sections:

Variables

  • 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

Watch

  • User-defined watch expressions
  • Add with :DapWatch <expr>
  • x or d removes the selected expression

Call Stack

  • Shows all stack frames
  • Enter selects a frame and navigates to its source
  • Active frame marked with

Breakpoints

  • Lists all set breakpoints with conditions
  • Enter jumps to the breakpoint's location
  • x or d removes the selected breakpoint

Navigation

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

Breakpoints

Basic breakpoints

  • F9 — toggle a breakpoint on the current line
  • Breakpoints are shown in the gutter: (normal), (conditional)

Conditional breakpoints

: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 logpoint

Place cursor on a line with a breakpoint, then run the command.

Debugging keys

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

Debug commands

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

launch.json

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.

Format

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "codelldb",
            "request": "launch",
            "program": "${workspaceFolder}/target/debug/myapp",
            "args": [],
            "cwd": "${workspaceFolder}",
            "preLaunchTask": "build"
        }
    ]
}

Variable substitution

Variable Value
${workspaceFolder} Project root directory
${workspaceFolderBasename} Project root directory name

Multiple configurations

Add multiple entries to the configurations array. When starting debugging, VimCode uses the selected configuration from the debug sidebar dropdown.

tasks.json + preLaunchTask

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.

Gutter indicators

Symbol Meaning
Breakpoint set
Conditional breakpoint
Current execution line (stopped)
Breakpoint + current line

Bottom panel

When debugging, the bottom panel has two tabs:

  • Terminal — integrated terminal
  • Debug Output — adapter diagnostics and program output (scrollable, newest at bottom)

Language-specific notes

Rust

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 default

Python

debugpy requires Python 3.7+. Install:

pip install debugpy

Go

delve requires Go 1.16+. Install:

go install github.com/go-delve/delve/cmd/dlv@latest

C#

netcoredbg requires .NET SDK. Install via your package manager or from the Samsung/netcoredbg releases.

Clone this wiki locally