mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Setup LSP for Rust
Signed-off-by: Li Peng <lipeng@unisound.ai>
This commit is contained in:
parent
c7fb090e4c
commit
efcda5cf6f
@ -278,6 +278,32 @@ if utils.executable("lua-language-server") then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- settings for rust-analyzer is copied from https://rust-analyzer.github.io/manual.html#nvim-lsp
|
||||||
|
if utils.executable("rust-analyzer") then
|
||||||
|
lspconfig.rust_analyzer.setup {
|
||||||
|
on_attach = custom_attach,
|
||||||
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
imports = {
|
||||||
|
granularity = {
|
||||||
|
group = "module",
|
||||||
|
},
|
||||||
|
prefix = "self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
-- Change diagnostic signs.
|
-- Change diagnostic signs.
|
||||||
fn.sign_define("DiagnosticSignError", { text = "🆇", texthl = "DiagnosticSignError" })
|
fn.sign_define("DiagnosticSignError", { text = "🆇", texthl = "DiagnosticSignError" })
|
||||||
fn.sign_define("DiagnosticSignWarn", { text = "⚠️", texthl = "DiagnosticSignWarn" })
|
fn.sign_define("DiagnosticSignWarn", { text = "⚠️", texthl = "DiagnosticSignWarn" })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user