mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix possible issue where unnamed is_symbol_def would pop stack wrongly
This removes is_symbol_def as unnecessary.
This commit is contained in:
parent
0c37a9cc28
commit
3973974de1
1 changed files with 1 additions and 11 deletions
|
@ -200,16 +200,6 @@ fn is_type(kind: SyntaxKind) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_symbol_def(kind: SyntaxKind) -> bool {
|
|
||||||
match kind {
|
|
||||||
FN_DEF | STRUCT_DEF | ENUM_DEF | TRAIT_DEF | MODULE | TYPE_DEF | CONST_DEF | STATIC_DEF => {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The actual data that is stored in the index. It should be as compact as
|
/// The actual data that is stored in the index. It should be as compact as
|
||||||
/// possible.
|
/// possible.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
|
@ -236,7 +226,7 @@ fn source_file_to_file_symbols(source_file: &SourceFile, file_id: FileId) -> Vec
|
||||||
}
|
}
|
||||||
|
|
||||||
WalkEvent::Leave(node) => {
|
WalkEvent::Leave(node) => {
|
||||||
if is_symbol_def(node.kind()) {
|
if to_symbol(node).is_some() {
|
||||||
stack.pop();
|
stack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue