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.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs
index b563dfe88..1b5d1eb1d 100644
--- a/crates/ra_ide_api/src/symbol_index.rs
+++ b/crates/ra_ide_api/src/symbol_index.rs
@@ -27,13 +27,13 @@ use std::{
27 27
28use fst::{self, Streamer}; 28use fst::{self, Streamer};
29use ra_syntax::{ 29use ra_syntax::{
30 SyntaxNode, SourceFile, SmolStr, TreeArc, AstNode, 30 SyntaxNode, SyntaxNodePtr, SourceFile, SmolStr, TreeArc, AstNode,
31 algo::{visit::{visitor, Visitor}, find_covering_node}, 31 algo::{visit::{visitor, Visitor}, find_covering_node},
32 SyntaxKind::{self, *}, 32 SyntaxKind::{self, *},
33 ast::{self, NameOwner}, 33 ast::{self, NameOwner},
34}; 34};
35use ra_db::{ 35use ra_db::{
36 SourceRootId, FilesDatabase, LocalSyntaxPtr, 36 SourceRootId, FilesDatabase,
37 salsa::{self, ParallelDatabase}, 37 salsa::{self, ParallelDatabase},
38}; 38};
39use rayon::prelude::*; 39use rayon::prelude::*;
@@ -62,7 +62,7 @@ fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex>
62 62
63 for (name, text_range) in hir::source_binder::macro_symbols(db, file_id) { 63 for (name, text_range) in hir::source_binder::macro_symbols(db, file_id) {
64 let node = find_covering_node(source_file.syntax(), text_range); 64 let node = find_covering_node(source_file.syntax(), text_range);
65 let ptr = LocalSyntaxPtr::new(node); 65 let ptr = SyntaxNodePtr::new(node);
66 symbols.push(FileSymbol { file_id, name, ptr }) 66 symbols.push(FileSymbol { file_id, name, ptr })
67 } 67 }
68 68
@@ -196,13 +196,13 @@ fn is_type(kind: SyntaxKind) -> bool {
196pub(crate) struct FileSymbol { 196pub(crate) struct FileSymbol {
197 pub(crate) file_id: FileId, 197 pub(crate) file_id: FileId,
198 pub(crate) name: SmolStr, 198 pub(crate) name: SmolStr,
199 pub(crate) ptr: LocalSyntaxPtr, 199 pub(crate) ptr: SyntaxNodePtr,
200} 200}
201 201
202fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, LocalSyntaxPtr)> { 202fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr)> {
203 fn decl<N: NameOwner>(node: &N) -> Option<(SmolStr, LocalSyntaxPtr)> { 203 fn decl<N: NameOwner>(node: &N) -> Option<(SmolStr, SyntaxNodePtr)> {
204 let name = node.name()?.text().clone(); 204 let name = node.name()?.text().clone();
205 let ptr = LocalSyntaxPtr::new(node.syntax()); 205 let ptr = SyntaxNodePtr::new(node.syntax());
206 Some((name, ptr)) 206 Some((name, ptr))
207 } 207 }
208 visitor() 208 visitor()