2022-03-01 15:22:59 +01:00
|
|
|
lua << EOF
|
|
|
|
local lsp = require("lspconfig")
|
|
|
|
local utils = require("ambroisie.utils")
|
|
|
|
|
2022-03-04 17:36:01 +01:00
|
|
|
-- Inform servers we are able to do completion, snippets, etc...
|
|
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
|
|
|
|
2022-03-01 15:23:42 +01:00
|
|
|
-- C/C++
|
|
|
|
if utils.is_executable("clangd") then
|
|
|
|
lsp.clangd.setup({
|
2022-03-04 17:36:01 +01:00
|
|
|
capabilities = capabilities,
|
2022-03-01 15:23:42 +01:00
|
|
|
on_attach = utils.on_attach,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2022-03-04 14:20:29 +01:00
|
|
|
-- Nix
|
|
|
|
if utils.is_executable("rnix-lsp") then
|
|
|
|
lsp.rnix.setup({
|
2022-03-04 17:36:01 +01:00
|
|
|
capabilities = capabilities,
|
2022-03-04 14:20:29 +01:00
|
|
|
on_attach = utils.on_attach,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2022-03-01 15:22:59 +01:00
|
|
|
-- Python
|
|
|
|
if utils.is_executable("pyright") then
|
|
|
|
lsp.pyright.setup({
|
2022-03-04 17:36:01 +01:00
|
|
|
capabilities = capabilities,
|
2022-03-01 15:22:59 +01:00
|
|
|
on_attach = utils.on_attach,
|
|
|
|
})
|
|
|
|
end
|
2022-03-01 15:23:20 +01:00
|
|
|
|
|
|
|
-- Rust
|
|
|
|
if utils.is_executable("rust-analyzer") then
|
|
|
|
lsp.rust_analyzer.setup({
|
2022-03-04 17:36:01 +01:00
|
|
|
capabilities = capabilities,
|
2022-03-01 15:23:20 +01:00
|
|
|
on_attach = utils.on_attach,
|
|
|
|
})
|
|
|
|
end
|
2022-03-01 15:22:59 +01:00
|
|
|
EOF
|