Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Debug Adapter Protocol client implementation for Neovim

License

NotificationsYou must be signed in to change notification settings

mfussenegger/nvim-dap

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

demo

Installation

LuaRocks

  • 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 ALL or: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

Usage

A typical debug flow consists of:

  • Setting breakpoints via:DapToggleBreakpoint or:lua require'dap'.toggle_breakpoint().
  • Launching debug sessions and resuming execution via:DapNew and:DapContinue or:lua require'dap'.continue().
  • Stepping through code via:DapStepOver,:DapStepInto or 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:

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.

Supported languages

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.

Goals

  • 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.

Non-Goals

  • 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.

  • nvim-dapconfig

  • Vim support. It's not going to happen. Usevimspector instead.

Alternatives

Contributing

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.

Features

  • 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

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp