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/completion/src | |
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/completion/src')
-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 { |