From 6dbba4d75d56728a95f84ee978eae3ac84016c73 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 15 Jan 2021 20:15:33 +0300 Subject: Remove useless wrapper --- crates/syntax/src/parsing/reparsing.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/syntax/src/parsing/reparsing.rs') 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; use text_edit::Indel; use crate::{ - algo, parsing::{ lexer::{lex_single_syntax_kind, tokenize, Token}, text_token_source::TextTokenSource, @@ -41,7 +40,7 @@ fn reparse_token<'node>( root: &'node SyntaxNode, edit: &Indel, ) -> Option<(GreenNode, Vec, TextRange)> { - let prev_token = algo::find_covering_element(root, edit.delete).as_token()?.clone(); + let prev_token = root.covering_element(edit.delete).as_token()?.clone(); let prev_token_kind = prev_token.kind(); match prev_token_kind { WHITESPACE | COMMENT | IDENT | STRING => { @@ -124,7 +123,7 @@ fn is_contextual_kw(text: &str) -> bool { } fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> { - let node = algo::find_covering_element(node, range); + let node = node.covering_element(range); let mut ancestors = match node { NodeOrToken::Token(it) => it.parent().ancestors(), -- cgit v1.2.3