diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 52b2e3e1..bb6696b7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -106,7 +106,7 @@ "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "4a90ac83c7c8e0ba8a1b6af38bed6d5ee1b04e08" }, "refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" }, - "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "rustaceanvim": { "branch": "master", "commit": "3a439b5c76f0e54bd8bf3b498a849079015fc20f" }, "satellite.nvim": { "branch": "main", "commit": "1a20861227eba8bf2d8282ab4ec5fc071e8b20e2" }, "search-replace.nvim": { "branch": "main", "commit": "d92290a02d97f4e9b8cd60d28b56b403432158d5" }, "semshi": { "branch": "master", "commit": "0182447e2ff4dfa04cd2dfe5f189e012c581ca45" }, diff --git a/.config/nvim/lua/plugins/extras/lang/rust-extended.lua b/.config/nvim/lua/plugins/extras/lang/rust-extended.lua index 60aef896..47af05ec 100644 --- a/.config/nvim/lua/plugins/extras/lang/rust-extended.lua +++ b/.config/nvim/lua/plugins/extras/lang/rust-extended.lua @@ -1,5 +1,67 @@ return { { 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({ + ["cR"] = { function() vim.cmd.RustLsp("codeAction") end, "Code Action" }, + ["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", optional = true,