2022-03-01 15:22:59 +01:00
|
|
|
lua << EOF
|
2022-03-08 20:18:02 +01:00
|
|
|
local lspconfig = require("lspconfig")
|
2022-03-01 15:22:59 +01:00
|
|
|
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
|
2022-03-08 20:18:02 +01:00
|
|
|
lspconfig.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
|
2022-03-08 20:18:02 +01:00
|
|
|
lspconfig.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
|
2022-03-08 20:18:02 +01:00
|
|
|
lspconfig.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
|
2022-03-08 20:18:02 +01:00
|
|
|
lspconfig.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
|