♻️ refactor(nvim): change rust-tools for rustaceanvim
This commit is contained in:
parent
469cb8e820
commit
849f08267e
2 changed files with 63 additions and 1 deletions
|
@ -106,7 +106,7 @@
|
||||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "4a90ac83c7c8e0ba8a1b6af38bed6d5ee1b04e08" },
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "4a90ac83c7c8e0ba8a1b6af38bed6d5ee1b04e08" },
|
||||||
"refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" },
|
"refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" },
|
||||||
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
|
"rustaceanvim": { "branch": "master", "commit": "3a439b5c76f0e54bd8bf3b498a849079015fc20f" },
|
||||||
"satellite.nvim": { "branch": "main", "commit": "1a20861227eba8bf2d8282ab4ec5fc071e8b20e2" },
|
"satellite.nvim": { "branch": "main", "commit": "1a20861227eba8bf2d8282ab4ec5fc071e8b20e2" },
|
||||||
"search-replace.nvim": { "branch": "main", "commit": "d92290a02d97f4e9b8cd60d28b56b403432158d5" },
|
"search-replace.nvim": { "branch": "main", "commit": "d92290a02d97f4e9b8cd60d28b56b403432158d5" },
|
||||||
"semshi": { "branch": "master", "commit": "0182447e2ff4dfa04cd2dfe5f189e012c581ca45" },
|
"semshi": { "branch": "master", "commit": "0182447e2ff4dfa04cd2dfe5f189e012c581ca45" },
|
||||||
|
|
|
@ -1,5 +1,67 @@
|
||||||
return {
|
return {
|
||||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||||
|
{
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mrcjkb/rustaceanvim",
|
||||||
|
version = "^3", -- Recommended
|
||||||
|
ft = { "rust" },
|
||||||
|
opts = {
|
||||||
|
server = {
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- register which-key mappings
|
||||||
|
local wk = require("which-key")
|
||||||
|
-- stylua: ignore
|
||||||
|
wk.register({
|
||||||
|
["<leader>cR"] = { function() vim.cmd.RustLsp("codeAction") end, "Code Action" },
|
||||||
|
["<leader>dr"] = { function() vim.cmd.RustLsp("debuggables") end, "Rust debuggables" },
|
||||||
|
}, { mode = "n", buffer = bufnr })
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
-- rust-analyzer language server configuration
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true,
|
||||||
|
loadOutDirsFromCheck = true,
|
||||||
|
runBuildScripts = true,
|
||||||
|
},
|
||||||
|
-- Add clippy lints for Rust.
|
||||||
|
checkOnSave = {
|
||||||
|
allFeatures = true,
|
||||||
|
command = "clippy",
|
||||||
|
extraArgs = { "--no-deps" },
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true,
|
||||||
|
ignored = {
|
||||||
|
["async-trait"] = { "async_trait" },
|
||||||
|
["napi-derive"] = { "napi" },
|
||||||
|
["async-recursion"] = { "async_recursion" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, opts or {})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
rust_analyzer = {},
|
||||||
|
},
|
||||||
|
setup = {
|
||||||
|
rust_analyzer = function()
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"luckasRanarison/nvim-devdocs",
|
"luckasRanarison/nvim-devdocs",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue