mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Hide ImportId
This commit is contained in:
parent
3bdb034906
commit
e5bcb69e4f
4 changed files with 26 additions and 21 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue