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 aloadlaunchjs
function to load configurations from.vscode/launch.json
files and thetype_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 somesource
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 theswitchbuf
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
andhierarchy
flags to theterminate
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 thee
register. For example if you evaluate a list and drill into the fourth item which has acountry
property, which in turn has aname
property and you yank the value, thee
register might contain an expression likeitems[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 typei<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
autostart
option to automatically start a debug session when evaluating an expression in the REPL. See:help dap.defaults
. Tip: Use this with 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 adap-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 bettergf
andC-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 usesvim.snippet
to pre-fill the boilerplate. The file will also contain a$schema
definition linking to dapconfig-schema to get diagnostics and completion support if usingvscode-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 tovim.split
it preserves whitespace within quotes. See:help dap.utils.splitstr
.