aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/symbol_index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/symbol_index.rs')
-rw-r--r--crates/ra_analysis/src/symbol_index.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs
index b57ad5d33..3a0667ecd 100644
--- a/crates/ra_analysis/src/symbol_index.rs
+++ b/crates/ra_analysis/src/symbol_index.rs
@@ -6,7 +6,7 @@ use std::{
6use fst::{self, Streamer}; 6use fst::{self, Streamer};
7use ra_editor::{file_symbols, FileSymbol}; 7use ra_editor::{file_symbols, FileSymbol};
8use ra_syntax::{ 8use ra_syntax::{
9 File, 9 SourceFileNode,
10 SyntaxKind::{self, *}, 10 SyntaxKind::{self, *},
11}; 11};
12use rayon::prelude::*; 12use rayon::prelude::*;
@@ -34,7 +34,9 @@ impl Hash for SymbolIndex {
34} 34}
35 35
36impl SymbolIndex { 36impl SymbolIndex {
37 pub(crate) fn for_files(files: impl ParallelIterator<Item = (FileId, File)>) -> SymbolIndex { 37 pub(crate) fn for_files(
38 files: impl ParallelIterator<Item = (FileId, SourceFileNode)>,
39 ) -> SymbolIndex {
38 let mut symbols = files 40 let mut symbols = files
39 .flat_map(|(file_id, file)| { 41 .flat_map(|(file_id, file)| {
40 file_symbols(&file) 42 file_symbols(&file)
@@ -51,7 +53,7 @@ impl SymbolIndex {
51 SymbolIndex { symbols, map } 53 SymbolIndex { symbols, map }
52 } 54 }
53 55
54 pub(crate) fn for_file(file_id: FileId, file: File) -> SymbolIndex { 56 pub(crate) fn for_file(file_id: FileId, file: SourceFileNode) -> SymbolIndex {
55 SymbolIndex::for_files(rayon::iter::once((file_id, file))) 57 SymbolIndex::for_files(rayon::iter::once((file_id, file)))
56 } 58 }
57} 59}