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/completions') 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 From 56a7d246d59d9429304b82bce2f1e71b632c5737 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 20 Mar 2021 23:04:28 +0200 Subject: Disable unqualified assoc items completion for now --- crates/ide_completion/src/completions/flyimport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide_completion/src/completions') diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index f6c7d507f..eb2cba631 100644 --- a/crates/ide_completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs @@ -949,7 +949,7 @@ fn main() { } #[test] - fn local_assoc_items_are_omitted() { + fn unqualified_assoc_items_are_omitted() { check( r#" mod something { -- cgit v1.2.3