Skip to content

Commit

Permalink
Update the doc according to the current version of nvim-dap
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rd4d committed Jul 23, 2024
1 parent 61cd78d commit 71361a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,7 @@ nmap <silent> <leader>td :lua require('dap-go').debug_test()<CR>
## VSCode launch config

Defining the Go debug configurations for all your projects inside your Neovim configuration can be cumbersome and quite strict.
For more flexibility, `nvim-dap` supports the use of the VSCode launch configurations. To use that feature in combination with the predefined `nvim-dap-go` configurations (the ones for launching debug sessions in tests for instance), load the VSCode configurations **BEFORE** calling the `setup()` function of `nvim-dap-go`:

```lua
require("dap.ext.vscode").load_launchjs()
require("dap-go").setup()
```
For more flexibility, `nvim-dap` supports the use of the VSCode launch configurations.

That allows for example to set the Delve port dynamically when you run a debug session. If you create this file in your project (`[root_project]/.vscode/launch.json`):

Expand All @@ -233,6 +228,7 @@ That allows for example to set the Delve port dynamically when you run a debug s
```

A debug session `Remote debug API server` will appear in the choices, and the Delve port will be dynamically set to `4444`.
The current version of nvim-dap always loads the file if it exists.

Please see `:h dap-launch.json` for more information.

Expand Down
11 changes: 2 additions & 9 deletions doc/nvim-dap-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,7 @@ Debugging With dlv in Headless Mode *dap-go-debug-headless*
-----------------------------------------------------------------------
VSCode launch config *dap-go-vscode-launch

1. In your neovim configuration, load the VSCode extension BEFORE
calling the `setup()` function:
>lua
require("dap.ext.vscode").load_launchjs()
require("dap-go").setup()
<

2. Create in your Go project a VSCode launch config file (by
1. Create in your Go project a VSCode launch config file (by
default its path must be `.vscode/launch.json` relative to your
project's root directory):
>json
Expand All @@ -248,7 +241,7 @@ VSCode launch config *dap-go-vscode-launch
}
<

3. A debug session `Remote debug API server` will appear in the choices,
2. A debug session `Remote debug API server` will appear in the choices,
and the Delve port will be dynamically set to `4444`.

Please see `:h dap-launch.json` for more information.
Expand Down

0 comments on commit 71361a9

Please sign in to comment.