From 0a638676d1f447daa18e1364ef6559da6123f7cf Mon Sep 17 00:00:00 2001 From: Ryo Yoshida Date: Wed, 12 Apr 2023 02:35:43 +0900 Subject: [PATCH] Fix faulty variable extraction --- .../ide-completion/src/completions/flyimport.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ide-completion/src/completions/flyimport.rs b/crates/ide-completion/src/completions/flyimport.rs index 32d3fb8c624..49f97d7a4ce 100644 --- a/crates/ide-completion/src/completions/flyimport.rs +++ b/crates/ide-completion/src/completions/flyimport.rs @@ -267,10 +267,10 @@ fn import_on_the_fly( .into_iter() .filter(ns_filter) .filter(|import| { - let item = &import.item_to_import; - !ctx.is_item_hidden(item) - && !ctx.is_item_hidden(item) - && ctx.check_stability(item.attrs(ctx.db).as_deref()) + let original_item = &import.original_item; + !ctx.is_item_hidden(&import.item_to_import) + && !ctx.is_item_hidden(original_item) + && ctx.check_stability(original_item.attrs(ctx.db).as_deref()) }) .sorted_by_key(|located_import| { compute_fuzzy_completion_order_key( @@ -317,10 +317,10 @@ fn import_on_the_fly_pat_( .into_iter() .filter(ns_filter) .filter(|import| { - let item = &import.item_to_import; - !ctx.is_item_hidden(item) - && !ctx.is_item_hidden(item) - && ctx.check_stability(item.attrs(ctx.db).as_deref()) + let original_item = &import.original_item; + !ctx.is_item_hidden(&import.item_to_import) + && !ctx.is_item_hidden(original_item) + && ctx.check_stability(original_item.attrs(ctx.db).as_deref()) }) .sorted_by_key(|located_import| { compute_fuzzy_completion_order_key(