diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index eaa6582..c9d24ed 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -106,8 +106,9 @@ return { -- Rust dap.adapters.lldb = { type = "executable", - command = "/usr/bin/lldb", -- Adjust the path to your codelldb executable + command = "codelldb", name = "lldb", + -- args = { "--log", "--log-file=/tmp/codelldb.log" }, } dap.configurations.rust = { @@ -125,6 +126,27 @@ return { -- Additional LLDB-specific settings runInTerminal = false, }, + { + name = "Debug Test", + type = "lldb", + request = "launch", + program = function() + -- Prompt the user for the test binary + return vim.fn.input("Path to test binary: ", vim.fn.getcwd() .. "/target/debug/deps/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = function() + -- Prompt the user for the specific test function to run + local test_name = vim.fn.input("Test name (leave empty to run all tests): ") + if test_name ~= "" then + return { "--exact", test_name } + else + return {} + end + end, + runInTerminal = false, + }, } -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.