diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
commit | cacdb0eab8131bfb945eb7ed0150c92ec56eefe2 (patch) | |
tree | f762de90ce813591bc640ae0bce36493a3dcafa9 /crates/ra_ide_api/src/symbol_index.rs | |
parent | 4e8664d9d37021e85d72b6228fa45e7edf4a1a74 (diff) | |
parent | 1834bae5b86c54ed9dece26e82436919d59e6cb7 (diff) |
Merge #1486
1486: allow rustfmt to reorder imports r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r-- | crates/ra_ide_api/src/symbol_index.rs | 36 |
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. |
22 | use std::{ | 22 | use 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 | ||
29 | use fst::{self, Streamer}; | 29 | use fst::{self, Streamer}; |
30 | use 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 | }; | ||
38 | use ra_db::{ | 30 | use ra_db::{ |
39 | SourceRootId, SourceDatabase, | ||
40 | salsa::{self, ParallelDatabase}, | 31 | salsa::{self, ParallelDatabase}, |
32 | SourceDatabase, SourceRootId, | ||
33 | }; | ||
34 | use 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 | }; |
42 | use rayon::prelude::*; | 41 | use rayon::prelude::*; |
43 | 42 | ||
44 | use crate::{ | 43 | use crate::{db::RootDatabase, FileId, Query}; |
45 | FileId, Query, | ||
46 | db::RootDatabase, | ||
47 | }; | ||
48 | 44 | ||
49 | #[salsa::query_group(SymbolsDatabaseStorage)] | 45 | #[salsa::query_group(SymbolsDatabaseStorage)] |
50 | pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { | 46 | pub(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)] |
307 | mod tests { | 303 | mod 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() { |