From 81961dc035106dcfd29b894aae339261a0ba037b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 20 Mar 2021 11:04:01 +0200 Subject: Do not propose assoc items without qualifiers --- crates/ide_completion/src/completions/flyimport.rs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'crates/ide_completion/src') diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index 08df2df3f..f6c7d507f 100644 --- a/crates/ide_completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs @@ -943,6 +943,38 @@ mod foo { fn main() { bar::Ass$0 +}"#, + expect![[]], + ) + } + + #[test] + fn local_assoc_items_are_omitted() { + check( + r#" +mod something { + pub trait BaseTrait { + fn test_function() -> i32; + } + + pub struct Item1; + pub struct Item2; + + impl BaseTrait for Item1 { + fn test_function() -> i32 { + 1 + } + } + + impl BaseTrait for Item2 { + fn test_function() -> i32 { + 2 + } + } +} + +fn main() { + test_f$0 }"#, expect![[]], ) -- cgit v1.2.3