replace rust-tools with rustaceanvim
This commit is contained in:
@@ -8,6 +8,8 @@ local lsp_attach = function(client, buf)
|
||||
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
||||
|
||||
vim.lsp.inlay_hint.enable(buf, true)
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = buf }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
@@ -78,27 +80,6 @@ return {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = lsp_attach
|
||||
--}
|
||||
require("rust-tools").setup({
|
||||
server = {
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp_attach,
|
||||
standalone = false,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
rustfmt = {
|
||||
extraArgs = { "+nightly" },
|
||||
},
|
||||
cargo = {
|
||||
features = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
dap = {
|
||||
adapter = require('rust-tools.dap').get_codelldb_adapter(
|
||||
codelldb_path, liblldb_path)
|
||||
}
|
||||
})
|
||||
lspconfig.bashls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp_attach
|
||||
@@ -130,7 +111,46 @@ return {
|
||||
})
|
||||
end
|
||||
},
|
||||
{ 'simrat39/rust-tools.nvim' },
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = "^3",
|
||||
ft = { "rust" },
|
||||
config = function()
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
on_attach = lsp_attach,
|
||||
settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
rustfmt = {
|
||||
extraArgs = { "+nightly" },
|
||||
},
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
loadOutDirsFromCheck = true,
|
||||
runBuildScripts = true,
|
||||
},
|
||||
-- Add clippy lints for Rust.
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
command = "clippy",
|
||||
extraArgs = { "--no-deps" },
|
||||
},
|
||||
-- TODO this breaks diagnostics, look into what can be done
|
||||
-- procMacro = {
|
||||
-- enable = true,
|
||||
-- ignored = {
|
||||
-- ["async-trait"] = { "async_trait" },
|
||||
-- ["napi-derive"] = { "napi" },
|
||||
-- ["async-recursion"] = { "async_recursion" },
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
{ 'onsails/lspkind-nvim' }, -- pictograms replace (?) with lspsaga
|
||||
{
|
||||
'j-hui/fidget.nvim',
|
||||
|
Reference in New Issue
Block a user