rust-tools configures

This commit is contained in:
krolyxon 2022-09-07 13:08:37 +05:30
parent 6a32af7c15
commit e5d101c0b1
3 changed files with 38 additions and 79 deletions

View File

@ -116,11 +116,18 @@ lspconfig.sumneko_lua.setup {
}, },
} }
lspconfig.rust_analyzer.setup { -- lspconfig.rust_analyzer.setup {
on_attach = M.on_attach, -- on_attach = M.on_attach,
capabilities = M.capabilities, -- capabilities = M.capabilities,
--
settings = {}, -- settings = {
} -- tools = {
-- inlay_hints = {
-- auto = true,
-- show_parameter_hints = true,
-- },
-- },
-- }
-- }
return M return M

View File

@ -3,76 +3,27 @@ if not present then
return return
end end
local options = { local capabilities = vim.lsp.protocol.make_client_capabilities()
tools = { capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
on_initialized = nil,
reload_workspace_from_cargo_toml = true,
-- inlay hints
inlay_hints = { local options = {
auto = true, tools = {
only_current_line = false, inlay_hints = {
show_parameter_hints = true, auto = true,
parameter_hints_prefix = "<- ", only_current_line = false,
max_len_align = false, -- whether to show parameter hints with the inlay hints or not
}, -- default: true
enabled_graphviz_backends = { show_parameter_hints = true,
"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",
},
}, },
on_initialized = function()
-- ih.set_all()
end,
},
server = {
on_attach = function(client, bufnr)
end,
},
} }
rust.setup(options) rust.setup(options)

View File

@ -63,11 +63,12 @@ local plugins = {
}, },
["simrat39/rust-tools.nvim"] = { ["simrat39/rust-tools.nvim"] = {
ft = "rs", after = "nvim-lspconfig",
config = function () config = function ()
require("plugins.configs.rust-tools") require("plugins.configs.rust-tools")
end, require("core.utils").load_mappings "lspconfig"
}, end,
},
-- load luasnips + cmp related in insert mode only -- load luasnips + cmp related in insert mode only