mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Remove useless wrapper
This commit is contained in:
parent
d6a708b1ea
commit
6dbba4d75d
9 changed files with 20 additions and 28 deletions
|
@ -3,7 +3,7 @@ use std::iter::successors;
|
|||
use hir::Semantics;
|
||||
use ide_db::RootDatabase;
|
||||
use syntax::{
|
||||
algo::{self, find_covering_element, skip_trivia_token},
|
||||
algo::{self, skip_trivia_token},
|
||||
ast::{self, AstNode, AstToken},
|
||||
Direction, NodeOrToken,
|
||||
SyntaxKind::{self, *},
|
||||
|
@ -76,7 +76,7 @@ fn try_extend_selection(
|
|||
};
|
||||
return Some(leaf_range);
|
||||
};
|
||||
let node = match find_covering_element(root, range) {
|
||||
let node = match root.covering_element(range) {
|
||||
NodeOrToken::Token(token) => {
|
||||
if token.text_range() != range {
|
||||
return Some(token.text_range());
|
||||
|
@ -120,7 +120,7 @@ fn extend_tokens_from_range(
|
|||
macro_call: ast::MacroCall,
|
||||
original_range: TextRange,
|
||||
) -> Option<TextRange> {
|
||||
let src = find_covering_element(¯o_call.syntax(), original_range);
|
||||
let src = macro_call.syntax().covering_element(original_range);
|
||||
let (first_token, last_token) = match src {
|
||||
NodeOrToken::Node(it) => (it.first_token()?, it.last_token()?),
|
||||
NodeOrToken::Token(it) => (it.clone(), it),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue