2023-11-07 00:50:27 +00:00
|
|
|
{lib, ...}: let
|
2024-02-26 05:05:23 +00:00
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
|
|
|
inherit (lib.types) bool attrsOf str;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2024-11-04 15:50:50 +00:00
|
|
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
2023-11-07 00:50:27 +00:00
|
|
|
in {
|
2023-05-04 15:41:11 +00:00
|
|
|
options.vim.debugger.nvim-dap = {
|
2023-10-21 17:15:36 +00:00
|
|
|
enable = mkEnableOption "debugging via nvim-dap";
|
2023-05-04 15:41:11 +00:00
|
|
|
|
|
|
|
ui = {
|
2023-10-21 17:15:36 +00:00
|
|
|
enable = mkEnableOption "UI extension for nvim-dap";
|
2024-11-04 15:50:50 +00:00
|
|
|
|
|
|
|
setupOpts = mkPluginSetupOption "nvim-dap-ui" {};
|
|
|
|
|
2023-05-05 13:31:55 +00:00
|
|
|
autoStart = mkOption {
|
2024-02-26 05:05:23 +00:00
|
|
|
type = bool;
|
2023-05-05 13:31:55 +00:00
|
|
|
default = true;
|
|
|
|
description = "Automatically Opens and Closes DAP-UI upon starting/closing a debugging session";
|
|
|
|
};
|
2023-05-04 15:41:11 +00:00
|
|
|
};
|
2023-05-08 11:01:42 +00:00
|
|
|
|
|
|
|
sources = mkOption {
|
|
|
|
default = {};
|
|
|
|
description = "List of debuggers to install";
|
2024-02-26 05:05:23 +00:00
|
|
|
type = attrsOf str;
|
2023-05-08 11:01:42 +00:00
|
|
|
};
|
2023-06-12 00:59:34 +00:00
|
|
|
|
|
|
|
mappings = {
|
2024-11-26 07:36:39 +00:00
|
|
|
continue = mkMappingOption "Continue" "<leader>dc";
|
2023-06-12 00:59:34 +00:00
|
|
|
restart = mkMappingOption "Restart" "<leader>dR";
|
|
|
|
terminate = mkMappingOption "Terminate" "<leader>dq";
|
|
|
|
runLast = mkMappingOption "Re-run Last Debug Session" "<leader>d.";
|
|
|
|
|
|
|
|
toggleRepl = mkMappingOption "Toggle Repl" "<leader>dr";
|
|
|
|
hover = mkMappingOption "Hover" "<leader>dh";
|
|
|
|
toggleBreakpoint = mkMappingOption "Toggle breakpoint" "<leader>db";
|
|
|
|
|
|
|
|
runToCursor = mkMappingOption "Continue to the current cursor" "<leader>dgc";
|
|
|
|
stepInto = mkMappingOption "Step into function" "<leader>dgi";
|
|
|
|
stepOut = mkMappingOption "Step out of function" "<leader>dgo";
|
|
|
|
stepOver = mkMappingOption "Next step" "<leader>dgj";
|
|
|
|
stepBack = mkMappingOption "Step back" "<leader>dgk";
|
|
|
|
|
|
|
|
goUp = mkMappingOption "Go up stacktrace" "<leader>dvo";
|
|
|
|
goDown = mkMappingOption "Go down stacktrace" "<leader>dvi";
|
|
|
|
|
|
|
|
toggleDapUI = mkMappingOption "Toggle DAP-UI" "<leader>du";
|
|
|
|
};
|
2023-05-04 15:41:11 +00:00
|
|
|
};
|
|
|
|
}
|