aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-03-03 21:55:21 +0000
committerKirill Bulatov <[email protected]>2021-03-08 21:59:20 +0000
commit24a5d3b19dfa3e076df8b7413d0cc4a547aeb7d7 (patch)
treebb49da53786891e9bfd7d063f863416753265d11 /crates/ide_completion/src/completions
parent33c83e72b9b48177a6171fd06a26676679963a4d (diff)
Fix the completion labels and tests
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/flyimport.rs34
1 files changed, 23 insertions, 11 deletions
diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs
index c1e3f091f..c5b3c9e27 100644
--- a/crates/ide_completion/src/completions/flyimport.rs
+++ b/crates/ide_completion/src/completions/flyimport.rs
@@ -144,7 +144,7 @@ pub(crate) fn import_on_the_fly(acc: &mut Completions, ctx: &CompletionContext)
144 .filter_map(|import| { 144 .filter_map(|import| {
145 render_resolution_with_import( 145 render_resolution_with_import(
146 RenderContext::new(ctx), 146 RenderContext::new(ctx),
147 ImportEdit { import, import_scope: import_scope.clone() }, 147 ImportEdit { import, scope: import_scope.clone() },
148 ) 148 )
149 }), 149 }),
150 ); 150 );
@@ -690,8 +690,8 @@ fn main() {
690} 690}
691"#, 691"#,
692 expect![[r#" 692 expect![[r#"
693 fn weird_function() (dep::test_mod::TestTrait) -> () DEPRECATED
694 ct SPECIAL_CONST (dep::test_mod::TestTrait) DEPRECATED 693 ct SPECIAL_CONST (dep::test_mod::TestTrait) DEPRECATED
694 fn weird_function() (dep::test_mod::TestTrait) -> () DEPRECATED
695 "#]], 695 "#]],
696 ); 696 );
697 } 697 }
@@ -807,7 +807,12 @@ fn main() {
807 bar::baz::Ite$0 807 bar::baz::Ite$0
808}"#; 808}"#;
809 809
810 check(fixture, expect![["st Item (foo::bar::baz::Item)"]]); 810 check(
811 fixture,
812 expect![[r#"
813 st foo::bar::baz::Item
814 "#]],
815 );
811 816
812 check_edit( 817 check_edit(
813 "Item", 818 "Item",
@@ -825,8 +830,7 @@ fn main() {
825 830
826 fn main() { 831 fn main() {
827 bar::baz::Item 832 bar::baz::Item
828 } 833 }"#,
829 "#,
830 ); 834 );
831 } 835 }
832 836
@@ -845,7 +849,12 @@ fn main() {
845 Item::TEST_A$0 849 Item::TEST_A$0
846}"#; 850}"#;
847 851
848 check(fixture, expect![["ct TEST_ASSOC (foo::bar::baz::Item)"]]); 852 check(
853 fixture,
854 expect![[r#"
855 ct TEST_ASSOC (foo::Item)
856 "#]],
857 );
849 858
850 check_edit( 859 check_edit(
851 "TEST_ASSOC", 860 "TEST_ASSOC",
@@ -863,8 +872,7 @@ mod foo {
863 872
864fn main() { 873fn main() {
865 Item::TEST_ASSOC 874 Item::TEST_ASSOC
866} 875}"#,
867"#,
868 ); 876 );
869 } 877 }
870 878
@@ -885,7 +893,12 @@ fn main() {
885 bar::Item::TEST_A$0 893 bar::Item::TEST_A$0
886}"#; 894}"#;
887 895
888 check(fixture, expect![["ct TEST_ASSOC (foo::bar::baz::Item)"]]); 896 check(
897 fixture,
898 expect![[r#"
899 ct TEST_ASSOC (foo::bar::Item)
900 "#]],
901 );
889 902
890 check_edit( 903 check_edit(
891 "TEST_ASSOC", 904 "TEST_ASSOC",
@@ -905,8 +918,7 @@ mod foo {
905 918
906fn main() { 919fn main() {
907 bar::Item::TEST_ASSOC 920 bar::Item::TEST_ASSOC
908} 921}"#,
909"#,
910 ); 922 );
911 } 923 }
912} 924}