feat: switch to rust-tools for rust lsp

This commit is contained in:
Matej Janezic 2023-04-05 22:32:05 +02:00
parent 9fa4cae11b
commit bb0b4f7429
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
1 changed files with 34 additions and 7 deletions

View File

@ -68,6 +68,9 @@ return {
}, },
}, },
-- adds extra functionality over rust_analyzer
'simrat39/rust-tools.nvim',
-- Useful status updates for LSP -- Useful status updates for LSP
{ 'j-hui/fidget.nvim', opts = {} }, { 'j-hui/fidget.nvim', opts = {} },
@ -81,13 +84,6 @@ return {
marksman = {}, marksman = {},
pyright = {}, pyright = {},
tsserver = {}, tsserver = {},
rust_analyzer = {
['rust-analyzer'] = {
cargo = {
features = 'all',
},
},
},
lua_ls = { lua_ls = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, workspace = { checkThirdParty = false },
@ -122,6 +118,37 @@ return {
} }
end, end,
} }
local rust_tools_opts = {
tools = {
runnables = {
use_telescope = true,
},
inlay_hints = {
auto = true,
show_parameter_hints = false,
parameter_hints_prefix = '',
other_hints_prefix = '',
},
},
server = {
on_attach = on_attach,
settings = {
['rust-analyzer'] = {
cargo = {
-- always enable all features
features = 'all',
},
-- use clippy on save
checkOnSave = {
command = 'clippy',
},
},
},
},
}
require('rust-tools').setup(rust_tools_opts)
end, end,
}, },