diff --git a/README.md b/README.md index 7ee3a5a..38974d2 100644 --- a/README.md +++ b/README.md @@ -202,12 +202,7 @@ nmap td :lua require('dap-go').debug_test() ## 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`): @@ -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. diff --git a/doc/nvim-dap-go.txt b/doc/nvim-dap-go.txt index 9efd047..3252561 100644 --- a/doc/nvim-dap-go.txt +++ b/doc/nvim-dap-go.txt @@ -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 @@ -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.