Skip to content

Commit

Permalink
Add a public function to start debugging the test above the cursor
Browse files Browse the repository at this point in the history
This allows access to the internal functionality for creating key binds specific to that debugging configuration.
  • Loading branch information
julianolf committed Jun 9, 2024
1 parent 6e38053 commit 8430181
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lua/dap-lldb.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---@mod dap-lldb LLDB extension for nvim-dap

---@brief [[
---An extension for nvim-dap to provide C, C++ and Rust debugging support.
---An extension for nvim-dap to provide C, C++, and Rust debugging support.
---@brief ]]

local M = {}
Expand Down Expand Up @@ -234,4 +234,16 @@ function M.setup(opts)
custom_configurations(dap, opts)
end

---Debug test function above the cursor
function M.debug_test()
if vim.bo.filetype ~= "rust" then
vim.notify("This feature is available only for Rust", vim.log.levels.ERROR)
return nil
end

local dap = require_dap()
local cfg = dap.configurations.rust[5]
dap.run(cfg)
end

return M

0 comments on commit 8430181

Please sign in to comment.