rust-tools: codelenses
This commit is contained in:
parent
cb88a78114
commit
12af7eea21
|
|
@ -9,6 +9,9 @@ capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
|||
|
||||
local options = {
|
||||
tools = {
|
||||
executor = require("rust-tools/executors").termopen,
|
||||
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
|
||||
reload_workspace_from_cargo_toml = true,
|
||||
inlay_hints = {
|
||||
auto = true,
|
||||
only_current_line = false,
|
||||
|
|
@ -16,9 +19,25 @@ local options = {
|
|||
},
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
border = "rounded",
|
||||
},
|
||||
on_initialized = function()
|
||||
-- ih.set_all()
|
||||
vim.api.nvim_create_autocmd({
|
||||
"BufEnter",
|
||||
"BufReadPre",
|
||||
"BufReadPost",
|
||||
"BufWritePost",
|
||||
"CursorHold",
|
||||
"InsertLeave",
|
||||
"InsertEnter",
|
||||
"BufAdd",
|
||||
}, {
|
||||
pattern = { "*.rs" },
|
||||
callback = function()
|
||||
local _, _ = pcall(vim.lsp.codelens.refresh)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
server = {
|
||||
|
|
@ -30,6 +49,10 @@ local options = {
|
|||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
-- command = "check",
|
||||
lens = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
command = "clippy",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue