aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/parsing/reparsing.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-30 15:19:21 +0000
committerAleksey Kladov <[email protected]>2021-03-16 13:10:49 +0000
commitf5a81ec4683613bd62624811733345d627f2127b (patch)
tree54490888591ddc005d510695787308b78739ef05 /crates/syntax/src/parsing/reparsing.rs
parent62ec04bbd53ba50e21a7b8f23d46958d322640eb (diff)
Upgrade rowan
Notably, new rowan comes with support for mutable syntax trees.
Diffstat (limited to 'crates/syntax/src/parsing/reparsing.rs')
-rw-r--r--crates/syntax/src/parsing/reparsing.rs6
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 {
124fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { 124fn 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))