From 363adf07b7763cfe7e13fac0ee148361d51834e4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 25 Oct 2018 17:59:03 +0300 Subject: restore symbols filtering --- crates/ra_analysis/src/imp.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crates/ra_analysis') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 69f5ed330..5a6e2450d 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -181,11 +181,14 @@ impl AnalysisImpl { } pub fn world_symbols(&self, query: Query) -> Cancelable> { let mut buf = Vec::new(); - for &lib_id in self.db.libraries().iter() { - buf.push(self.db.library_symbols(lib_id)); - } - for &file_id in self.db.source_root(WORKSPACE).files.iter() { - buf.push(self.db.file_symbols(file_id)?); + if query.libs { + for &lib_id in self.db.libraries().iter() { + buf.push(self.db.library_symbols(lib_id)); + } + } else { + for &file_id in self.db.source_root(WORKSPACE).files.iter() { + buf.push(self.db.file_symbols(file_id)?); + } } Ok(query.search(&buf)) } -- cgit v1.2.3