lsp: use installed rust-analyzer instead of Mason
This commit is contained in:
parent
432fabeed0
commit
e7334ea6e7
34
lua/lsp.lua
34
lua/lsp.lua
@ -77,7 +77,7 @@ local servers = {
|
||||
clangd = {},
|
||||
-- gopls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
-- rust_analyzer = {},
|
||||
tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
texlab = {},
|
||||
@ -116,3 +116,35 @@ mason_lspconfig.setup_handlers {
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
-- System LSPs
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
servers = {
|
||||
rust_analyzer = {
|
||||
["rust-analyzer"] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
for server_name, server_settings in pairs(servers) do
|
||||
lspconfig[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = server_settings,
|
||||
}
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user