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,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fd', ':RustDebuggables<CR>', {
|
vim.keymap.set("n", "<leader>fd", ":RustDebuggables<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fp', ':RustParentModule<CR>', {
|
vim.keymap.set("n", "<leader>fp", ":RustParentModule<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fJ', ':RustJoinLines<CR>', {
|
vim.keymap.set("n", "<leader>fJ", ":RustJoinLines<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fh', ':RustHoverActions<CR>', {
|
vim.keymap.set("n", "<leader>fh", ":RustHoverActions<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fH', ':RustHoverRange<CR>', {
|
vim.keymap.set("n", "<leader>fH", ":RustHoverRange<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fi', ':RustToggleInlayHints<CR>', {
|
vim.keymap.set("n", "<leader>fm", ":RustExpandMacro<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fm', ':RustExpandMacro<CR>', {
|
vim.keymap.set("n", "<leader>fc", ":RustOpenCargo<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fc', ':RustOpenCargo<CR>', {
|
vim.keymap.set("n", "<leader>fk", ":RustMoveItemUp<CR>", {
|
||||||
buffer = true,
|
buffer = true,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', '<leader>fk', ':RustMoveItemUp<CR>', {
|
vim.keymap.set("n", "<leader>fj", ":RustMoveItemDown<CR>", {
|
||||||
buffer = true,
|
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 = {
|
local rustopts = {
|
||||||
server = opts,
|
server = opts,
|
||||||
dap = {
|
dap = {
|
||||||
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
|
adapter = {
|
||||||
|
type = "executable",
|
||||||
|
command = "lldb-vscode",
|
||||||
|
name = "rt_lldb",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
tools = {
|
tools = {
|
||||||
hover_actions = { auto_focus = true },
|
-- how to execute terminal commands
|
||||||
crate_graph = {
|
-- options right now: termopen / quickfix
|
||||||
backend = "svg",
|
executor = require("rust-tools/executors").termopen,
|
||||||
output = "Rust-Crate-Graph-" .. os.time() .. ".svg",
|
|
||||||
|
-- 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