Improved debugging

This commit is contained in:
Fred Drake
2024-10-02 17:25:25 -04:00
parent 1b8b135353
commit 10acaf2001
3 changed files with 37 additions and 26 deletions
+11 -8
View File
@@ -1,9 +1,12 @@
{ { pkgs, ... }: {
plugins.dap = { extraConfigLua = ''
enable = true; local dap = require('dap')
extensions = {
dap-ui.enable = true; dap.adapters.coreclr = {
dap-virtual-text.enable = true; type = 'executable',
}; command = '${pkgs.netcoredbg}/bin/netcoredbg',
}; args = {'--interpreter=vscode'}
}
'';
} }
+14 -4
View File
@@ -1,4 +1,4 @@
{ { pkgs, ... }: {
plugins = { plugins = {
cmp-dap.enable = true; cmp-dap.enable = true;
dap = { dap = {
@@ -12,15 +12,15 @@
}; };
signs = { signs = {
dapBreakpoint = { dapBreakpoint = {
text = ""; text = "";
texthl = "DapBreakpoint"; texthl = "DapBreakpoint";
}; };
dapBreakpointCondition = { dapBreakpointCondition = {
text = ""; text = "";
texthl = "DapBreakpointCondition"; texthl = "DapBreakpointCondition";
}; };
dapLogPoint = { dapLogPoint = {
text = ""; text = "";
texthl = "DapLogPoint"; texthl = "DapLogPoint";
}; };
}; };
@@ -200,11 +200,21 @@
desc = "Eval"; desc = "Eval";
}; };
} }
{
mode = "n";
key = "<leader>df";
action =
"<CMD>lua require('dap.ext.vscode').load_launchjs()<CR><CMD>Telescope dap configurations<CR>";
options = { desc = "Debug Configurations"; };
}
]; ];
# Allow DAP UI to automatically open and close when possible
extraConfigLua = '' extraConfigLua = ''
require('dap').listeners.after.event_initialized['dapui_config'] = require('dapui').open require('dap').listeners.after.event_initialized['dapui_config'] = require('dapui').open
require('dap').listeners.before.event_terminated['dapui_config'] = require('dapui').close require('dap').listeners.before.event_terminated['dapui_config'] = require('dapui').close
require('dap').listeners.before.event_exited['dapui_config'] = require('dapui').close require('dap').listeners.before.event_exited['dapui_config'] = require('dapui').close
''; '';
extraPlugins = [ (pkgs.vimPlugins.telescope-dap-nvim) ];
} }
+12 -14
View File
@@ -125,6 +125,18 @@
"<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>"; "<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
options = { desc = "Goto T[y]pe Definition"; }; options = { desc = "Goto T[y]pe Definition"; };
} }
{
mode = "n";
key = "D";
action = "<CMD>lua vim.diagnostic.open_float()<CR>";
options = { desc = "Popup Diagnostics"; };
}
{
mode = "n";
key = "<leader>cd";
action = "<CMD>Trouble diagnostics toggle<CR>";
options = { desc = "List All Diagnostics"; };
}
# SOPS # SOPS
{ {
@@ -293,19 +305,5 @@
action = "<CMD>BufferLineCloseLeft<CR>"; action = "<CMD>BufferLineCloseLeft<CR>";
options = { desc = "Delete Buffers to the Left"; }; options = { desc = "Delete Buffers to the Left"; };
} }
# Code Actions
{
mode = "n";
key = "H";
action = "<CMD>lua vim.diagnostic.open_float()<CR>";
options = { desc = "Popup Diagnostics"; };
}
{
mode = "n";
key = "<leader>cd";
action = "<CMD>Trouble diagnostics toggle<CR>";
options = { desc = "List All Diagnostics"; };
}
]; ];
} }