Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 28, 2026·3 min de lecture

nvim-dap — Debug Adapter Protocol Client for Neovim

DAP client implementation enabling debugging directly in Neovim with breakpoints, stepping, variable inspection

Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 29/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
CLI Tool
Installation
Single
Confiance
Confiance : Established
Point d'entrée
nvim-dap
Commande de staging sûr
npx -y tokrepo@latest install 6ccf4dd6-8a1c-11f1-9bc6-00163e2b0d79 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

Introduction

nvim-dap is a Debug Adapter Protocol (DAP) client implementation for Neovim, written by mfussenegger. With over 7,200 stars on GitHub, it brings IDE-level debugging capabilities to Neovim by communicating with language-specific debug adapters through the standardized DAP interface originally created by Microsoft for VS Code.

What nvim-dap Does

nvim-dap connects Neovim to external debug adapters that control program debugging. You can set breakpoints, step through code, inspect variables, evaluate expressions, and navigate the call stack. It handles the DAP JSON-RPC protocol, translating debugger state into Neovim UI elements.

Architecture Overview

The plugin implements the DAP client specification in pure Lua. It communicates with debug adapter processes via JSON-RPC over stdio or TCP. The core manages session lifecycle: initialization, configuration, breakpoint state, and thread/stack frame tracking. UI rendering is minimal in core — nvim-dap-ui provides richer visual interfaces.

Self-Hosting & Configuration

nvim-dap runs locally with no external services. Each language requires a debug adapter binary (e.g., debugpy for Python, codelldb for C/C++/Rust, node-debug2 for JavaScript). Configuration involves two tables in your init.lua: dap.adapters defines how to launch each adapter, and dap.configurations defines launch/attach profiles per filetype. Keybindings are set manually — common mappings include continue, step over, step into, step out, and toggle breakpoint.

Key Features

  • Full DAP protocol support including launch and attach modes
  • Breakpoints: line, conditional, hit count, and log points
  • Step through code: continue, step over, step into, step out
  • Variable inspection via scopes and hover evaluation
  • Call stack navigation across multiple threads
  • REPL for evaluating expressions in the current debug context
  • Extensible through Lua callbacks at every lifecycle event

Comparison with Similar Tools

Compared to Vimspector (Vimscript-based), nvim-dap is Lua-native, lighter, and more composable with other Neovim plugins. VS Code uses the same DAP protocol but bundles its own UI; nvim-dap separates client from UI. Compared to language-specific debugger plugins, nvim-dap provides a unified interface across all DAP-supported languages.

FAQ

Which languages are supported? Any language with a DAP-compliant debug adapter works. Popular ones include Python (debugpy), C/C++/Rust (codelldb, cppdbg), JavaScript/TypeScript (node-debug2, js-debug), Go (delve), and Java (java-debug).

Do I need nvim-dap-ui? No. nvim-dap works standalone with its built-in REPL and sign-based breakpoints. nvim-dap-ui adds floating windows for variables, watches, stacks, and breakpoints.

Can I debug tests? Yes, with the right launch configuration. Plugins like neotest integrate with nvim-dap to debug individual tests directly.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires