aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-15 17:16:27 +0000
committerGitHub <[email protected]>2021-01-15 17:16:27 +0000
commita8587f153b5af6eda9917e11dbe92bd4ce4f4ac4 (patch)
tree7d4bfb07292d4f8f893cb09b3d5010a6e900b8fe /crates/completion/src
parent0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (diff)
parent6dbba4d75d56728a95f84ee978eae3ac84016c73 (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.rs8
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};
4use ide_db::base_db::{FilePosition, SourceDatabase}; 4use ide_db::base_db::{FilePosition, SourceDatabase};
5use ide_db::{call_info::ActiveParameter, RootDatabase}; 5use ide_db::{call_info::ActiveParameter, RootDatabase};
6use syntax::{ 6use 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};
12use test_utils::mark; 10use test_utils::mark;
13use text_edit::Indel; 11use text_edit::Indel;
@@ -513,7 +511,7 @@ impl<'a> CompletionContext<'a> {
513} 511}
514 512
515fn find_node_with_range<N: AstNode>(syntax: &SyntaxNode, range: TextRange) -> Option<N> { 513fn 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
519fn is_node<N: AstNode>(node: &SyntaxNode) -> bool { 517fn is_node<N: AstNode>(node: &SyntaxNode) -> bool {