blob: 628c989bfc341bd48bd43eace26f881e61220f89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//! 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 hir::Semantics;
use crate::{FileId, RootDatabase};
pub(crate) fn prime_caches(db: &RootDatabase, files: Vec<FileId>) {
let sema = Semantics::new(db);
for file in files {
let _ = sema.to_module_def(file);
}
}
|