ITADN
mfussenegger/nvim-dap

版本发布 6

0.10.0
? · 2025-03-26

## General - Changed how errors are logged for debug adapters. `stderr` output from a debug adapter is now always routed to a dedicated log file that is removed when the debug adapter process exits, unless it exits with an error. The same is the case for `stdout` for adapters communicating via TCP or PIPE. Note that some adapters (like delve) used `stdout` to show the output of the application you're debugging by default. These adapters typically also have an option to instead make use of `OutputEvent` events which will result in the output showing up in the REPL. For delve the configuration property is called `outputMode`. - The terminal buffer (`:help dap-terminal`) now infers the `errorformat` from the buffer from which you started a debug session. - Added a `:DapPause` user command. ## API - Fixed an issue that caused response handlers for `session:request` to receive the `err` also as `response` - The `ErrorResponse` values provided as `err` parameter to event listeners or the response handler of `session:request` now has a `__tostring` metatable method to support `tostring(err)`. - Event listeners (`:help dap-listeners`) can now return `true` to remove a registered listener. This can be useful for once-off listeners and mirrors nvim's autocmd API. - Tweaked the display of the process information for `utils.pick_process` to better fit onto the screen. The function now also takes a `label` and `prompt` option to customize that further. ## REPL - Added `]]` and `[[` keymaps to the REPL buffer to jump between prompts. - Added an `opts` parameter to `repl.execute()` to allow setting the context for an `evaluate` request.

0.9.0
? · 2024-12-20

## Extensibility - Added support for configuration providers. A configuration provider is a function which discovers debug configurations and returns them. This allows nvim-dap extensions to either have dynamic configuration discovery or provide support for additional configuration formats. The two existing ways to create debug configurations - global via `dap.configurations` and per project via `.vscode/launch.json` - have been re-implemented as configuration provider. A side effect of this change is that it is no longer necessary to call a `loadlaunchjs` function to load configurations from `.vscode/launch.json` files and the `type_to_filetypes` mapping is also no longer necessary. The `.vscode/launch.json` file is always read on-demand when starting a new debug session. See `:help dap-providers-config` for more information. - Added a `on_config` hook to allow plugins to pre-process configurations before they're used. See `:help dap-listeners-on_config` for details. A common use case for this is to support custom `${...}` placeholder variables. ## General - Improved the `switchbuf` logic responsibility for selecting the window and buffer on a stopped event. It now has some `source` buffer awareness to avoid running into "Debug adapter reported a frame at line X, cursor position outside buffer" errors - in particular if using a debug adapter which can show disassembly while stepping. - Added a `usevisible` option for the `switchbuf` setting which prevents the cursor position from moving if the breakpoint that was hit is already visible in the current window. See `:help dap.defaults`. - Fixed some races in regards to stopped event handling if the application is resumed concurrently with no user input. This solves some issues with debug adapters like the one for dart/flutter, which automatically pause and resume at the start of a debug session. - Improved process termination behavior to avoid (harmless) errors in the log when using `debugpy` and fix process leaks when exiting nvim in the middle of a debug session using the javascript debug adapter. - Added `all` and `hierarchy` flags to the `terminate` function to allow either terminating all debug sessions, or the full hierarchy of a debug session which contains child-processes. The latter is useful for the javascript debug adapter which makes heavy use of child sessions and where a single terminate would otherwise not end the full debug session. ## Widgets, REPL and expression evaluation - Added a "Copy as expression" action for variables to the action menu (`o`). If yanking the value of a variable it will now also copy it's expression automatically to the `e` register. For example if you evaluate a list and drill into the fourth item which has a `country` property, which in turn has a `name` property and you yank the value, the `e` register might contain an expression like `items[3]["country"]["name"]` - depending on the debug adapter. This is useful if you want to call functions on a specific item shown in a result as you can type `i<C-r>e` to insert the expression. - The REPL and the variables and scopes widget now have a `tagfunc` set which can be used to jump to the declaration location of a variable if the debug adapter provides the information. Use with `<C-]>` or `<C-w ]>` - Added a now `autostart` option to automatically start a debug session when evaluating an expression in the REPL. See `:help dap.defaults`. Tip: Use this with [nluarepl](https://github.com/mfussenegger/nluarepl) to be able to always evaluate Lua expressions in the REPL. - Added support for special `dap-eval://<ft>` buffers which can be used to input multi-line expressions and evaluate them using `:w`. The output is shown in the REPL. - Added a `:DapEval` command which opens a `dap-eval://` buffer in a split window. The command has range support to pre-fill the new buffer with the selected text. ## Terminals - The integrated terminal buffer now inherits the `path` option from the source filetype for better `gf` and `C-w F` support. This is useful if running tests via a debug session where the output often contains stacktraces. - External terminals now correctly use `env` variables provided by the debug adapter. ## Performance - Reduced the overhead of the RPC loop and removed various copy operations. ## launch.json - Creating a new `.vscode/launch.json` file now uses `vim.snippet` to pre-fill the boilerplate. The file will also contain a `$schema` definition linking to [dapconfig-schema](https://github.com/mfussenegger/dapconfig-schema) to get diagnostics and completion support if using `vscode-json-languageserver`. - Improved the error message shown when the `.vscode/launch.json` file doesn't contain valid JSON. ## utils - Added a `splitstr` function which can be used to parse command arguments. Opposed to `vim.split` it preserves whitespace within quotes. See `:help dap.utils.splitstr`.

