From 1b0c7701cc97cd7bef8bb9729011d4cf291a60c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:42:52 +0200 Subject: Rename ra_ide -> ide --- crates/ide/src/prime_caches.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 crates/ide/src/prime_caches.rs (limited to 'crates/ide/src/prime_caches.rs') diff --git a/crates/ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs new file mode 100644 index 000000000..c5ab5a1d8 --- /dev/null +++ b/crates/ide/src/prime_caches.rs @@ -0,0 +1,12 @@ +//! rust-analyzer is lazy and doesn't not compute anything unless asked. This +//! sometimes is counter productive when, for example, the first goto definition +//! request takes longer to compute. This modules implemented prepopulating of +//! various caches, it's not really advanced at the moment. + +use crate::{FileId, RootDatabase}; + +pub(crate) fn prime_caches(db: &RootDatabase, files: Vec) { + for file in files { + let _ = crate::syntax_highlighting::highlight(db, file, None, false); + } +} -- cgit v1.2.3