Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork247
Debug Adapter Protocol client implementation for Neovim
License
mfussenegger/nvim-dap
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
nvim-dap is a Debug Adapter Protocol client implementation forNeovim.nvim-dap allows you to:
- Launch an application to debug
- Attach to running applications and debug them
- Set breakpoints and step through code
- Inspect the state of the application
- Install nvim-dap like any other Neovim plugin:
git clone https://codeberg.org/mfussenegger/nvim-dap.git ~/.config/nvim/pack/plugins/start/nvim-dap- Or withvim-plug:
Plug 'mfussenegger/nvim-dap' - Or withpacker.nvim:
use 'mfussenegger/nvim-dap'
- Generate the documentation for nvim-dap using
:helptags ALLor:helptags <PATH-TO-PLUGIN/doc/>
Supported Neovim versions:
- Latest nightly
- 0.11.x (Recommended)
- 0.10.4
You'll need to install and configure a debug adapter per language. See
- :help dap.txt
- theDebug-Adapter Installation wiki
:help dap-adapter:help dap-configuration
A typical debug flow consists of:
- Setting breakpoints via
:DapToggleBreakpointor:lua require'dap'.toggle_breakpoint(). - Launching debug sessions and resuming execution via
:DapNewand:DapContinueor:lua require'dap'.continue(). - Stepping through code via
:DapStepOver,:DapStepIntoor the correspondingfunctions:lua require'dap'.step_over()and:lua require'dap'.step_into(). - Inspecting the state:
- Via the built-in REPL:
:lua require'dap'.repl.open()- Try typing an expression followed by ENTER to evaluate it.
- Try commands like
.help,.frames,.threads. - Variables with structure can be expanded and collapsed with ENTER on thecorresponding line.
- Via the widget UI (
:help dap-widgets). Typically you'd inspect values,threads, stacktrace ad-hoc when needed instead of showing the informationall the time, but you can also create sidebars for a permanent display - Via UI extensions:
- IDE like:nvim-dap-ui
- Middle ground between the IDE like nvim-dap-ui and the built-in widgets:nvim-dap-view
- Show inline values:nvim-dap-virtual-text
- Via the built-in REPL:
See:help dap.txt,:help dap-mapping and:help dap-api.
Tip:
The arrow keys are good candidates for keymaps to step through code as theirdirection resembles the direction you'll step to.
- Down: Step over
- Right: Step into
- Left: Step out
- Up: Restart frame
You can setup keymaps temporary during a debug session using event listeners.See:help dap-listeners.
In theory all of the languages for which a debug adapter exists should besupported.
The Wiki is community maintained. If you got an adapter working that isn'tlisted yet, please extend the Wiki.
Some debug adapters havelanguage specificextensions.Using them over a manual configuration is recommended, as they'reusually better maintained.
If the instructions in the wiki for a debug adapter are not working, considerthat debug adapters may have made changes since the instructions were written.You may want to read the release notes of the debug adapters or try with anolder version. Please update the wiki if you discover outdated examples.
Have a basic debugger in Neovim.
Extensibility and double as a DAP client library. This allows other pluginsto extend the debugging experience. Either by improving the UI or by makingit easier to debug parts of an application.
All known extensions are listed in theWiki. The wiki is communitymaintained. Please add new extensions if you built one or if you discoveredone that's not listed.
Debug adapter installations are out of scope. It's not the business of aneditor plugin to re-invent a package manager. Use your system packagemanager. Use Nix. Use Ansible.
Vim support. It's not going to happen. Usevimspector instead.
Contributions are welcome:
- Give concrete feedback about usability.
- Triage issues. Many of the problems people encounter are debugadapter specific.
- Improve upstream debug adapter documentation to make them more editoragnostic.
- Improve the Wiki. But please refrain from turning it into comprehensive debugadapter documentation that should go upstream.
- Write extensions.
Before making direct code contributions, please create a discussion or issue toclarify whether the change is in scope of the nvim-dap core.
Please keep pull requests focused and don't change multiple things at the sametime.
- launch debug adapter
- attach to debug adapter
- toggle breakpoints
- breakpoints with conditions
- logpoints
- set exception breakpoints
- step over, step into, step out
- step back, reverse continue
- Goto
- restart
- stop
- pause
- evaluate expressions
- REPL (incl. commands to show threads, frames and scopes)
About
Debug Adapter Protocol client implementation for Neovim
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
