diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-15 17:16:27 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-15 17:16:27 +0000 |
commit | a8587f153b5af6eda9917e11dbe92bd4ce4f4ac4 (patch) | |
tree | 7d4bfb07292d4f8f893cb09b3d5010a6e900b8fe /crates/syntax/src/parsing | |
parent | 0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (diff) | |
parent | 6dbba4d75d56728a95f84ee978eae3ac84016c73 (diff) |
Merge #7286
7286: Remove useless wrapper r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/syntax/src/parsing')
-rw-r--r-- | crates/syntax/src/parsing/reparsing.rs | 5 |
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; | |||
10 | use text_edit::Indel; | 10 | use text_edit::Indel; |
11 | 11 | ||
12 | use crate::{ | 12 | use 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 | ||
126 | fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { | 125 | fn 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(), |