refactor(nvim): support new breaking changes in rust-tools
This commit is contained in:
parent
2ca5818105
commit
b657d1b6af
@ -1,35 +1,30 @@
|
||||
vim.keymap.set('n', '<leader>fr', ':RustRunnables<CR>', {
|
||||
vim.keymap.set("n", "<leader>fr", ":RustRunnables<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fd', ':RustDebuggables<CR>', {
|
||||
vim.keymap.set("n", "<leader>fd", ":RustDebuggables<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fp', ':RustParentModule<CR>', {
|
||||
vim.keymap.set("n", "<leader>fp", ":RustParentModule<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fJ', ':RustJoinLines<CR>', {
|
||||
vim.keymap.set("n", "<leader>fJ", ":RustJoinLines<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fh', ':RustHoverActions<CR>', {
|
||||
vim.keymap.set("n", "<leader>fh", ":RustHoverActions<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fH', ':RustHoverRange<CR>', {
|
||||
vim.keymap.set("n", "<leader>fH", ":RustHoverRange<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fi', ':RustToggleInlayHints<CR>', {
|
||||
vim.keymap.set("n", "<leader>fm", ":RustExpandMacro<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fm', ':RustExpandMacro<CR>', {
|
||||
vim.keymap.set("n", "<leader>fc", ":RustOpenCargo<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fc', ':RustOpenCargo<CR>', {
|
||||
vim.keymap.set("n", "<leader>fk", ":RustMoveItemUp<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fk', ':RustMoveItemUp<CR>', {
|
||||
vim.keymap.set("n", "<leader>fj", ":RustMoveItemDown<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set('n', '<leader>fj', ':RustMoveItemDown<CR>', {
|
||||
buffer = true,
|
||||
})
|
||||
|
||||
vim.opt.foldmethod = 'syntax'
|
||||
|
@ -41,13 +41,60 @@ local liblldb_path = extension_path .. "lldb/lib/liblldb.dylib"
|
||||
local rustopts = {
|
||||
server = opts,
|
||||
dap = {
|
||||
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
|
||||
adapter = {
|
||||
type = "executable",
|
||||
command = "lldb-vscode",
|
||||
name = "rt_lldb",
|
||||
},
|
||||
},
|
||||
tools = {
|
||||
hover_actions = { auto_focus = true },
|
||||
crate_graph = {
|
||||
backend = "svg",
|
||||
output = "Rust-Crate-Graph-" .. os.time() .. ".svg",
|
||||
-- how to execute terminal commands
|
||||
-- options right now: termopen / quickfix
|
||||
executor = require("rust-tools/executors").termopen,
|
||||
|
||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||
on_initialized = nil,
|
||||
|
||||
-- These apply to the default RustSetInlayHints command
|
||||
inlay_hints = {
|
||||
-- automatically set inlay hints (type hints)
|
||||
-- default: true
|
||||
auto = true,
|
||||
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = true,
|
||||
|
||||
-- prefix for parameter hints
|
||||
-- default: "<-"
|
||||
parameter_hints_prefix = "<- ",
|
||||
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
-- default: "=>"
|
||||
other_hints_prefix = "=> ",
|
||||
|
||||
-- whether to align to the lenght of the longest line in the file
|
||||
max_len_align = false,
|
||||
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
},
|
||||
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user