From 04ce47fc5a6ef2b717f33c320fc003091cebac40 Mon Sep 17 00:00:00 2001 From: Tibor Novakovic Date: Tue, 3 Dec 2024 09:33:46 +0100 Subject: [PATCH] Add DapClearBreakpoints user command and user command docs Co-authored-by: Mathias Fussenegger --- doc/dap.txt | 34 ++++++++++++++++++++++++++++++++++ plugin/dap.lua | 1 + 2 files changed, 35 insertions(+) diff --git a/doc/dap.txt b/doc/dap.txt index 5c290558..062fcb9a 100644 --- a/doc/dap.txt +++ b/doc/dap.txt @@ -546,6 +546,40 @@ Some example mappings you could configure: end) < +============================================================================== +USER COMMANDS *dap-user-commands* + +nvim-dap provides the following user commands. + +Session management: + +- `DapContinue`: Continue executing a paused session or start a new one +- `DapDisconnect`: Disconnect from an active debugging session +- `DapNew`: Start one or more new debug sessions +- `DapTerminate`: Terminate the current session + +Stepping: + +- `DapRestartFrame`: Restart the active sessions' current frame +- `DapStepInto`: Step into the current expression +- `DapStepOut`: Step out of the current scope +- `DapStepOver`: Step over the current line + +REPL: + +- `DapEval`: Create a new window & buffer to evaluate expressions +- `DapToggleRepl`: Open or close the REPL + +Breakpoints: + +- `DapClearBreakpoints` : Clear all breakpoints +- `DapToggleBreakpoint` : Set or remove a breakpoint at the current line + +Diagnostics: + +- `DapSetLogLevel` : Set the log level +- `DapShowLog` : Show the session log in a split window + ============================================================================== CLIENT CONFIGURATION *dap.defaults* diff --git a/plugin/dap.lua b/plugin/dap.lua index d4b08893..3c0ac22a 100644 --- a/plugin/dap.lua +++ b/plugin/dap.lua @@ -18,6 +18,7 @@ cmd('DapSetLogLevel', cmd('DapShowLog', 'split | e ' .. vim.fn.stdpath('cache') .. '/dap.log | normal! G', {}) cmd('DapContinue', function() require('dap').continue() end, { nargs = 0 }) cmd('DapToggleBreakpoint', function() require('dap').toggle_breakpoint() end, { nargs = 0 }) +cmd('DapClearBreakpoints', function() require('dap').clear_breakpoints() end, { nargs = 0 }) cmd('DapToggleRepl', function() require('dap.repl').toggle() end, { nargs = 0 }) cmd('DapStepOver', function() require('dap').step_over() end, { nargs = 0 }) cmd('DapStepInto', function() require('dap').step_into() end, { nargs = 0 })