0.9.0
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.configurationsand 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 aloadlaunchjsfunction to load configurations from.vscode/launch.jsonfiles and thetype_to_filetypesmapping is also no longer necessary. The.vscode/launch.jsonfile is always read on-demand when starting a new debug session. See:help dap-providers-configfor more information. -
Added a
on_confighook to allow plugins to pre-process configurations before they're used. See:help dap-listeners-on_configfor details. A common use case for this is to support custom${...}placeholder variables.
General
-
Improved the
switchbuflogic responsibility for selecting the window and buffer on a stopped event. It now has somesourcebuffer 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
usevisibleoption for theswitchbufsetting 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
debugpyand fix process leaks when exiting nvim in the middle of a debug session using the javascript debug adapter. -
Added
allandhierarchyflags to theterminatefunction 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 theeregister. For example if you evaluate a list and drill into the fourth item which has acountryproperty, which in turn has anameproperty and you yank the value, theeregister 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>eto insert the expression. -
The REPL and the variables and scopes widget now have a
tagfuncset 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
autostartoption 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
:DapEvalcommand 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
pathoption from the source filetype for bettergfandC-w Fsupport. This is useful if running tests via a debug session where the output often contains stacktraces. -
External terminals now correctly use
envvariables 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.jsonfile now usesvim.snippetto pre-fill the boilerplate. The file will also contain a$schemadefinition linking to dapconfig-schema to get diagnostics and completion support if usingvscode-json-languageserver. -
Improved the error message shown when the
.vscode/launch.jsonfile doesn't contain valid JSON.
utils
- Added a
splitstrfunction which can be used to parse command arguments. Opposed tovim.splitit preserves whitespace within quotes. See:help dap.utils.splitstr.