feat(neovim): set up dap for rust & .NET
This commit is contained in:
parent
2cfdfb07bc
commit
08afb639f6
|
@ -1,9 +1,18 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
let vscodeExtensions = with pkgs; [ vscode-extensions.ms-vscode.cpptools ];
|
||||||
|
in {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
netcoredbg
|
netcoredbg
|
||||||
# vscode-firefox-debug # TODO not packaged
|
# vscode-firefox-debug # TODO not packaged
|
||||||
haskellPackages.haskell-dap
|
haskellPackages.haskell-dap
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.file = builtins.listToAttrs (map (x: {
|
||||||
|
name = ".vscode/extensions/${x.vscodeExtUniqueId}";
|
||||||
|
value = {
|
||||||
|
source = "${x}/share/vscode/extensions/${x.vscodeExtUniqueId}";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
}) vscodeExtensions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,12 @@ local dap = require("dap")
|
||||||
|
|
||||||
local function pwd() return io.popen("pwd"):lines()() end
|
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 = {
|
dap.adapters.netcoredbg = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "netcoredbg",
|
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 = {
|
dap.configurations.cs = {
|
||||||
{
|
{
|
||||||
type = "netcoredbg",
|
type = "netcoredbg",
|
||||||
name = "launch - netcoredbg",
|
name = "launch - netcoredbg",
|
||||||
request = "launch",
|
request = "launch",
|
||||||
program = function()
|
program = function()
|
||||||
local dll = io.popen("find bin/Debug/ -maxdepth 2 -name \"*.dll\"")
|
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||||
return pwd() .. "/" .. dll:lines()()
|
|
||||||
end,
|
end,
|
||||||
stopAtEntry = true,
|
stopAtEntry = true,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue