131 lines
2.7 KiB
Nix
131 lines
2.7 KiB
Nix
{pkgs, ...}: {
|
|
plugins.dap = {
|
|
enable = true;
|
|
extensions = {
|
|
dap-ui.enable = true;
|
|
dap-go.enable = true;
|
|
dap-python.enable = true;
|
|
dap-virtual-text.enable = true;
|
|
};
|
|
adapters = {
|
|
executables = {
|
|
lldb = {
|
|
command = "${pkgs.llvmPackages.lldb}/bin/lldb-vscode";
|
|
};
|
|
};
|
|
servers.codelldb = rec {
|
|
port = 13000;
|
|
executable = {
|
|
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
|
|
args = ["--port" (builtins.toString port)];
|
|
};
|
|
};
|
|
};
|
|
configurations = rec {
|
|
c = cpp;
|
|
rust = cpp;
|
|
cpp = [
|
|
{
|
|
name = "Launch";
|
|
request = "launch";
|
|
type = "codelldb";
|
|
cwd = "\${workspaceFolder}";
|
|
stopOnEntry = false;
|
|
runInTerminal = false;
|
|
program = {
|
|
__raw = ''
|
|
get_program
|
|
'';
|
|
};
|
|
}
|
|
{
|
|
name = "Launch with Arguments";
|
|
request = "launch";
|
|
type = "codelldb";
|
|
cwd = "\${workspaceFolder}";
|
|
stopOnEntry = false;
|
|
runInTerminal = false;
|
|
program = {
|
|
__raw = ''
|
|
get_program
|
|
'';
|
|
};
|
|
args = {
|
|
__raw = ''
|
|
function()
|
|
local arguments_string = vim.fn.input('Executable arguments: ')
|
|
return vim.split(arguments_string, " +")
|
|
end
|
|
'';
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
keymaps = [
|
|
{
|
|
action = ":DapToggleBreakpoint<CR>";
|
|
key = "<leader>db";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapUiToggle<CR>";
|
|
key = "<leader>du";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapContinue<CR>";
|
|
key = "<leader>dc";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapRerun<CR>";
|
|
key = "<leader>dC";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapStepOver<CR>";
|
|
key = "<leader>do";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapStepIn<CR>";
|
|
key = "<leader>di";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapStepOut<CR>";
|
|
key = "<leader>dO";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapTerminate<CR>";
|
|
key = "<leader>dT";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
action = ":DapToggleRepl<CR>";
|
|
key = "<leader>dr";
|
|
options = {
|
|
silent = true;
|
|
};
|
|
}
|
|
];
|
|
}
|