Skip to content

Releases: mfussenegger/nvim-dap

0.8.0

30 May 10:29
0.8.0
Compare
Choose a tag to compare

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 and clientName in the initialize request.
  • The sequence number now starts at 1 for compatibility with debug adapters
    like 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 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 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

0.7.0

11 Nov 07:59
0.7.0
Compare
Choose a tag to compare

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 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:
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

Full Changelog: 0.6.0...0.7.0

0.6.0

09 Apr 05:27
0.6.0
Compare
Choose a tag to compare

🐰🥚

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

Full Changelog: 0.5.0...0.6.0

0.5.0

22 Feb 14:27
0.5.0
Compare
Choose a tag to compare

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.

    To start a second debug session you have to call continue({ new = true })
    or run(config) with a configuration that has a different name than the
    current active session, or with run(config, { new = true }).

    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.

    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 with debugpy, once support for it is
    released in debugpy itself. The current debugpy 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() 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

Full Changelog: 0.4.0...0.5.0

0.4.0

11 Jan 14:44
0.4.0
Compare
Choose a tag to compare

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 new switchbuf 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. calling G) 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 like vim.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 or linux 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

Full Changelog: 0.3.0...0.4.0

0.3.0

24 Sep 11:22
0.3.0
Compare
Choose a tag to compare
  • 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 like codelldb 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 in vscode/launch.json files. See :help dap-launch.json for details.

  • Exposed a json_decode function in dap.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 call sign_define after having imported the dap module.

  • Improved the handling of error messages sent by debug adapters.

  • The DapStopped highlight is now cleared when using dap.close().

  • Added a DapLoadLaunchJSON command that maps to require('dap.ext.vscode').load_launchjs()

0.2.0

05 Aug 14:17
0.2.0
Compare
Choose a tag to compare
  • 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 the auto_continue_if_many_stopped option is set to false. See Demo

  • Functions used in configurations (:h dap-configuration) can now also return coroutine/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 outer coroutine 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 pick_process helper function which can be used in configurations to select a running process is now using vim.ui.select instead of inputlist.

  • Added a dap-type variable to the integrated terminal buffer. This dap-type variable contains the value of the :h dap-configuration type.

  • Added support for the breakpoint event with reason = '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 like vim.keymap.set('v', '<leader>dh', require('dap.ui.widgets').hover). The require("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 like vim.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

21 Jul 09:03
0.1.0
Compare
Choose a tag to compare

Initial release

After almost 400 commits and more than 2 years it's time