diff options
author | Aleksey Kladov <[email protected]> | 2021-01-15 17:15:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-15 17:15:33 +0000 |
commit | 6dbba4d75d56728a95f84ee978eae3ac84016c73 (patch) | |
tree | de197df47b3e0a5e54f7a595172db6e1a129ab66 /crates/completion | |
parent | d6a708b1eae170aee4a323ea6513bc4f2a1a5bbc (diff) |
Remove useless wrapper
Diffstat (limited to 'crates/completion')
-rw-r--r-- | crates/completion/src/context.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/completion/src/context.rs b/crates/completion/src/context.rs index d809460e2..b1e8eba85 100644 --- a/crates/completion/src/context.rs +++ b/crates/completion/src/context.rs | |||
@@ -4,10 +4,8 @@ use hir::{Local, ScopeDef, Semantics, SemanticsScope, Type}; | |||
4 | use ide_db::base_db::{FilePosition, SourceDatabase}; | 4 | use ide_db::base_db::{FilePosition, SourceDatabase}; |
5 | use ide_db::{call_info::ActiveParameter, RootDatabase}; | 5 | use ide_db::{call_info::ActiveParameter, RootDatabase}; |
6 | use syntax::{ | 6 | use syntax::{ |
7 | algo::{find_covering_element, find_node_at_offset}, | 7 | algo::find_node_at_offset, ast, match_ast, AstNode, NodeOrToken, SyntaxKind::*, SyntaxNode, |
8 | ast, match_ast, AstNode, NodeOrToken, | 8 | SyntaxToken, TextRange, TextSize, |
9 | SyntaxKind::*, | ||
10 | SyntaxNode, SyntaxToken, TextRange, TextSize, | ||
11 | }; | 9 | }; |
12 | use test_utils::mark; | 10 | use test_utils::mark; |
13 | use text_edit::Indel; | 11 | use text_edit::Indel; |
@@ -513,7 +511,7 @@ impl<'a> CompletionContext<'a> { | |||
513 | } | 511 | } |
514 | 512 | ||
515 | fn find_node_with_range<N: AstNode>(syntax: &SyntaxNode, range: TextRange) -> Option<N> { | 513 | fn find_node_with_range<N: AstNode>(syntax: &SyntaxNode, range: TextRange) -> Option<N> { |
516 | find_covering_element(syntax, range).ancestors().find_map(N::cast) | 514 | syntax.covering_element(range).ancestors().find_map(N::cast) |
517 | } | 515 | } |
518 | 516 | ||
519 | fn is_node<N: AstNode>(node: &SyntaxNode) -> bool { | 517 | fn is_node<N: AstNode>(node: &SyntaxNode) -> bool { |