0.8.0
? · 2024-05-30

## What's Changed This is mostly a maintenance release, with a couple of smaller additions and some fixes. This is the last release to support `nvim-0.8`. The supported versions will be bumped to latest nightly (0.11) and latest stable (0.10.x) after this release. ### DAP compliance fixes: - Fixed the casing of `clientID` and `clientName` in the `initialize` request. - The sequence number now starts at 1 for compatibility with debug adapters like [ansibug][ansibug] - `widgets.hover()` now sets `hover` as context in evaluate requests, instead of `repl` ### Features, Extensibility, UI improvements - Added a health check. This should help find common configuration mistakes like using `~` within the `command` definition of an adapter. - Added an option to override the output handler. See `on_output` under `:help dap.defaults`. - Added `dap.utils.pick_file` a corresponding configuration variable `${command:pickFile}`. This can be used in configurations to prompt for executable files within the current working folder. - `dap.utils.process` now cancels the start of the debug session if you discard the process dialog. - The different widgets will now emit a message if you try to expand an item that has no children. - The `REPL` and floating windows widgets now have `nowrap` set by default. If you don't like that you can create a `dap-repl` or `dap-float` `ftplugin` to override the setting. - Improved the error handling in various locations to give better feedback in case you're holding it wrong. - Tweaked how executable adapters are terminated. This should avoid warnings or errors with adapters like `gdb` who don't like having the their `io` channel get closed early. - Added an option to configure the wait timeout for `pipe` adapters. - The internal `threads` cache is now updated at most once per stopped events. This should solve performance issues when debugging a application with lots of threads. ### launch.json - Inputs are now only evaluated at most once per use of the configuration's entry. ### dap-repl - Fixed an issue that caused `v:count` to be ignored with `G` - Auto-scroll is now only activated on `0G` or `G` [ansibug]: https://github.com/jborean93/ansibug

0.7.0
? · 2023-11-11

## What's Changed ### Core * Added support for domain sockets/named pipes * Adapters used with type=server and an executable will now receive a `sigterm` signal after the connection closes. This should ensure that there are no process leaks. * Debug adapters are no longer terminated if there is a debug session active when exiting vim and the debug session has a configuration with `request=attach`. This avoids terminating processes that were started outside of neovim. * If the debug adapter stops at a breakpoint, and the buffer containing the breakpoint is already open in a window, the window is now focused, unless the active window contains the REPL. * If the debug adapter stops at a breakpoint, `switchbuf` is set to `useopen` or `usetab`, and the same buffer is open in multiple windows, the focused window is now prioritized and will change to the breakpoint location. * Added some error handling improvements: Debug adapters exiting with a code not equal to 0 will return in a warning, and errors in configurations should now always propagate. * Increased the priority of the signs, to make sure breakpoints are shown even if neovim diagnostics are present. * Added a dap.ABORT value that can be used in configurations to abort the start of a session. This can be useful in combination with input prompts. ### REPL * If using the arrow up/down keys, the cursor is now moved to the end of the line * Exposed a `repl.execute` function, to execute text as if entered in the REPL. This can be used in a mapping to evaluate a variable under the cursor, for example: ```lua vim.keymap.set("n", "<leader>di", function() dap.repl.open() dap.repl.execute(vim.fn.expand("<cexpr>")) end) ``` * The REPL history is now no longer cleared when starting a new session, but there is now a maximum size of 100 entries. * The REPL should no longer loose focus on breakpoint stopped events. * Fixed an issue in the completion omnifunc implementation that could lead to inserting duplicate words. For example `-exec b some|` completed to `-exec b -exec b some_function()` instead of `-exec b some_function()` * Fixed some rendering issues that could lead to empty prompts interleaved in the output. * Variables marked as "lazy" by the debug adapter are now automatically resolved when expanding children to avoid having to expand them twice to see the full value. ### Widgets * Added a `listener` option to the `preview` widget * Fixed some issues that could cause floating windows to not close when selecting an item - e.g in the frames or threads views. * Some more widgets will now show some information instead of being empty if there is no data available. * The `hover` widget will now always evaluate an expression, instead of looking it up in the loaded variables. * Variables marked as "lazy" by the debug adapter are now automatically resolved when expanding children to avoid having to expand them twice to see the full value. * The `winopts` of widgets now accept a `title` option. * Calling `.toggle()` on a widget multiple times should no longer append new text each time, but replace the contents. ## New Contributors * @wookayin made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/951 * @atouminet made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/942 * @lervag made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/974 * @MariaSolOs made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/994 * @entropitor made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/1016 * @NSteinhoff made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/1024 * @Aeceon made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/969 * @TheLeoP made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/1043 **Full Changelog**: https://github.com/mfussenegger/nvim-dap/compare/0.6.0...0.7.0

