use salsa's LRU for syntax trees
This commit is contained in:
@@ -7,7 +7,7 @@ use std::collections::HashSet;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use ra_db::{
|
||||
CrateGraph, FileId, SourceRoot, SourceRootId, SourceDatabase, salsa,
|
||||
CrateGraph, FileId, SourceRoot, SourceRootId, SourceDatabase, salsa::{self, Database},
|
||||
};
|
||||
use ra_hir::db;
|
||||
use ra_project_model::ProjectWorkspace;
|
||||
@@ -43,6 +43,8 @@ fn vfs_root_to_id(r: ra_vfs::VfsRoot) -> SourceRootId {
|
||||
impl BatchDatabase {
|
||||
pub fn load(crate_graph: CrateGraph, vfs: &mut Vfs) -> BatchDatabase {
|
||||
let mut db = BatchDatabase { runtime: salsa::Runtime::default() };
|
||||
db.query_mut(ra_db::ParseQuery).set_lru_capacity(128);
|
||||
db.query_mut(ra_hir::db::ParseMacroQuery).set_lru_capacity(128);
|
||||
db.set_crate_graph(Arc::new(crate_graph));
|
||||
|
||||
// wait until Vfs has loaded all roots
|
||||
|
||||
Reference in New Issue
Block a user