Sanchayan Maity
9a26ef9c10
Use the new vim.lsp.start API and LspAttach/Detach auto commands. Drop nvim-lspconfig in the process. LSP server specific configuration has been taken from nvim-lspconfig.
19 lines
364 B
Lua
19 lines
364 B
Lua
local path = vim.fs.find({ "Cargo.toml" }, { type = "file" })
|
|
local root = vim.fs.dirname(path[1])
|
|
|
|
vim.lsp.start({
|
|
name = "rust-analyzer",
|
|
cmd = { "rust-analyzer" },
|
|
root_dir = root,
|
|
settings = {
|
|
["rust-analyzer"] = {
|
|
procMacro = {
|
|
enable = true
|
|
},
|
|
checkOnSave = {
|
|
command = "clippy"
|
|
},
|
|
},
|
|
},
|
|
})
|