chg: Switched to rustaceanvim for Rust

This commit is contained in:
Sayantan Santra 2024-04-01 02:32:27 -05:00
parent d89548599e
commit 1371124454
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
3 changed files with 34 additions and 24 deletions

View file

@ -52,7 +52,11 @@ require("lazy").setup(
-- vim-moonfly theme -- vim-moonfly theme
{ "bluz71/vim-moonfly-colors", as = "moonfly" }, { "bluz71/vim-moonfly-colors", as = "moonfly" },
-- Rust tools -- Rust tools
"simrat39/rust-tools.nvim", {
"mrcjkb/rustaceanvim",
version = "^4",
ft = { "rust" },
},
-- Automatically add bracket pairs -- Automatically add bracket pairs
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
-- Syntax highlighting for Fish scripts -- Syntax highlighting for Fish scripts

View file

@ -8,14 +8,3 @@ lspconfig.lua_ls.setup({
}, },
} }
}) })
lspconfig.rust_analyzer.setup {
-- Server-specific settings. See `:help lspconfig-setup`
settings = {
['rust-analyzer'] = {
check = {
command = "clippy",
}
},
},
}

View file

@ -1,12 +1,29 @@
require("rust-tools").setup({ vim.g.rustaceanvim = {
server = { -- Plugin configuration
settings = { tools = {
["rust-analyzer"] = { },
check = { -- LSP configuration
command = "clippy" server = {
}, on_attach = function(_, bufnr)
}, vim.keymap.set(
}, "n",
}, "<localleader>a",
}) function()
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
end,
{ silent = true, buffer = bufnr, noremap = true }
)
end,
default_settings = {
-- rust-analyzer language server configuration
["rust-analyzer"] = {
check = {
command = "clippy"
}
},
},
},
-- DAP configuration
dap = {
},
}