From 100e474392176988e334102d8860e3322a077949 Mon Sep 17 00:00:00 2001 From: Tibor Novakovic Date: Tue, 3 Dec 2024 09:33:46 +0100 Subject: [PATCH] feat: Add DapClearBreakpoints user command, and a section on user commands in dap.txt. --- doc/dap.txt | 22 ++++++++++++++++++++++ plugin/dap.lua | 1 + 2 files changed, 23 insertions(+) diff --git a/doc/dap.txt b/doc/dap.txt index 83a1e993..9b14cbc8 100644 --- a/doc/dap.txt +++ b/doc/dap.txt @@ -546,6 +546,28 @@ Some example mappings you could configure: end) < +============================================================================== +USER COMMANDS *dap-user-commands* + + +nvim-dap provides the following commands to the user: + +- `DapSetLogLevel` : Set the log level, +- `DapShowLog` : Show the session log in a split window, +- `DapContinue` : Continue executing a paused session or start a new one, +- `DapToggleBreakpoint` : Set or remove a breakpoint at the current line, +- `DapClearBreakpoints` : Clear all set breakpoints, +- `DapToggleRepl` : Open or close a REPL, +- `DapStepOver` : Step over the current line, +- `DapStepInto` : Step into the current expression, +- `DapStepOut` : Step out of the current scope, +- `DapTerminate` : Close the current sesion, +- `DapDisconnect` : Disconnect from an active debugging session, +- `DapLoadLaunchJSON` : Extend `dap.configurations` with entries read from `.vscode/launch.json`, +- `DapRestartFrame` : Restart the active sessions' current frame, +- `DapNew` : Start one or more new debug sessions, +- `DapEval` : Create a new window & buffer to evaluate expressions. + ============================================================================== CLIENT CONFIGURATION *dap.defaults* diff --git a/plugin/dap.lua b/plugin/dap.lua index 15b40d1a..2ee108a6 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 })