feat(rust): add hints and navic for rustaceanvim

This commit is contained in:
doryan 2024-12-23 01:01:10 +04:00
parent 3b1a2e37ca
commit ce5ddb9b89

View File

@ -1,18 +1,37 @@
local navic = require("nvim-navic")
vim.g.rustaceanvim = {
tools = {
autoSetHints = true,
inlay_hints = {
show_parameter_hints = true,
parameter_hints_prefix = "in: ", -- "<- "
other_hints_prefix = "out: " -- "=> "
}
},
server = {
on_attach = function(client, bufnr)
navic.attach(client, bufnr)
navic.attach(client, bufnr)
end,
filetypes = {"rust"},
settings = {
-- rust-analyzer language server configuration
['rust-analyzer'] = {
cargo = {
allFeatures = true,
assist = {
importEnforceGranularity = true,
importPrefix = "create"
},
},
},
},
cargo = { allFeatures = true },
checkOnSave = {
-- default: `cargo check`
command = "clippy",
allFeatures = true
},
inlayHints = {
lifetimeElisionHints = {
enable = true,
useParameterNames = true
}
}
}
}
}
}