Releases: mfussenegger/nvim-dap
0.8.0
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), latest
stable (0.10.x) and 0.9.5 after this release.
DAP compliance fixes:
- Fixed the casing of
clientID
andclientName
in theinitialize
request. - The sequence number now starts at 1 for compatibility with debug adapters
like ansibug widgets.hover()
now setshover
as context in evaluate requests, instead
ofrepl
Features, Extensibility, UI improvements
-
Added a health check. This should help find common configuration mistakes
like using~
within thecommand
definition of an adapter. -
Added an option to override the output handler. See
on_output
under:help dap.defaults
. -
Added
dap.utils.pick_file
and 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 havenowrap
set by default. If
you don't like that you can create adap-repl
ordap-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 likegdb
who don't like having the theirio
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 withG
- Auto-scroll is now only activated on
0G
orG
0.7.0
What's Changed
Core
- Added support for domain sockets/named pipes. See
:help dap-adapter
for
more information. An example of how it can be used:
local dap = require("dap")
dap.adapters.cmake = {
type = "pipe",
pipe = "${pipe}",
executable = {
command = "cmake",
args = {"--debugger", "--debugger-pipe", "${pipe}"}
}
}
dap.configurations.cmake = {
{
name = "Build",
type = "cmake",
request = "launch",
}
}
- 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 touseopen
orusetab
, 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:
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 thepreview
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 atitle
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 #951
- @atouminet made their first contribution in #942
- @lervag made their first contribution in #974
- @MariaSolOs made their first contribution in #994
- @entropitor made their first contribution in #1016
- @NSteinhoff made their first contribution in #1024
- @Aeceon made their first contribution in #969
- @TheLeoP made their first contribution in #1043
Full Changelog: 0.6.0...0.7.0
0.6.0
🐰🥚
What's Changed
-
Some improvements around
startDebugging
that should enable debug-adapters with atype=server+executable
adapter definition to just work, without requiring extra logic in a adapter factory function. This enables vscode-js-debug support. See Debug Adapter Installation. (#877, #913) -
Fixed some regressions introduced by the multi-session support. (#879, #882, #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 (#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. (#901) -
Added a filter option to
pick_process
New Contributors
- @ktakiman made their first contribution in #889
- @ArtAndreev made their first contribution in #900
Full Changelog: 0.5.0...0.6.0
0.5.0
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 astopped
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 newsessions
widget that shows active
sessions.To start a second debug session you have to call
continue({ new = true })
orrun(config)
with a configuration that has a different name than the
current active session, or withrun(config, { new = true })
.For plugins or customizations that use listeners, keep in mind that if you
receive aterminated
ordisconnect
command, there can now still be other
sessions running.For an example of an advanced use-case using this capability, see Debugging
Neovim with Neovim and nvim-dap -
Added
startDebugging
support. This will enable support for debugging python
applications using multiprocessing withdebugpy
, once support for it is
released indebugpy
itself. The currentdebugpy
version 1.6.6 does not
support it but you can already try it using a version installed via git from
their main branch. 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()
anddown()
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 thestatus()
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 anexecutable
. - 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 #834
- @mrcjkb made their first contribution in #855
- @cryptomilk made their first contribution in #873
Full Changelog: 0.4.0...0.5.0
0.4.0
What's Changed
General
- Dropped support for Neovim 0.6.x
- Removed deprecated functions from dap.utils
- Exception breakpoint information is now reported via the
vim.diagnostic
interface instead of writing the information to the REPL. Continue
and step functions can now be called with a count to execute
multiple steps or continue several times automatically.- Changed the behavior for the window selection when jumping to a frame when a
breakpoint has been hit. Added a newswitchbuf
setting derived from the
global Neovim'switchbuf'
setting that can be used to change the behavior
to some degree. - Added autoscroll to the REPL. This behaves similarly to autoscroll in
terminal buffers. If you're at the end of the buffer (e.g. callingG
) it
will activate, leaving the buffer while not at the end will disable it.
New functions
- Added a
focus_frame
function which allows to focus the current frame while
stopped at a breakpoint. - Added a
restart_frame
function which allows to reset the execution of the
current frame and restart it if the debug adapter supports it. - Added a
.clear
command to the REPL.
Configurations
- Added support for a
${command:pickProcess}
variable - Added support for
${env:<NAME>}
variables. - Added support for
__call
metatables on configurations. This allows to
dynamically resolve multiple properties when a configuration is used. This
can be useful if you use something likevim.fn.input
to compute one
property and you're able to infer a second property from this input.
launch.json
- Added basic templating support. Creating a new
.vscode/launch.json
file now
adds the basic boilerplate. - Saving a
.vscode/launch.json
file now auto applies the configurations. - Added support for system specific
osx
,windows
orlinux
properties.
This allows users to use different properties depending on the system, for
example:
{
"type": "cppdbg",
"request": "launch",
"name": "Launch CPP",
"MIMode": "gdb",
"linux": {
"miDebuggerPath": "/usr/bin/gdb"
},
"windows": {
"miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
}
}
UI widgets
- The same type of UI widget can now be opened multiple times
- Floating widgets with auto resize when expanding variables will no longer try
to auto-resize if converted from float to regular window
New Contributors
- @ANtlord made their first contribution in #696
- @farhanmustar made their first contribution in #719
- @jedrzejboczar made their first contribution in #724
- @cladera made their first contribution in #723
- @ldelossa made their first contribution in #779
Full Changelog: 0.3.0...0.4.0
0.3.0
-
Increased the amount of connect retries when connecting to a debug-adapter of type
server
and exposed a setting to change the number of retries. This should help with debug adapters likecodelldb
where you spawn an executable that starts a service listening on TCP. It may take a while for that service to become available and the connect attempt could initially fail. -
Added support for custom
inputs
invscode/launch.json
files. See:help dap-launch.json
for details. -
Exposed a
json_decode
function indap.ext.vscode
to allow users to override it with alternative json parsers. This can be used to hook in a JSON5 parser for better compatibility with Microsoft JSON. -
Added support for customizing the sign symbols before calling
require('dap')
. Previously it was necessary to callsign_define
after having imported thedap
module. -
Improved the handling of error messages sent by debug adapters.
-
The
DapStopped
highlight is now cleared when usingdap.close()
. -
Added a
DapLoadLaunchJSON
command that maps torequire('dap.ext.vscode').load_launchjs()
0.2.0
-
Improved the handling of disconnects. Previously if a user invoked terminate or disconnect multiple times, it would terminate or disconnect the session with the first invocation and the remaining invocations would eventually timeout. This timeout could cause a new session started later to disconnect as well, leading to an inconsistent state and unusable session.
-
Stepping operations (
step_out
,step_into
,step_over
..) will now prompt for a thread to resume if there is no stopped thread in focus and if other threads are paused. This can be the case if either, threads were manually paused or if theauto_continue_if_many_stopped
option is set to false. See Demo -
Functions used in configurations (
:h dap-configuration
) can now also returncoroutine
/thread
values. This allows to use asynchronous operations to compute values to use in the configuration. There are some constraints:- The function must return a suspended
coroutine
. - The function must eventually hand back control to
nvim-dap
by resuming the outercoroutine
with the result. If it fails to do so, the launch-session operation will become stuck.
An example:
foo = function() return coroutine.create(function(dap_run_co) local items = {'one', 'two'} vim.ui.select(items, { label = 'foo> '}, function(choice) coroutine.resume(dap_run_co, choice) end) end) end,
- The function must return a suspended
-
The
pick_process
helper function which can be used in configurations to select a running process is now usingvim.ui.select
instead ofinputlist
. -
Added a
dap-type
variable to the integrated terminal buffer. Thisdap-type
variable contains the value of the:h dap-configuration
type
. -
Added support for the
breakpoint
event withreason = 'changed'
to allow debug adapters to change the verified state of breakpoints.
Widgets
-
The
hover
widget will now by default evaluate the selected expression if in visual mode. This makes it possible to define keymaps likevim.keymap.set('v', '<leader>dh', require('dap.ui.widgets').hover)
. Therequire("dap.utils").get_visual_selection_text
function which could be used before to get a similar behavior is now deprecated. -
Added a new
preview
widget that can be used to show the values of variables in the preview window. You can create a mapping likevim.keymap.set({'n', 'v'}, '<leader>dp', require('dap.ui.widgets').preview)
to use it. -
The
presentationHint.lazy
flag is now recognized in widgets rendering variables. This has the effect that lazy variables no longer take an extra line when loaded but instead the existing line is updated in-place.
REPL
- Evaluating expressions in the REPL should no longer render a
dap>
prompt between the first line of the result and subsequent lines.
0.1.0
Initial release
After almost 400 commits and more than 2 years it's time