dotfiles/nvim/.config/nvim/after/ftplugin/rust.lua
Sanchayan Maity 9a26ef9c10 nvim: Drop nvim-lspconfig
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.
2022-08-31 12:21:28 +05:30

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"
},
},
},
})