diff options
Diffstat (limited to 'crates/syntax/src/parsing')
-rw-r--r-- | crates/syntax/src/parsing/reparsing.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/syntax/src/parsing/reparsing.rs b/crates/syntax/src/parsing/reparsing.rs index 3d637bf91..4ad50ab72 100644 --- a/crates/syntax/src/parsing/reparsing.rs +++ b/crates/syntax/src/parsing/reparsing.rs | |||
@@ -124,11 +124,7 @@ fn is_contextual_kw(text: &str) -> bool { | |||
124 | fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { | 124 | fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { |
125 | let node = node.covering_element(range); | 125 | let node = node.covering_element(range); |
126 | 126 | ||
127 | let mut ancestors = match node { | 127 | node.ancestors().find_map(|node| { |
128 | NodeOrToken::Token(it) => it.parent().ancestors(), | ||
129 | NodeOrToken::Node(it) => it.ancestors(), | ||
130 | }; | ||
131 | ancestors.find_map(|node| { | ||
132 | let first_child = node.first_child_or_token().map(|it| it.kind()); | 128 | let first_child = node.first_child_or_token().map(|it| it.kind()); |
133 | let parent = node.parent().map(|it| it.kind()); | 129 | let parent = node.parent().map(|it| it.kind()); |
134 | Reparser::for_node(node.kind(), first_child, parent).map(|r| (node, r)) | 130 | Reparser::for_node(node.kind(), first_child, parent).map(|r| (node, r)) |