aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-03 16:13:42 +0000
committerGitHub <[email protected]>2019-12-03 16:13:42 +0000
commit96b9d5b44ed50160c7a4eb07a31bee5f05b1ecf3 (patch)
tree74a889d70e201d6997c6baf179261ab3ed8bf23c /crates/ra_ide/src/completion
parent15f143f0c33cbd382a2ad7a407d9601cb843d164 (diff)
parent009437f5d9949d2276aa26040e03af0ab328acf3 (diff)
Merge #2469
2469: Replace `ra_hir_expand::either` with crate r=matklad a=ice1000 As title. Co-authored-by: ice1000 <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r--crates/ra_ide/src/completion/complete_path.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_ide/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs
index 89e0009a1..28f94e0a7 100644
--- a/crates/ra_ide/src/completion/complete_path.rs
+++ b/crates/ra_ide/src/completion/complete_path.rs
@@ -1,6 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use hir::{Adt, Either, HasSource, PathResolution}; 3use either::Either;
4use hir::{Adt, HasSource, PathResolution};
4use ra_syntax::AstNode; 5use ra_syntax::AstNode;
5use test_utils::tested_by; 6use test_utils::tested_by;
6 7
@@ -27,7 +28,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
27 } 28 }
28 if Some(module) == ctx.module { 29 if Some(module) == ctx.module {
29 if let Some(import) = import { 30 if let Some(import) = import {
30 if let Either::A(use_tree) = import.source(ctx.db).value { 31 if let Either::Left(use_tree) = import.source(ctx.db).value {
31 if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { 32 if use_tree.syntax().text_range().contains_inclusive(ctx.offset) {
32 // for `use self::foo<|>`, don't suggest `foo` as a completion 33 // for `use self::foo<|>`, don't suggest `foo` as a completion
33 tested_by!(dont_complete_current_use); 34 tested_by!(dont_complete_current_use);