Add SourceRoot::is_library, in preparation for salsa's durability

This commit is contained in:
Aleksey Kladov 2019-06-24 12:35:07 +03:00
parent 7d79be3280
commit 8109ebb101
2 changed files with 16 additions and 1 deletions

View file

@ -163,7 +163,8 @@ impl RootDatabase {
if !change.new_roots.is_empty() {
let mut local_roots = Vec::clone(&self.local_roots());
for (root_id, is_local) in change.new_roots {
self.set_source_root(root_id, Default::default());
let root = if is_local { SourceRoot::new() } else { SourceRoot::new_library() };
self.set_source_root(root_id, Arc::new(root));
if is_local {
local_roots.push(root_id);
}