From bf0a84787d7db373a3af4600a262a44e7f44c766 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 25 Dec 2021 05:40:23 -0600 Subject: [PATCH] Rust Dap Support --- lua/lsp.lua | 13 +++++++++++++ lua/maps.lua | 28 ++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lua/lsp.lua b/lua/lsp.lua index f4dfe5a..44d2d31 100755 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -10,7 +10,20 @@ lsp_installer.on_server_ready(function(server) -- -- NOTE: Requires rust_analyzer if server.name == "rust_analyzer" then + + + -- Dap installation, required vscode and the following extension to be installed: + -- https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb + -- + -- locate it with `find ~/ -name ` + -- local extension_path = os.getenv("HOME") .. ".vscode/extensions/vadimcn.vscode-lldb-1.6.10/" + -- local codelldb_path = extension_path .. 'adapter/codelldb' + -- local liblldb_path = extension_path .. 'lldb/lib/' + -- opts.dap = { + -- adapter = require('rust-tools.dap').get_codelldb_adapter(codelldb_path, liblldb_path) + -- } require("rust-tools").setup{ + server = vim.tbl_deep_extend("force", server:get_default_options(), opts), } server:attach_buffers() diff --git a/lua/maps.lua b/lua/maps.lua index 0932900..66100f5 100755 --- a/lua/maps.lua +++ b/lua/maps.lua @@ -59,14 +59,6 @@ map("n", "tt", ":Telescope treesitter") map("n", "tc", ":Telescope neoclip default") --- Dashboard -map("n", "db", ":Dashboard") -map("n", "fn", ":DashboardNewFile") -map("n", "bm", ":DashboardJumpMarks") -map("n", "l", ":SessionLoad") -map("n", "s", ":SessionSave") - - -- Lsp local lsp_opts = { noremap=true, silent=true } map("n", "lD", ":lua vim.lsp.buf.declaration()", lsp_opts) @@ -88,16 +80,16 @@ map("n", "lq", ":Telescope diagnostics bufnr=0", lsp_opts) -- Dap map("n", "", ":lua require(\"dap\").continue()") -map("n", "te", ":lua require(\"dap\").terminate()") -map("n", "br", ":lua require(\"dap\").toggle_breakpoint()") -map("n", "Br", ":lua require(\"dap\").set_breakpoint(vim.fn.input('Breakpoint condition: '))") -map("n", "lp", ":lua require(\"dap\").set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") -map("n", "", ":lua require(\"dap\").step_over()") -map("n", "", ":lua require(\"dap\").step_into()") -map("n", "", ":lua require(\"dap\").step_out()") -map("n", "sb", ":lua require(\"dap\").step_back()") -map("n", "rc", ":lua require(\"dap\").run_to_cursor()") -map("n", "ro", ":lua require(\"dap\").repl.open()") +map("n", "de", ":lua require(\"dap\").terminate()") +map("n", "db", ":lua require(\"dap\").toggle_breakpoint()") +map("n", "dr", ":lua require(\"dap\").set_breakpoint(vim.fn.input('Breakpoint condition: '))") +map("n", "dp", ":lua require(\"dap\").set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") +map("n", "", ":lua require(\"dap\").step_over()") +map("n", "", ":lua require(\"dap\").step_into()") +map("n", "", ":lua require(\"dap\").step_out()") +map("n", "dB", ":lua require(\"dap\").step_back()") +map("n", "dc", ":lua require(\"dap\").run_to_cursor()") +map("n", "do", ":lua require(\"dap\").repl.open()") map("n", "dt", ":lua require(\"dapui\").toggle()") map("n", "dl", ":lua require(\"dap\").run_last()")