aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/parsing
diff options
context:
space:
mode:
Diffstat (limited to 'crates/syntax/src/parsing')
-rw-r--r--crates/syntax/src/parsing/reparsing.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/syntax/src/parsing/reparsing.rs b/crates/syntax/src/parsing/reparsing.rs
index 78eaf3410..76f01084c 100644
--- a/crates/syntax/src/parsing/reparsing.rs
+++ b/crates/syntax/src/parsing/reparsing.rs
@@ -10,7 +10,6 @@ use parser::Reparser;
10use text_edit::Indel; 10use text_edit::Indel;
11 11
12use crate::{ 12use crate::{
13 algo,
14 parsing::{ 13 parsing::{
15 lexer::{lex_single_syntax_kind, tokenize, Token}, 14 lexer::{lex_single_syntax_kind, tokenize, Token},
16 text_token_source::TextTokenSource, 15 text_token_source::TextTokenSource,
@@ -41,7 +40,7 @@ fn reparse_token<'node>(
41 root: &'node SyntaxNode, 40 root: &'node SyntaxNode,
42 edit: &Indel, 41 edit: &Indel,
43) -> Option<(GreenNode, Vec<SyntaxError>, TextRange)> { 42) -> Option<(GreenNode, Vec<SyntaxError>, TextRange)> {
44 let prev_token = algo::find_covering_element(root, edit.delete).as_token()?.clone(); 43 let prev_token = root.covering_element(edit.delete).as_token()?.clone();
45 let prev_token_kind = prev_token.kind(); 44 let prev_token_kind = prev_token.kind();
46 match prev_token_kind { 45 match prev_token_kind {
47 WHITESPACE | COMMENT | IDENT | STRING => { 46 WHITESPACE | COMMENT | IDENT | STRING => {
@@ -124,7 +123,7 @@ fn is_contextual_kw(text: &str) -> bool {
124} 123}
125 124
126fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { 125fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> {
127 let node = algo::find_covering_element(node, range); 126 let node = node.covering_element(range);
128 127
129 let mut ancestors = match node { 128 let mut ancestors = match node {
130 NodeOrToken::Token(it) => it.parent().ancestors(), 129 NodeOrToken::Token(it) => it.parent().ancestors(),