From b2f02b5c1385e43ac49e5311b7c28337804d9068 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Mon, 3 Apr 2023 12:40:26 +0200 Subject: [PATCH] add dap for rust --- lua/plugins/dap.lua | 17 +++++++++++++++++ lua/plugins/lsp.lua | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 lua/plugins/dap.lua diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..84e9e12 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,17 @@ +return { + { + 'mfussenegger/nvim-dap', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + { + 'rcarriga/nvim-dap-ui', + config = function() + require("dapui").setup() + end, + dependencies = { 'mfussenegger/nvim-dap' } + }, + { + 'theHamsta/nvim-dap-virtual-text', + config = true + } +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index c4f6bf6..95c8b90 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -20,6 +20,14 @@ local lsp_attach = function(client, buf) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) end +local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/packages/codelldb/extension/") +local codelldb_path = mason_path .. "adapter/codelldb" +local liblldb_path = mason_path .. "lldb/lib/liblldb.so" + +if vim.fn.has "mac" == 1 then + liblldb_path = mason_path .. "lldb/lib/liblldb.dylib" +end + return { -- lsp { @@ -52,6 +60,7 @@ return { workspace = { -- Make the server aware of Neovim runtime files library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, }, } }, @@ -74,6 +83,10 @@ return { capabilities = capabilities, on_attach = lsp_attach, standalone = false + }, + dap = { + adapter = require('rust-tools.dap').get_codelldb_adapter( + codelldb_path, liblldb_path) } }) lspconfig.bashls.setup { @@ -96,6 +109,10 @@ return { capabilities = capabilities, on_attach = lsp_attach }) + lspconfig.phpactor.setup({ + capabilities = capabilities, + on_attach = lsp_attach + }) capabilities.textDocument.completion.completionItem.snippetSupport = true lspconfig.emmet_ls.setup({ capabilities = capabilities,