Skip to content

Commit

Permalink
Add outputMode to configurations
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 committed Jan 5, 2025
1 parent 6aa8816 commit 1f6582f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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 @@ -138,6 +143,7 @@ local function setup_go_configuration(dap, configs)
request = "attach",
processId = filtered_pick_process,
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
{
type = "go",
Expand All @@ -146,6 +152,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 +161,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 1f6582f

Please sign in to comment.