Skip to content

Commit

Permalink
Add outputMode to configurations (#109)
Browse files Browse the repository at this point in the history
nvim-dap had a change to log stdout/stderr of debug adapters to log
files instead of redirecting it to the repl.
(See mfussenegger/nvim-dap#1405)

delve by default outputs print statements on stdout instead of using
output events, which means they're no longer visible.

Setting `outputMode = "remote"` in a configuration causes delve to use
output events, which nvim-dap shows in the repl

See also mfussenegger/nvim-dap#1407
  • Loading branch information
mfussenegger authored Jan 14, 2025
1 parent 6aa8816 commit 1bacf2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/dap-go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local default_config = {
-- Automativally handle the issue on Windows where delve needs
-- to be run in attched mode or it will fail (actually crashes).
detached = vim.fn.has("win32") == 0,
output_mode = "remote",
},
tests = {
verbose = false,
Expand Down Expand Up @@ -107,6 +108,7 @@ local function setup_go_configuration(dap, configs)
request = "launch",
program = "${file}",
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
Expand All @@ -115,6 +117,7 @@ local function setup_go_configuration(dap, configs)
program = "${file}",
args = get_arguments,
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
Expand All @@ -123,13 +126,15 @@ local function setup_go_configuration(dap, configs)
program = "${file}",
args = get_arguments,
buildFlags = get_build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
name = "Debug Package",
request = "launch",
program = "${fileDirname}",
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
Expand All @@ -146,6 +151,7 @@ local function setup_go_configuration(dap, configs)
mode = "test",
program = "${file}",
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
Expand All @@ -154,6 +160,7 @@ local function setup_go_configuration(dap, configs)
mode = "test",
program = "./${relativeFileDirname}",
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
}

Expand Down

0 comments on commit 1bacf2f

Please sign in to comment.