add dap for rust
This commit is contained in:
parent
afcce108f7
commit
b2f02b5c13
17
lua/plugins/dap.lua
Normal file
17
lua/plugins/dap.lua
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
@ -20,6 +20,14 @@ local lsp_attach = function(client, buf)
|
|||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
end
|
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 {
|
return {
|
||||||
-- lsp
|
-- lsp
|
||||||
{
|
{
|
||||||
@ -52,6 +60,7 @@ return {
|
|||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
checkThirdParty = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -74,6 +83,10 @@ return {
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = lsp_attach,
|
on_attach = lsp_attach,
|
||||||
standalone = false
|
standalone = false
|
||||||
|
},
|
||||||
|
dap = {
|
||||||
|
adapter = require('rust-tools.dap').get_codelldb_adapter(
|
||||||
|
codelldb_path, liblldb_path)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
lspconfig.bashls.setup {
|
lspconfig.bashls.setup {
|
||||||
@ -96,6 +109,10 @@ return {
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = lsp_attach
|
on_attach = lsp_attach
|
||||||
})
|
})
|
||||||
|
lspconfig.phpactor.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
lspconfig.emmet_ls.setup({
|
lspconfig.emmet_ls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
Loading…
Reference in New Issue
Block a user