Skip to content

Commit

Permalink
Added detached option to fix windows error (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalyn45 authored Mar 25, 2024
1 parent 64f7340 commit 36abe1d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ lua require('dap-go').setup {
-- passing build flags using args is ineffective, as those are
-- ignored by delve in dap mode.
build_flags = "",
-- whether the dlv process to be created detached or not. there is
-- an issue on Windows where this needs to be set to false
-- otherwise the dlv server creation will fail.
detached = true
},
}
```
Expand Down
15 changes: 13 additions & 2 deletions doc/nvim-dap-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,20 @@ The example bellow shows all the possible configurations:
-- a string that defines the port to start delve debugger.
-- default to string "${port}" which instructs nvim-dap
-- to start the process in a random available port
port = "${port}"
port = "${port}",
-- additional args to pass to dlv
args = {}
args = {},
-- the build flags that are passed to delve.
-- defaults to empty string, but can be used to provide flags
-- such as "-tags=unit" to make sure the test suite is
-- compiled during debugging, for example.
-- passing build flags using args is ineffective, as those are
-- ignored by delve in dap mode.
build_flags = "",
-- whether the dlv process to be created detached or not. there is
-- an issue on Windows where this needs to be set to false
-- otherwise the dlv server creation will fail.
detached = true
},
}
<
Expand Down
2 changes: 2 additions & 0 deletions lua/dap-go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local default_config = {
port = "${port}",
args = {},
build_flags = "",
detached = true,
},
}

Expand Down Expand Up @@ -53,6 +54,7 @@ local function setup_delve_adapter(dap, config)
executable = {
command = config.delve.path,
args = args,
detached = config.delve.detached,
},
options = {
initialize_timeout_sec = config.delve.initialize_timeout_sec,
Expand Down

0 comments on commit 36abe1d

Please sign in to comment.