Remove useless wrapper

This commit is contained in:
Aleksey Kladov 2021-01-15 20:15:33 +03:00
parent d6a708b1ea
commit 6dbba4d75d
9 changed files with 20 additions and 28 deletions

View file

@ -1,7 +1,7 @@
use assists::utils::extract_trivial_expression;
use itertools::Itertools;
use syntax::{
algo::{find_covering_element, non_trivia_sibling},
algo::non_trivia_sibling,
ast::{self, AstNode, AstToken},
Direction, NodeOrToken, SourceFile,
SyntaxKind::{self, USE_TREE, WHITESPACE},
@ -31,7 +31,7 @@ pub(crate) fn join_lines(file: &SourceFile, range: TextRange) -> TextEdit {
range
};
let node = match find_covering_element(file.syntax(), range) {
let node = match file.syntax().covering_element(range) {
NodeOrToken::Node(node) => node,
NodeOrToken::Token(token) => token.parent(),
};