Debugging a dotnet application with nvim
use .vscode/launch.json to define how to launch the application. Then you're all good.
next step is to find out how to make some of the other launch options to go away.
but now it is time to sleep.
the answer ended up being:
return {
{
"mfussenegger/nvim-dap",
opts = function()
local dap = require("dap")
dap.adapters.netcoredbg = {
type = "executable",
command = "/users/tmadsen/.cache/netcoredbg/netcoredbg",
args = { "--interpreter=vscode" },
}
require("dap.ext.vscode").load_launchjs(nil, {
cs = { "netcoredbg" },
})
vim.keymap.set("n", "<F5>", function()
require("dap").continue()
end)
vim.keymap.set("n", "<F10>", function()
require("dap").step_over()
end) -- F10 for step over
vim.keymap.set("n", "<F11>", function()
require("dap").step_into()
end)
vim.keymap.set("n", "<F12>", function()
require("dap").step_out()
end)
end,
},
{
-- Disable this plugin. It will cause Mason to install a netcoredbg version that is different from the one I have installed.
-- than the one we want. And that will produce a silly extra option when launching an app in debug ("NetCoreDbg: Launch").
"jay-babu/mason-nvim-dap.nvim",
enabled = false,
},
}
there's a special way to install the requried dap tool for mac, but I forget right now exactly what that was. I made it work by downloading it from somewhere at first, but later I found out about the way to get it installed with mason or something like that.