Rust Dap Support
This commit is contained in:
parent
6faf4c0412
commit
bf0a84787d
13
lua/lsp.lua
13
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()
|
||||
|
28
lua/maps.lua
28
lua/maps.lua
@ -59,14 +59,6 @@ map("n", "<Leader>tt", ":Telescope treesitter<CR>")
|
||||
map("n", "<leader>tc", ":Telescope neoclip default<CR>")
|
||||
|
||||
|
||||
-- Dashboard
|
||||
map("n", "<Leader>db", ":Dashboard<CR>")
|
||||
map("n", "<Leader>fn", ":DashboardNewFile<CR>")
|
||||
map("n", "<Leader>bm", ":DashboardJumpMarks<CR>")
|
||||
map("n", "<C-s>l", ":SessionLoad<CR>")
|
||||
map("n", "<C-s>s", ":SessionSave<CR>")
|
||||
|
||||
|
||||
-- Lsp
|
||||
local lsp_opts = { noremap=true, silent=true }
|
||||
map("n", "<leader>lD", ":lua vim.lsp.buf.declaration()<CR>", lsp_opts)
|
||||
@ -88,16 +80,16 @@ map("n", "<leader>lq", ":Telescope diagnostics bufnr=0<CR>", lsp_opts)
|
||||
|
||||
-- Dap
|
||||
map("n", "<F5>", ":lua require(\"dap\").continue()<CR>")
|
||||
map("n", "<leader>te", ":lua require(\"dap\").terminate()<CR>")
|
||||
map("n", "<leader>br", ":lua require(\"dap\").toggle_breakpoint()<CR>")
|
||||
map("n", "<leader>Br", ":lua require(\"dap\").set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
|
||||
map("n", "<leader>lp", ":lua require(\"dap\").set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>")
|
||||
map("n", "<F10>", ":lua require(\"dap\").step_over()<CR>")
|
||||
map("n", "<F11>", ":lua require(\"dap\").step_into()<CR>")
|
||||
map("n", "<F12>", ":lua require(\"dap\").step_out()<CR>")
|
||||
map("n", "<leader>sb", ":lua require(\"dap\").step_back()<CR>")
|
||||
map("n", "<leader>rc", ":lua require(\"dap\").run_to_cursor()<CR>")
|
||||
map("n", "<leader>ro", ":lua require(\"dap\").repl.open()<CR>")
|
||||
map("n", "<leader>de", ":lua require(\"dap\").terminate()<CR>")
|
||||
map("n", "<leader>db", ":lua require(\"dap\").toggle_breakpoint()<CR>")
|
||||
map("n", "<leader>dr", ":lua require(\"dap\").set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
|
||||
map("n", "<leader>dp", ":lua require(\"dap\").set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>")
|
||||
map("n", "<F5>", ":lua require(\"dap\").step_over()<CR>")
|
||||
map("n", "<F6>", ":lua require(\"dap\").step_into()<CR>")
|
||||
map("n", "<F7>", ":lua require(\"dap\").step_out()<CR>")
|
||||
map("n", "<leader>dB", ":lua require(\"dap\").step_back()<CR>")
|
||||
map("n", "<leader>dc", ":lua require(\"dap\").run_to_cursor()<CR>")
|
||||
map("n", "<leader>do", ":lua require(\"dap\").repl.open()<CR>")
|
||||
map("n", "<leader>dt", ":lua require(\"dapui\").toggle()<CR>")
|
||||
map("n", "<leader>dl", ":lua require(\"dap\").run_last()<CR>")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user