File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,9 @@ config_data! {
246246 /// `rust-project.json`, or JSON objects in `rust-project.json` format.
247247 linkedProjects: Vec <ManifestOrProjectJson > = "[]" ,
248248
249+ /// Pre-fill caches on project load.
250+ load_prefillCaches: bool = "true" ,
251+
249252 /// Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
250253 lruCapacity: Option <usize > = "null" ,
251254
@@ -545,6 +548,10 @@ impl Config {
545548 )
546549 }
547550
551+ pub fn prefill_caches ( & self ) -> bool {
552+ self . data . load_prefillCaches
553+ }
554+
548555 pub fn location_link ( & self ) -> bool {
549556 try_or ! ( self . caps. text_document. as_ref( ) ?. definition?. link_support?, false )
550557 }
Original file line number Diff line number Diff line change @@ -433,7 +433,9 @@ impl GlobalState {
433433 for flycheck in & self . flycheck {
434434 flycheck. update ( ) ;
435435 }
436- self . prime_caches_queue . request_op ( ) ;
436+ if self . config . prefill_caches ( ) {
437+ self . prime_caches_queue . request_op ( ) ;
438+ }
437439 }
438440
439441 if !was_quiescent || state_changed {
Original file line number Diff line number Diff line change @@ -389,6 +389,11 @@ of projects.
389389Elements must be paths pointing to `Cargo.toml` ,
390390`rust-project.json` , or JSON objects in `rust-project.json` format.
391391--
392+ [[rust-analyzer.load.prefillCaches]]rust-analyzer.load.prefillCaches (default: `true` )::
393+ +
394+ --
395+ Pre-fill caches on project load.
396+ --
392397[[rust-analyzer.lruCapacity]]rust-analyzer.lruCapacity (default: `null` )::
393398+
394399--
Original file line number Diff line number Diff line change 828828 ]
829829 }
830830 },
831+ "rust-analyzer.load.prefillCaches" : {
832+ "markdownDescription" : " Pre-fill caches on project load." ,
833+ "default" : true ,
834+ "type" : " boolean"
835+ },
831836 "rust-analyzer.lruCapacity" : {
832837 "markdownDescription" : " Number of syntax trees rust-analyzer keeps in memory. Defaults to 128." ,
833838 "default" : null ,
You can’t perform that action at this time.
0 commit comments