From cae2498513601c507bb10b15710feb800a24517f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Apr 2020 19:21:18 +0200 Subject: Don't expose SyntaxNodePtr impl details --- crates/ra_ide_db/src/symbol_index.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide_db/src') diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index d30458d86..937abb433 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs @@ -285,7 +285,7 @@ impl Query { let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value); for symbol in &symbol_index.symbols[start..end] { - if self.only_types && !is_type(symbol.ptr.kind()) { + if self.only_types && !is_type(symbol.kind) { continue; } if self.exact && symbol.name != self.query { @@ -312,6 +312,7 @@ fn is_type(kind: SyntaxKind) -> bool { pub struct FileSymbol { pub file_id: FileId, pub name: SmolStr, + pub kind: SyntaxKind, pub ptr: SyntaxNodePtr, pub name_range: Option, pub container_name: Option, @@ -377,6 +378,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option { to_symbol(node).map(move |(name, ptr, name_range)| FileSymbol { name, + kind: node.kind(), ptr, file_id, name_range: Some(name_range), -- cgit v1.2.3