0.6.0
? · 2023-04-09

🐰🥚 ## What's Changed * Some improvements around `startDebugging` that should enable debug-adapters with a `type=server+executable` adapter definition to just work, without requiring extra logic in a adapter factory function. This enables [vscode-js-debug](https://github.com/microsoft/vscode-js-debug/) support. See [Debug Adapter Installation](https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#vscode-js-debug). (https://github.com/mfussenegger/nvim-dap/pull/877, https://github.com/mfussenegger/nvim-dap/pull/913) * Fixed some regressions introduced by the multi-session support. (https://github.com/mfussenegger/nvim-dap/pull/879, https://github.com/mfussenegger/nvim-dap/pull/882, https://github.com/mfussenegger/nvim-dap/pull/906) * Fixed a race condition that could cause `run_to_cursor` to fail if the session changed during its operation. * Fixed lines in scope widget going under a wrong group (https://github.com/mfussenegger/nvim-dap/pull/889) * Changed the stop handling to jump to the top frame if the same thread is already marked as stopped. This can be the case if the execution was resumed using a debug adapter specific REPL command instead of one of the `nvim-dap` step/continue commands. (https://github.com/mfussenegger/nvim-dap/pull/901) * Added a filter option to `pick_process` ## New Contributors * @ktakiman made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/889 * @ArtAndreev made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/900 **Full Changelog**: https://github.com/mfussenegger/nvim-dap/compare/0.5.0...0.6.0

0.5.0
? · 2023-02-22

## What's Changed ### General - Added support for running multiple debugging session in parallel. This is useful if you want to debug both a server application and a client. In this initial version breakpoints are broadcast to all sessions, and whenever a session emits a `stopped` event, this session will get focused. This should allow immediate inspection of variables and stepping from client to server and vice versa. There is also a new `sessions` widget that shows active sessions. For plugins or customizations that use listeners, keep in mind that if you receive a `terminated` or `disconnect` command, there can now still be other sessions running. - Added `startDebugging` support. This will enable support for debugging python applications using multiprocessing with `debugpy`, once support for it is released in `debugpy` itself. The current `debugpy` version 1.6.6 does _not_ support it. This includes use-cases like debugging Django, Flask or Celery with reload enabled. This should also enable support for vscode-js-debug once `startDebugging` is implemented in it as well. - Some resiliency improvements around terminating sessions. In some cases callbacks and listeners weren't triggered, and some late messages weren't processed. - Added support for the `restart` property in a terminated event. This allows debug adapters to restart a debug session. - `up()` and `down()` now no longer flip around at the top or bottom. - Changed the REPL buffer to have `buflisted=false`. - Added the `supportsProgressReporting` capability. By default progress report events sent from the debug adapter are shown via the `status()` function. The main intention is to give users and plugins the capability to subscribe to those events via the listeners and customize the progress reporting display. ### launch.json - Added support for underscores within the name of `${input}` variables - Added support for { label: ..., value: } options in `pickString` `${input}` variables. ### Fixes - Fixed an issue that caused defunct processes when using the `server` adapter type with an `executable`. - Fixed a regression that caused jumping to a frame where the source must be fetched to fail. - Fixed handling of `output` events. The REPL should now no longer break up lines at arbitrary places. ## New Contributors * @feoh made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/834 * @mrcjkb made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/855 * @cryptomilk made their first contribution in https://github.com/mfussenegger/nvim-dap/pull/873 **Full Changelog**: https://github.com/mfussenegger/nvim-dap/compare/0.4.0...0.5.0