diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 13 |
1 files changed, 8 insertions, 5 deletions
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 { | |||
181 | } | 181 | } |
182 | pub fn world_symbols(&self, query: Query) -> Cancelable<Vec<(FileId, FileSymbol)>> { | 182 | pub fn world_symbols(&self, query: Query) -> Cancelable<Vec<(FileId, FileSymbol)>> { |
183 | let mut buf = Vec::new(); | 183 | let mut buf = Vec::new(); |
184 | for &lib_id in self.db.libraries().iter() { | 184 | if query.libs { |
185 | buf.push(self.db.library_symbols(lib_id)); | 185 | for &lib_id in self.db.libraries().iter() { |
186 | } | 186 | buf.push(self.db.library_symbols(lib_id)); |
187 | for &file_id in self.db.source_root(WORKSPACE).files.iter() { | 187 | } |
188 | buf.push(self.db.file_symbols(file_id)?); | 188 | } else { |
189 | for &file_id in self.db.source_root(WORKSPACE).files.iter() { | ||
190 | buf.push(self.db.file_symbols(file_id)?); | ||
191 | } | ||
189 | } | 192 | } |
190 | Ok(query.search(&buf)) | 193 | Ok(query.search(&buf)) |
191 | } | 194 | } |