]> git.lizzy.rs Git - rust.git/commit
main: eagerly prime goto-definition caches
authorAndrew Gallant <jamslam@gmail.com>
Sat, 25 Apr 2020 03:30:49 +0000 (23:30 -0400)
committerAndrew Gallant <jamslam@gmail.com>
Sat, 25 Apr 2020 13:28:34 +0000 (09:28 -0400)
commitc1a31d4261afda9839020f772fd6a97a12d9c941
tree63a25a71915e58b5996fed3b9f4062ac2b317a00
parent27a7718880d93f55f905da606d108d3b3c682ab4
main: eagerly prime goto-definition caches

This commit makes RA more aggressive about eagerly priming the caches.
In particular, this fixes an issue where even after RA was done priming
its caches, an initial goto-definition request would have very high
latency. This fixes that issue by requesting syntax highlighting for
everything. It is presumed that this is a tad wasteful, but not overly
so.

This commit also tweaks the logic that determines when the cache is
primed. Namely, instead of just priming it when the state is loaded
initially, we attempt to prime it whenever some state changes. This
fixes an issue where if a modification notification is seen before cache
priming is done, it would stop the cache priming early.
crates/ra_ide/src/prime_caches.rs
crates/rust-analyzer/src/main_loop.rs