diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index 1c40cfa4..fdac0131 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -282,6 +282,7 @@ in { (mkIf cfg.extensions.rustaceanvim.enable { vim = { + # TODO: Determine if mkForce is the best thing here, and if we should consider a warning instead? Or use priority settings. lsp.servers.rust-analyzer.enable = lib.mkForce false; lsp.servers.rust-analyzer.root_dir = lib.mkForce null; # let rustaceanvim determine root lsp.servers.rust-analyzer.on_attach = lib.mkForce null; # let rustaceanvim determine attach funcs diff --git a/modules/plugins/lsp/presets/rust-analyzer.nix b/modules/plugins/lsp/presets/rust-analyzer.nix index 41585d20..56200e24 100644 --- a/modules/plugins/lsp/presets/rust-analyzer.nix +++ b/modules/plugins/lsp/presets/rust-analyzer.nix @@ -22,6 +22,7 @@ in { # https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26. config = mkIf cfg.enable { + # Taken from https://github.com/neovim/nvim-lspconfig/blob/07dff35e7c95288861200b788ef32d6103f107f0/lsp/rust_analyzer.lua vim.luaConfigRC.rust-util = entryBefore ["lsp-servers"] '' local function rust_reload_workspace(bufnr) local clients = vim.lsp.get_clients { bufnr = bufnr, name = 'rust-analyzer' }