rust-analyzer

This commit is contained in:
tristan 2024-01-07 17:09:21 +00:00
parent 02fd943224
commit 6198f8c63a
2 changed files with 13 additions and 6 deletions

View file

@ -10,6 +10,7 @@
vscode-langservers-extracted
gopls
nil
rust-analyzer
];
plugins = with pkgs.vimPlugins; [
vim-surround

View file

@ -1,20 +1,26 @@
-- Setup language servers.
local lspconfig = require('lspconfig')
lspconfig.tsserver.setup {
on_attach = function(client)
local on_attach = function(client)
require'completion'.on_attach(client)
client.server_capabilities.documentFormattingProvider = false
end
lspconfig.tsserver.setup {
on_attach = on_attach
}
lspconfig.eslint.setup {
on_attach = function(client)
client.server_capabilities.documentFormattingProvider = true
end
on_attach = on_attach
}
lspconfig.rust_analyzer.setup {
on_attach = on_attach
}
lspconfig.gopls.setup {}
lspconfig.nil_ls.setup {}
lspconfig.rust_analyzer.setup {}
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer