karet speaks the Debug Adapter Protocol (DAP) natively — the same protocol VS
Code's debuggers use — through the karet-dap client and the backend's
debugger orchestration. Any conforming adapter works; nothing is bundled or
downloaded (adapters are toolchain-coupled, so installing them is deliberately
yours: the same "explicitly manual" policy as SDK-coupled language servers).
-
Install an adapter and make sure it is on
PATH. Known out of the box:Adapter name Runs Notes codelldbnative (Rust/C/C++/…) launched as codelldb --port ${port}over TCPlldb-dapnative ships with LLVM gdbnative gdb -i dap, GDB 14+debugpyPython python3 -m debugpy.adapter;pip install debugpy -
Add a configuration (project
.karet/setting.jsoncis the natural home):argumentsis passed to the adapter verbatim (each adapter documents its own launch/attach schema —program,args,cwd,env,pid, …). There is nolaunch.jsoncompatibility layer, and no variable interpolation yet: write real paths. -
F9toggles a breakpoint on the caret line (or click the gutter's leading marker column);F5starts the first configuration.
Custom or differently-installed adapters get an entry under debug.adapters;
a configuration's adapter field then names it:
{
"debug": {
"adapters": {
"my-lldb": { "command": "/opt/llvm/bin/lldb-dap", "args": [], "transport": "stdio" }
}
}
}| Key | Action |
|---|---|
F5 |
Start (first configuration) / continue when stopped |
Shift+F5 |
Stop (terminates the debuggee when the adapter supports it) |
F6 |
Pause |
F9 |
Toggle breakpoint on the caret line |
F10 |
Step over |
F11 / Shift+F11 |
Step into / step out |
The explorer keeps its F5 refresh while it has focus.
- Breakpoints render in the gutter:
●once the adapter verifies them,○while armed but unverified (set before a session, or not yet bound — adapters verify late, and the marker updates when they do). - The status bar carries the session state (
⏳ debug,▶ debug,⏸ breakpoint); stops jump the editor to the stopped line. - The Debug panel (
Ctrl+6, or its activity-bar icon) shows the stopped thread's call stack (Enter on a frame jumps to it and loads its scopes), a lazily-fetched variables tree (expand to fetch children; the first cheap scope auto-expands), the evaluate log, and the console tail with ANSI colors preserved. Everything per-stop clears on resume — nothing stale survives acontinue. - The stopped line carries its own background tint until the debuggee resumes.
- Evaluate (palette:
Debug: Evaluate Expression) prompts for an expression and runs it in the selected frame's context; results (and adapter rejections) append to the panel's evaluate log.
- Breakpoints are per-file full-replace: every toggle sends the file's whole set, exactly the protocol's model, so editor and adapter can never drift.
- The launch handshake is capability-gated:
setExceptionBreakpointsis only sent when the adapter offers filters (default-on filters selected), andconfigurationDoneonly when supported. - One session at a time; a second
F5while running tells you so.
{ "debug": { "configurations": [ { "name": "run tests binary", "adapter": "codelldb", "arguments": { "program": "target/debug/app", "cwd": "." } } ] } }