Hide ImportId

This commit is contained in:
Aleksey Kladov 2019-11-23 16:39:53 +03:00
parent 3bdb034906
commit e5bcb69e4f
4 changed files with 26 additions and 21 deletions

View file

@ -1,6 +1,6 @@
//! FIXME: write short doc here
use hir::{Adt, Either, PathResolution};
use hir::{Adt, Either, HasSource, PathResolution};
use ra_syntax::AstNode;
use test_utils::tested_by;
@ -27,7 +27,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
}
if Some(module) == ctx.module {
if let Some(import) = import {
if let Either::A(use_tree) = module.import_source(ctx.db, import) {
if let Either::A(use_tree) = import.source(ctx.db).value {
if use_tree.syntax().text_range().contains_inclusive(ctx.offset) {
// for `use self::foo<|>`, don't suggest `foo` as a completion
tested_by!(dont_complete_current_use);