diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-16 20:01:30 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-16 20:01:30 +0100 |
commit | a4cda3efbbabe4c6129de4dc095953fe858d7d3f (patch) | |
tree | 13f7ec5be79c30c073475eef0d614435bc0d133a /crates/ra_ide_db | |
parent | fc0a47a0c19a1b58a586e30645cec4d80d700513 (diff) | |
parent | cae2498513601c507bb10b15710feb800a24517f (diff) |
Merge #3994
3994: Don't expose SyntaxNodePtr impl details r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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 { | |||
285 | let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value); | 285 | let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value); |
286 | 286 | ||
287 | for symbol in &symbol_index.symbols[start..end] { | 287 | for symbol in &symbol_index.symbols[start..end] { |
288 | if self.only_types && !is_type(symbol.ptr.kind()) { | 288 | if self.only_types && !is_type(symbol.kind) { |
289 | continue; | 289 | continue; |
290 | } | 290 | } |
291 | if self.exact && symbol.name != self.query { | 291 | if self.exact && symbol.name != self.query { |
@@ -312,6 +312,7 @@ fn is_type(kind: SyntaxKind) -> bool { | |||
312 | pub struct FileSymbol { | 312 | pub struct FileSymbol { |
313 | pub file_id: FileId, | 313 | pub file_id: FileId, |
314 | pub name: SmolStr, | 314 | pub name: SmolStr, |
315 | pub kind: SyntaxKind, | ||
315 | pub ptr: SyntaxNodePtr, | 316 | pub ptr: SyntaxNodePtr, |
316 | pub name_range: Option<TextRange>, | 317 | pub name_range: Option<TextRange>, |
317 | pub container_name: Option<SmolStr>, | 318 | pub container_name: Option<SmolStr>, |
@@ -377,6 +378,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { | |||
377 | fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option<FileSymbol> { | 378 | fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option<FileSymbol> { |
378 | to_symbol(node).map(move |(name, ptr, name_range)| FileSymbol { | 379 | to_symbol(node).map(move |(name, ptr, name_range)| FileSymbol { |
379 | name, | 380 | name, |
381 | kind: node.kind(), | ||
380 | ptr, | 382 | ptr, |
381 | file_id, | 383 | file_id, |
382 | name_range: Some(name_range), | 384 | name_range: Some(name_range), |