aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/symbol_index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs36
1 files changed, 14 insertions, 22 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs
index a6cd7bf61..2ca0a25d4 100644
--- a/crates/ra_ide_api/src/symbol_index.rs
+++ b/crates/ra_ide_api/src/symbol_index.rs
@@ -20,31 +20,27 @@
20//! file in the current workspace, and run a query against the union of all 20//! file in the current workspace, and run a query against the union of all
21//! those FSTs. 21//! those FSTs.
22use std::{ 22use std::{
23 fmt,
23 hash::{Hash, Hasher}, 24 hash::{Hash, Hasher},
24 sync::Arc,
25 mem, 25 mem,
26 fmt, 26 sync::Arc,
27}; 27};
28 28
29use fst::{self, Streamer}; 29use fst::{self, Streamer};
30use ra_syntax::{
31 SyntaxNode, SyntaxNodePtr, SourceFile, SmolStr, TreeArc, AstNode,
32 algo::{visit::{visitor, Visitor}},
33 SyntaxKind::{self, *},
34 ast::{self, NameOwner},
35 WalkEvent,
36 TextRange,
37};
38use ra_db::{ 30use ra_db::{
39 SourceRootId, SourceDatabase,
40 salsa::{self, ParallelDatabase}, 31 salsa::{self, ParallelDatabase},
32 SourceDatabase, SourceRootId,
33};
34use ra_syntax::{
35 algo::visit::{visitor, Visitor},
36 ast::{self, NameOwner},
37 AstNode, SmolStr, SourceFile,
38 SyntaxKind::{self, *},
39 SyntaxNode, SyntaxNodePtr, TextRange, TreeArc, WalkEvent,
41}; 40};
42use rayon::prelude::*; 41use rayon::prelude::*;
43 42
44use crate::{ 43use crate::{db::RootDatabase, FileId, Query};
45 FileId, Query,
46 db::RootDatabase,
47};
48 44
49#[salsa::query_group(SymbolsDatabaseStorage)] 45#[salsa::query_group(SymbolsDatabaseStorage)]
50pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { 46pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
@@ -305,15 +301,11 @@ fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option<FileSymbol> {
305 301
306#[cfg(test)] 302#[cfg(test)]
307mod tests { 303mod tests {
304 use crate::{display::NavigationTarget, mock_analysis::single_file, Query};
308 use ra_syntax::{ 305 use ra_syntax::{
309 SmolStr, 306 SmolStr,
310 SyntaxKind::{FN_DEF, STRUCT_DEF} 307 SyntaxKind::{FN_DEF, STRUCT_DEF},
311}; 308 };
312 use crate::{
313 display::NavigationTarget,
314 mock_analysis::single_file,
315 Query,
316};
317 309
318 #[test] 310 #[test]
319 fn test_world_symbols_with_no_container() { 311 fn test_world_symbols_with_no_container() {