diff --git a/src/solidlsp/language_servers/rust_analyzer.py b/src/solidlsp/language_servers/rust_analyzer.py index 2e222b5a8..83e3de8ff 100644 --- a/src/solidlsp/language_servers/rust_analyzer.py +++ b/src/solidlsp/language_servers/rust_analyzer.py @@ -505,9 +505,19 @@ def _get_initialize_params(repository_absolute_path: str) -> InitializeParams: "showUnlinkedFileNotification": True, "showDependenciesExplorer": True, "assist": {"emitMustUse": False, "expressionFillDefault": "todo"}, - "cachePriming": {"enable": True, "numThreads": 0}, + # rustback lightweight patch: serena's symbol tools don't need + # rust-analyzer's eager whole-workspace+deps cache priming, nor a + # re-index on every cargo metadata / target/ change. On large, + # actively-built Rust workspaces these drove rust-analyzer to + # 40+ GB RSS and re-indexed on every external `cargo build`. + # Disabling them keeps symbol navigation working at a fraction of + # the memory. NOTE: checkOnSave is intentionally left enabled below + # because serena's get_diagnostics_for_file relies on flycheck + # (`cargo check`) for Rust diagnostics. (Upstream: expose these as + # a config knob / a "lightweight" RA profile.) + "cachePriming": {"enable": False, "numThreads": 0}, "cargo": { - "autoreload": True, + "autoreload": False, "buildScripts": { "enable": True, "invocationLocation": "workspace",