[fix] Update some stuff and Change deprecated commands
This commit is contained in:
@@ -60,7 +60,7 @@ local normal_mode_maps = {
|
|||||||
-- { key = '<leader>a', map = [[<cmd>lua vim.lsp.buf.document_highlight()<cr>]] },
|
-- { key = '<leader>a', map = [[<cmd>lua vim.lsp.buf.document_highlight()<cr>]] },
|
||||||
-- { key = '<leader>c', map = [[<cmd>lua vim.lsp.buf.clear_references()<cr>]] },
|
-- { key = '<leader>c', map = [[<cmd>lua vim.lsp.buf.clear_references()<cr>]] },
|
||||||
{ key = '<leader>"', map = [["+]] },
|
{ key = '<leader>"', map = [["+]] },
|
||||||
{ key = 'F', map = [[<cmd>lua vim.lsp.buf.formatting()<cr>]] },
|
{ key = 'F', map = [[<cmd>lua vim.lsp.buf.format { async = true }<cr>]] },
|
||||||
{ key = 'T', map = [[<cmd>lua require'lsp_extensions'.inlay_hints()<cr>]] },
|
{ key = 'T', map = [[<cmd>lua require'lsp_extensions'.inlay_hints()<cr>]] },
|
||||||
|
|
||||||
-- { key = '<C-W-%>', map = [[<cmd>vsplit<cr>]] },
|
-- { key = '<C-W-%>', map = [[<cmd>vsplit<cr>]] },
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
local codelldb_path = '/Users/fs0c131y/.vscode/extensions/vadimcn.vscode-lldb-1.6.9/adapter/codelldb'
|
local codelldb_path = '/Users/fs0c131y/.vscode/extensions/vadimcn.vscode-lldb-1.6.9/adapter/codelldb'
|
||||||
local liblldb_path = '/Users/fs0c131y/.vscode/extensions/vadimcn.vscode-lldb-1.6.9/lldb/lib/liblldb.dylib'
|
local liblldb_path = '/Users/fs0c131y/.vscode/extensions/vadimcn.vscode-lldb-1.6.9/lldb/lib/liblldb.dylib'
|
||||||
local rt = require('rust-tools')
|
local rt = require('rust-tools')
|
||||||
|
local lspstatus = require('lsp-status')
|
||||||
|
local coq = require('coq')
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
tools = { -- rust-tools options
|
tools = { -- rust-tools options
|
||||||
@@ -179,12 +181,37 @@ local opts = {
|
|||||||
-- setting it to false may improve startup time
|
-- setting it to false may improve startup time
|
||||||
standalone = true,
|
standalone = true,
|
||||||
|
|
||||||
on_attach = function(_, bufnr)
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
imports = {
|
||||||
|
enforce = true,
|
||||||
|
prefix = "self",
|
||||||
|
granularity = {
|
||||||
|
group = "module",
|
||||||
|
},
|
||||||
|
importPrefix = "self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
loadOutDirsFromCheck = true,
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
-- Hover actions
|
-- Hover actions
|
||||||
vim.keymap.set("n", "<S-K>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
vim.keymap.set("n", "<S-K>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||||
-- Code action groups
|
-- Code action groups
|
||||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||||
|
|
||||||
|
lspstatus.on_attach(client)
|
||||||
end,
|
end,
|
||||||
|
capabilities = coq.lsp_ensure_capabilities(lspstatus.capabilities),
|
||||||
|
|
||||||
}, -- rust-analyer options
|
}, -- rust-analyer options
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user