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