rust-tools configures
This commit is contained in:
parent
6a32af7c15
commit
e5d101c0b1
|
|
@ -116,11 +116,18 @@ lspconfig.sumneko_lua.setup {
|
|||
},
|
||||
}
|
||||
|
||||
lspconfig.rust_analyzer.setup {
|
||||
on_attach = M.on_attach,
|
||||
capabilities = M.capabilities,
|
||||
|
||||
settings = {},
|
||||
}
|
||||
-- lspconfig.rust_analyzer.setup {
|
||||
-- on_attach = M.on_attach,
|
||||
-- capabilities = M.capabilities,
|
||||
--
|
||||
-- settings = {
|
||||
-- tools = {
|
||||
-- inlay_hints = {
|
||||
-- auto = true,
|
||||
-- show_parameter_hints = true,
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
-- }
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -3,76 +3,27 @@ if not present then
|
|||
return
|
||||
end
|
||||
|
||||
local options = {
|
||||
tools = {
|
||||
on_initialized = nil,
|
||||
reload_workspace_from_cargo_toml = true,
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||
|
||||
-- inlay hints
|
||||
inlay_hints = {
|
||||
auto = true,
|
||||
only_current_line = false,
|
||||
show_parameter_hints = true,
|
||||
parameter_hints_prefix = "<- ",
|
||||
max_len_align = false,
|
||||
},
|
||||
enabled_graphviz_backends = {
|
||||
"bmp",
|
||||
"cgimage",
|
||||
"canon",
|
||||
"dot",
|
||||
"gv",
|
||||
"xdot",
|
||||
"xdot1.2",
|
||||
"xdot1.4",
|
||||
"eps",
|
||||
"exr",
|
||||
"fig",
|
||||
"gd",
|
||||
"gd2",
|
||||
"gif",
|
||||
"gtk",
|
||||
"ico",
|
||||
"cmap",
|
||||
"ismap",
|
||||
"imap",
|
||||
"cmapx",
|
||||
"imap_np",
|
||||
"cmapx_np",
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"jpe",
|
||||
"jp2",
|
||||
"json",
|
||||
"json0",
|
||||
"dot_json",
|
||||
"xdot_json",
|
||||
"pdf",
|
||||
"pic",
|
||||
"pct",
|
||||
"pict",
|
||||
"plain",
|
||||
"plain-ext",
|
||||
"png",
|
||||
"pov",
|
||||
"ps",
|
||||
"ps2",
|
||||
"psd",
|
||||
"sgi",
|
||||
"svg",
|
||||
"svgz",
|
||||
"tga",
|
||||
"tiff",
|
||||
"tif",
|
||||
"tk",
|
||||
"vml",
|
||||
"vmlz",
|
||||
"wbmp",
|
||||
"webp",
|
||||
"xlib",
|
||||
"x11",
|
||||
},
|
||||
|
||||
local options = {
|
||||
tools = {
|
||||
inlay_hints = {
|
||||
auto = true,
|
||||
only_current_line = false,
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = true,
|
||||
},
|
||||
on_initialized = function()
|
||||
-- ih.set_all()
|
||||
end,
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
rust.setup(options)
|
||||
|
|
|
|||
|
|
@ -63,11 +63,12 @@ local plugins = {
|
|||
},
|
||||
|
||||
["simrat39/rust-tools.nvim"] = {
|
||||
ft = "rs",
|
||||
config = function ()
|
||||
require("plugins.configs.rust-tools")
|
||||
end,
|
||||
},
|
||||
after = "nvim-lspconfig",
|
||||
config = function ()
|
||||
require("plugins.configs.rust-tools")
|
||||
require("core.utils").load_mappings "lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
-- load luasnips + cmp related in insert mode only
|
||||
|
||||
|
|
|
|||
Reference in New Issue