aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-03-20 09:04:01 +0000
committerKirill Bulatov <[email protected]>2021-03-20 20:18:43 +0000
commit81961dc035106dcfd29b894aae339261a0ba037b (patch)
treee6c303055fbe5c1c9de50cbc93c6469a2996a93e /crates/ide_completion/src/completions
parent104a19853e0d5560a21e6c6a31961ca592be1032 (diff)
Do not propose assoc items without qualifiers
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/flyimport.rs32
1 files changed, 32 insertions, 0 deletions
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
@@ -947,4 +947,36 @@ fn main() {
947 expect![[]], 947 expect![[]],
948 ) 948 )
949 } 949 }
950
951 #[test]
952 fn local_assoc_items_are_omitted() {
953 check(
954 r#"
955mod something {
956 pub trait BaseTrait {
957 fn test_function() -> i32;
958 }
959
960 pub struct Item1;
961 pub struct Item2;
962
963 impl BaseTrait for Item1 {
964 fn test_function() -> i32 {
965 1
966 }
967 }
968
969 impl BaseTrait for Item2 {
970 fn test_function() -> i32 {
971 2
972 }
973 }
974}
975
976fn main() {
977 test_f$0
978}"#,
979 expect![[]],
980 )
981 }
950} 982}