fixing rust tooling
This commit is contained in:
+10
-7
@@ -74,6 +74,7 @@ vim.diagnostic.config({
|
||||
})
|
||||
|
||||
-- rust tools
|
||||
local rt = require("rust-tools")
|
||||
|
||||
-- Configure LSP through rust-tools.nvim plugin.
|
||||
-- rust-tools will configure and enable certain LSP features for us.
|
||||
@@ -104,6 +105,10 @@ local opts = {
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
cargo = {
|
||||
-- to enable include! macro being read
|
||||
loadOutDirsFromCheck = true
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -114,16 +119,14 @@ opts.server.on_attach = function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "K", function() rt.hover_actions.hover_actions() end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>gl", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>la", function() vim.lsp.buf.code_action() end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>lf", function() vim.lsp.buf.format() end, opts)
|
||||
vim.keymap.set("n", "<leader>gr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end
|
||||
|
||||
require("rust-tools").setup(opts)
|
||||
rt.setup(opts)
|
||||
|
||||
Reference in New Issue
Block a user