From 9ae455ea52bf0bc60476fdb3d50d05f5873040c1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 5 Sep 2019 22:36:04 +0300 Subject: make source_root API more abstract --- crates/ra_ide_api/src/change.rs | 4 ++-- crates/ra_ide_api/src/symbol_index.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 0234c572d..89631935a 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -213,11 +213,11 @@ impl RootDatabase { durability, ); self.set_file_source_root_with_durability(add_file.file_id, root_id, durability); - source_root.files.insert(add_file.path, add_file.file_id); + source_root.insert_file(add_file.path, add_file.file_id); } for remove_file in root_change.removed { self.set_file_text_with_durability(remove_file.file_id, Default::default(), durability); - source_root.files.remove(&remove_file.path); + source_root.remove_file(&remove_file.path); } self.set_source_root_with_durability(root_id, Arc::new(source_root), durability); } diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index d4afddab4..a5729c368 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -87,7 +87,7 @@ pub(crate) fn world_symbols(db: &RootDatabase, query: Query) -> Vec let mut files = Vec::new(); for &root in db.local_roots().iter() { let sr = db.source_root(root); - files.extend(sr.files.values().copied()) + files.extend(sr.walk()) } let snap = Snap(db.snapshot()); -- cgit v1.2.3