2022-03-01 15:22:59 +01:00
|
|
|
lua << EOF
|
2022-03-08 20:18:02 +01:00
|
|
|
local lspconfig = require("lspconfig")
|
2022-03-08 20:20:22 +01:00
|
|
|
local lsp = require("ambroisie.lsp")
|
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...
|
2022-11-03 17:59:34 +01:00
|
|
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
2022-03-04 17:36:01 +01:00
|
|
|
|
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-08 20:20:22 +01:00
|
|
|
on_attach = lsp.on_attach,
|
2022-03-01 15:23:42 +01:00
|
|
|
})
|
|
|
|
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-08 20:20:22 +01:00
|
|
|
on_attach = lsp.on_attach,
|
2022-03-04 14:20:29 +01:00
|
|
|
})
|
|
|
|
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-08 20:20:22 +01:00
|
|
|
on_attach = lsp.on_attach,
|
2022-03-01 15:22:59 +01:00
|
|
|
})
|
|
|
|
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-08 20:20:22 +01:00
|
|
|
on_attach = lsp.on_attach,
|
2022-03-01 15:23:20 +01:00
|
|
|
})
|
|
|
|
end
|
2022-03-01 15:22:59 +01:00
|
|
|
EOF
|