feat(neovim): set up dap for rust & .NET
This commit is contained in:
parent
2cfdfb07bc
commit
08afb639f6
2 changed files with 45 additions and 4 deletions
home/editors/neovim/dap
|
@ -2,6 +2,12 @@ local dap = require("dap")
|
|||
|
||||
local function pwd() return io.popen("pwd"):lines()() end
|
||||
|
||||
dap.adapters.cppdbg = {
|
||||
id = "cppdbg",
|
||||
type = "executable",
|
||||
command = os.getenv("HOME") .. "/.vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7",
|
||||
}
|
||||
|
||||
dap.adapters.netcoredbg = {
|
||||
type = "executable",
|
||||
command = "netcoredbg",
|
||||
|
@ -12,14 +18,40 @@ dap.adapters.netcoredbg = {
|
|||
},
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "cppdbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = true,
|
||||
},
|
||||
{
|
||||
name = "Attach to gdbserver :1234",
|
||||
type = "cppdbg",
|
||||
request = "launch",
|
||||
MIMode = "gdb",
|
||||
miDebuggerServerAddress = "localhost:1234",
|
||||
miDebuggerPath = "/usr/bin/gdb",
|
||||
cwd = "${workspaceFolder}",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
},
|
||||
}
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
|
||||
dap.configurations.cs = {
|
||||
{
|
||||
type = "netcoredbg",
|
||||
name = "launch - netcoredbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
local dll = io.popen("find bin/Debug/ -maxdepth 2 -name \"*.dll\"")
|
||||
return pwd() .. "/" .. dll:lines()()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
stopAtEntry = true,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue