@@ -219,8 +219,7 @@ const ATTRIBUTES: &[AttrCompletion] = &[
219
219
) ,
220
220
attr ( "feature(…)" , Some ( "feature" ) , Some ( "feature(${0:flag})" ) ) . prefer_inner ( ) ,
221
221
attr ( "forbid(…)" , Some ( "forbid" ) , Some ( "forbid(${0:lint})" ) ) ,
222
- // FIXME: resolve through macro resolution?
223
- attr ( "global_allocator" , None , None ) . prefer_inner ( ) ,
222
+ attr ( "global_allocator" , None , None ) ,
224
223
attr ( r#"ignore = "…""# , Some ( "ignore" ) , Some ( r#"ignore = "${0:reason}""# ) ) ,
225
224
attr ( "inline" , Some ( "inline" ) , Some ( "inline" ) ) ,
226
225
attr ( "link" , None , None ) ,
@@ -239,7 +238,7 @@ const ATTRIBUTES: &[AttrCompletion] = &[
239
238
attr ( "no_mangle" , None , None ) ,
240
239
attr ( "no_std" , None , None ) . prefer_inner ( ) ,
241
240
attr ( "non_exhaustive" , None , None ) ,
242
- attr ( "panic_handler" , None , None ) . prefer_inner ( ) ,
241
+ attr ( "panic_handler" , None , None ) ,
243
242
attr ( r#"path = "…""# , Some ( "path" ) , Some ( r#"path ="${0:path}""# ) ) ,
244
243
attr ( "proc_macro" , None , None ) ,
245
244
attr ( "proc_macro_attribute" , None , None ) ,
@@ -609,6 +608,7 @@ mod tests {
609
608
at export_name = "…"
610
609
at link_name = "…"
611
610
at link_section = "…"
611
+ at global_allocator
612
612
at used
613
613
"# ] ] ,
614
614
) ;
@@ -732,20 +732,45 @@ mod tests {
732
732
}
733
733
734
734
#[ test]
735
- fn complete_attribute_on_expr ( ) {
735
+ fn complete_attribute_on_fn ( ) {
736
736
check (
737
- r#"fn main() { #[$0] foo () }"# ,
737
+ r#"#[$0] fn main () { }"# ,
738
738
expect ! [ [ r#"
739
739
at allow(…)
740
740
at cfg(…)
741
741
at cfg_attr(…)
742
742
at deny(…)
743
743
at forbid(…)
744
744
at warn(…)
745
+ at deprecated
746
+ at doc = "…"
747
+ at doc(hidden)
748
+ at doc(alias = "…")
749
+ at must_use
750
+ at no_mangle
751
+ at export_name = "…"
752
+ at link_name = "…"
753
+ at link_section = "…"
754
+ at cold
755
+ at ignore = "…"
756
+ at inline
757
+ at must_use
758
+ at panic_handler
759
+ at proc_macro
760
+ at proc_macro_derive(…)
761
+ at proc_macro_attribute
762
+ at should_panic
763
+ at target_feature = "…"
764
+ at test
765
+ at track_caller
745
766
"# ] ] ,
746
767
) ;
768
+ }
769
+
770
+ #[ test]
771
+ fn complete_attribute_on_expr ( ) {
747
772
check (
748
- r#"fn main() { #[$0] foo(); }"# ,
773
+ r#"fn main() { #[$0] foo() }"# ,
749
774
expect ! [ [ r#"
750
775
at allow(…)
751
776
at cfg(…)
0 commit comments