Commit graph

131 commits

Author SHA1 Message Date
Mathias Fussenegger
20a4859ebd Add a usevisible switchbuf option
Closes https://github.com/mfussenegger/nvim-dap/issues/1328
2024-09-05 17:29:05 +02:00
Antoine Bertin
7bf34e0917
Add utils.splitstr function (#1276)
Fixes #629, #816 and #1267

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-08-09 14:24:24 +02:00
Simone Rubino
f8b0b11b0a
Fix text highlight in docs (#1296) 2024-08-01 16:17:08 +02:00
Mathias Fussenegger
eebde2c241 Move on_config hooks from providers to listeners
Fits a bit better and there may be other client generated events in the
future.
2024-06-01 12:32:50 +02:00
Mathias Fussenegger
ea8f6311b1 Add on_config hooks to dap.providers
Should solve https://github.com/mfussenegger/nvim-dap/issues/720
2024-05-31 18:03:18 +02:00
Mathias Fussenegger
36e72ed2a6 Add dap. namespace to luacats class definitions 2024-05-30 16:10:25 +02:00
Mathias Fussenegger
54f891ae4c Add config providers; always load .vscode/launch.json
- Introduces a dap.providers.configs table which plugins can extend to
  add additional sources for dynamic configuration generation

- Implements the two built-in configuration sources as providers

- `.vscode/launch.json` files are now loaded automatically by one of
  these providers. The entries from the file always display even if the
  type doesn't match the current filetype. This gets rid of the
  `type_to_filetypes` mapping requirements.
2024-05-30 15:46:53 +02:00
gh-liu
316f4edd1e Add variable ${command:pickFile} 2024-05-30 11:16:52 +02:00
Mathias Fussenegger
cf8d6e2885 Add path option for utils.pick_file 2024-05-23 11:22:03 +02:00
Andreas Schneider
fa226c4125
Add utils.pick_file() (#1190)
This implements a file picker, to pick the file you want to execute with
the debugger.

Fixes #1130

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-05-23 09:37:25 +02:00
Mathias Fussenegger
6ae8a14828 Allow to configure max wait timeout for pipe adapter
5000ms can be too short.
See https://github.com/mfussenegger/nvim-dap/discussions/1147
2024-04-18 11:30:22 +02:00
Ole
405df1dcc2
Fix link to dap.continue within dap-configuration docs section (#1177) 2024-03-25 17:04:34 +01:00
Mathias Fussenegger
c1695e500c Allow to override output event handler 2024-03-17 21:02:49 +01:00
dubrayn
c43c2473ec
Fix typo in doc/dap.txt (#1174) 2024-03-15 11:41:50 +01:00
Dennis Rall
780fd4dd06
Add missing comma to launch.json example in docs (#1151) 2024-02-06 18:59:32 +01:00
Mathias Fussenegger
9d81c11fd1 Add docs for dap-session and request method 2023-11-08 14:25:54 +01:00
Mathias Fussenegger
ef21207972 Add dap.ABORT to allow config functions to abort session
Closes https://github.com/mfussenegger/nvim-dap/issues/1036
2023-11-01 15:18:37 +01:00
Mathias Fussenegger
27d65bd630 Expose repl.execute
For mappings like:

    dap.repl.open()
    dap.repl.execute(vim.fn.expand("<cexpr>"))

`widgets.hover()` is nice to zoom in on a single variable, but sometimes
you want to compare the values of several variables. Having their output
displayed in the REPL next to each other makes that easier.
2023-10-07 15:00:06 +02:00
Mathias Fussenegger
897c433ff2 Add type annotation for step_into opts; correct docs 2023-08-21 17:17:49 +02:00
Mathias Fussenegger
5a39d1fe39 Add listener option to preview widget 2023-07-31 18:33:20 +02:00
Mathias Fussenegger
2f28ea843b Add support for unix domain sockets and named pipes
For adapters like cmake which don't support stdin or TCP

Closes https://github.com/mfussenegger/nvim-dap/issues/924

For example:

    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",
      }
    }
2023-07-27 09:49:50 +02:00
Maria José Solano
9abbf79136
Use ps -U instead of ps -u (#994)
Fixes #993
2023-07-27 07:18:35 +02:00
Mathias Fussenegger
0a02ed103e Use ps ah -u $USER for dap.utils.pick_process
To show more processes. Otherwise it's restricted to terminal processes.
2023-07-26 16:34:43 +02:00
Mathias Fussenegger
bb1ddce6cd Fix overwrite spelling
Closes https://github.com/mfussenegger/nvim-dap/issues/975
2023-06-30 08:48:34 +02:00
Mathias Fussenegger
debd7c2f80 Add filter option to pick_process 2023-04-07 13:22:24 +02:00
Mathias Fussenegger
1dd02e82c7 Document continue opts 2023-03-31 08:49:52 +02:00
Mathias Fussenegger
7389e85233 Pass parent session to adapter factory
For the `startDebugging` implementation of `vscode-js-debug` the client
needs to connect to the parent adapter instance.

This change enables an adapter configuration like this:

```lua
require("dap").adapters["pwa-node"] = function(on_config, config, parent)
  local target = config["__pendingTargetId"]
  if target and parent then
    local adapter = parent.adapter --[[@as ServerAdapter]]
    on_config({
      type = "server",
      host = "localhost",
      port = adapter.port
    })
  else
    on_config({
      type = "server",
      host = "localhost",
      port = "${port}",
      executable = {
        command = "node",
        args = {"/path/to/js-debug/src/dapDebugServer.js", "${port}"},
      }
    })
  end
end
```
2023-03-24 18:44:26 +01:00
Mathias Fussenegger
9915c3a94e Add tag for dap.status in docs 2023-02-22 20:09:11 +01:00
Mathias Fussenegger
e8dd631ee4 Support label/value objects in ${input} pickString options
Co-authored-by: Giancarlo Misasi <giancarlo-misasi@users.noreply.github.com>
2023-02-22 15:01:56 +01:00
Mathias Fussenegger
0199d026da Set default for ${input} to empty string
Co-authored-by: Giancarlo Misasi <giancarlo-misasi@users.noreply.github.com>
2023-02-22 15:01:56 +01:00
Mathias Fussenegger
0d77088e0a Add support for running concurrent debug sessions
New API:

- `dap.sessions()` to return active debug sessions
- `dap.ui.widgets.sessions` to show active debug sessions

Step functions will change the focus automatically if the currently
focused session is not stopped.
This should make common scenarios like debugging client + server where
you step from making requests on the client to receiving request on the
server convenient.

Note that this is unrelated to `startDebugging` support. The PR here is
about concurrent top-level sessions. `startDebugging` support will
introduce hierarchical sessions. (Probably including something like
`children` in the `Session` object)
2023-02-08 13:45:53 +01:00
Mathias Fussenegger
e11545b33a Add example mappings for widgets to help 2023-01-28 09:33:14 +01:00
Chris Patti
5b52d25a83
Use Lua for example mappings in help (#834)
Everything else is in Lua too
2023-01-28 07:50:31 +01:00
Mathias Fussenegger
0efe0eb17e Shuffle documented functions a bit
Moves lower level functions that users typically do not want to use
further down. E.g there is almost no reason to use `disconnect` or
`close`, but users should use `terminate()` instead.

Same for `launch` and `attach` which are low level APIs that users
should not call. There is `run` and `continue` instead.
2023-01-14 14:15:29 +01:00
Mathias Fussenegger
4a8b1bd83f Document restart and implement !supportsRestartRequest fallback 2023-01-14 14:15:29 +01:00
Mathias Fussenegger
be73a0be5c Add a focus_frame function
Closes https://github.com/mfussenegger/nvim-dap/issues/796
2023-01-05 10:51:02 +01:00
Mathias Fussenegger
4902566da4 Add switchbuf setting to control jump to breakpoint behavior
Follow up to https://github.com/mfussenegger/nvim-dap/pull/789

Should close:

- https://github.com/mfussenegger/nvim-dap/issues/793
- https://github.com/mfussenegger/nvim-dap/issues/676
2023-01-05 10:25:29 +01:00
Rónán Carrigan
2bb4827658
Pass request seq number to listeners (#798)
Allows users to distinguish between their own requests and other
requests when listening.

The motiviation for this is that nvim-dap maintains some state
internally for its functionality (e.g. session.current_frame) which
nvim-dap-ui needs to be aware of so users don't have issues with the two
plugins showing different information. Some of this state is set after
requests such as `stackTrace` for the current frame. nvim-dap-ui needs
to listen for this and refresh after it has been processed. Issues arise
when the listener causes more stack trace requests, leading to infinite
recursive calls because the listener can't distinguish between calls
made by nvim-dap and itself.

This is occurring now because of a large refactor of nvim-dap-ui which
moves away from maintaining state (which previously used the nvim-dap
request result) to making direct calls to the debugging adapter for all
data.
2023-01-04 13:24:21 +01:00
Mathias Fussenegger
69b7c684cd Support system specific properties in launch.json
Closes https://github.com/mfussenegger/nvim-dap/issues/794
2022-12-31 15:39:44 +01:00
Mathias Fussenegger
dc69846b0b Support calling continue and step with a count
Closes https://github.com/mfussenegger/nvim-dap/issues/797
2022-12-31 14:09:23 +01:00
Mathias Fussenegger
a8fd28aec4 Add type annotations to code examples in docs 2022-12-09 13:57:40 +01:00
Mathias Fussenegger
3440b0df4c Add dedicated documentation for the dap.defaults settings 2022-12-09 13:57:40 +01:00
Mathias Fussenegger
87572115d8 Support __call metatable on configuration 2022-11-28 21:30:40 +01:00
Farhan Mustar
e71da68e59
Add support for env variables reference. (#719)
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2022-10-14 20:00:25 +02:00
Mathias Fussenegger
6b12294a57 Add restart_frame function and DapRestartFrame command
Allows to restart execution of the current frame
2022-10-09 11:06:58 +02:00
Mathias Fussenegger
698e573913 Add support for ${command:pickProcess} variable 2022-10-09 10:57:59 +02:00
Mathias Fussenegger
d9b315a816 Expose json_decode for overrides in ext.vscode
Closes https://github.com/mfussenegger/nvim-dap/issues/650
2022-09-08 10:52:29 +02:00
koopa
ea25d6d787
Allow sign customization without importing dap first (#664)
if a sign is already set in some user config we do not overwrite the
value and skip it. This enables sign configuration by the user
regardless where the user requires the dap plugin
2022-08-29 23:23:25 +02:00
Mathias Fussenegger
cc44f047f3 Add support for inputs in vscode/launch.json 2022-08-27 14:05:08 +02:00
Mathias Fussenegger
ad8b0de205 Increase amount of connect retries; expose setting
Should solve https://github.com/mfussenegger/nvim-dap/issues/641
2022-08-15 10:17:07 +02:00