@@ -87,30 +87,48 @@ const fn attr(
87
87
AttrCompletion { label, lookup, snippet, prefer_inner : false }
88
88
}
89
89
90
+ /// https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index
90
91
const ATTRIBUTES : & [ AttrCompletion ] = & [
91
92
attr ( "allow(…)" , Some ( "allow" ) , Some ( "allow(${0:lint})" ) ) ,
93
+ attr ( "automatically_derived" , None , None ) ,
92
94
attr ( "cfg_attr(…)" , Some ( "cfg_attr" ) , Some ( "cfg_attr(${1:predicate}, ${0:attr})" ) ) ,
93
95
attr ( "cfg(…)" , Some ( "cfg" ) , Some ( "cfg(${0:predicate})" ) ) ,
96
+ attr ( "cold" , None , None ) ,
97
+ attr ( r#"crate_name = """# , Some ( "crate_name" ) , Some ( r#"crate_name = "${0:crate_name}""# ) )
98
+ . prefer_inner ( ) ,
94
99
attr ( "deny(…)" , Some ( "deny" ) , Some ( "deny(${0:lint})" ) ) ,
95
100
attr ( r#"deprecated = "…""# , Some ( "deprecated" ) , Some ( r#"deprecated = "${0:reason}""# ) ) ,
96
101
attr ( "derive(…)" , Some ( "derive" ) , Some ( r#"derive(${0:Debug})"# ) ) ,
102
+ attr (
103
+ r#"export_name = "…""# ,
104
+ Some ( "export_name" ) ,
105
+ Some ( r#"export_name = "${0:exported_symbol_name}""# ) ,
106
+ ) ,
97
107
attr ( r#"doc = "…""# , Some ( "doc" ) , Some ( r#"doc = "${0:docs}""# ) ) ,
98
108
attr ( "feature(…)" , Some ( "feature" ) , Some ( "feature(${0:flag})" ) ) . prefer_inner ( ) ,
99
109
attr ( "forbid(…)" , Some ( "forbid" ) , Some ( "forbid(${0:lint})" ) ) ,
100
110
// FIXME: resolve through macro resolution?
101
111
attr ( "global_allocator" , None , None ) . prefer_inner ( ) ,
102
112
attr ( r#"ignore = "…""# , Some ( "ignore" ) , Some ( r#"ignore = "${0:reason}""# ) ) ,
103
113
attr ( "inline(…)" , Some ( "inline" ) , Some ( "inline(${0:lint})" ) ) ,
104
- attr ( r#"link_name = "…""# , Some ( "link_name" ) , Some ( r#"link_name = "${0:symbol_name}""# ) ) ,
105
114
attr ( "link" , None , None ) ,
115
+ attr ( r#"link_name = "…""# , Some ( "link_name" ) , Some ( r#"link_name = "${0:symbol_name}""# ) ) ,
116
+ attr (
117
+ r#"link_section = "…""# ,
118
+ Some ( "link_section" ) ,
119
+ Some ( r#"link_section = "${0:section_name}""# ) ,
120
+ ) ,
106
121
attr ( "macro_export" , None , None ) ,
107
122
attr ( "macro_use" , None , None ) ,
108
123
attr ( r#"must_use = "…""# , Some ( "must_use" ) , Some ( r#"must_use = "${0:reason}""# ) ) ,
124
+ attr ( "no_link" , None , None ) . prefer_inner ( ) ,
125
+ attr ( "no_implicit_prelude" , None , None ) . prefer_inner ( ) ,
126
+ attr ( "no_main" , None , None ) . prefer_inner ( ) ,
109
127
attr ( "no_mangle" , None , None ) ,
110
128
attr ( "no_std" , None , None ) . prefer_inner ( ) ,
111
129
attr ( "non_exhaustive" , None , None ) ,
112
130
attr ( "panic_handler" , None , None ) . prefer_inner ( ) ,
113
- attr ( "path = \" … \" " , Some ( "path" ) , Some ( "path =\ " ${0:path}\" " ) ) ,
131
+ attr ( r# "path = "…""# , Some ( "path" ) , Some ( r# "path ="${0:path}""# ) ) ,
114
132
attr ( "proc_macro" , None , None ) ,
115
133
attr ( "proc_macro_attribute" , None , None ) ,
116
134
attr ( "proc_macro_derive(…)" , Some ( "proc_macro_derive" ) , Some ( "proc_macro_derive(${0:Trait})" ) ) ,
@@ -125,9 +143,12 @@ const ATTRIBUTES: &[AttrCompletion] = &[
125
143
attr (
126
144
r#"target_feature = "…""# ,
127
145
Some ( "target_feature" ) ,
128
- Some ( "target_feature = \ " ${0:feature}\" " ) ,
146
+ Some ( r# "target_feature = "${0:feature}""# ) ,
129
147
) ,
130
148
attr ( "test" , None , None ) ,
149
+ attr ( "track_caller" , None , None ) ,
150
+ attr ( "type_length_limit = …" , Some ( "type_length_limit" ) , Some ( "type_length_limit = ${0:128}" ) )
151
+ . prefer_inner ( ) ,
131
152
attr ( "used" , None , None ) ,
132
153
attr ( "warn(…)" , Some ( "warn" ) , Some ( "warn(${0:lint})" ) ) ,
133
154
attr (
@@ -449,17 +470,21 @@ struct Test {}
449
470
r#"#[<|>]"# ,
450
471
expect ! [ [ r#"
451
472
at allow(…)
473
+ at automatically_derived
452
474
at cfg(…)
453
475
at cfg_attr(…)
476
+ at cold
454
477
at deny(…)
455
478
at deprecated = "…"
456
479
at derive(…)
457
480
at doc = "…"
481
+ at export_name = "…"
458
482
at forbid(…)
459
483
at ignore = "…"
460
484
at inline(…)
461
485
at link
462
486
at link_name = "…"
487
+ at link_section = "…"
463
488
at macro_export
464
489
at macro_use
465
490
at must_use = "…"
@@ -473,6 +498,7 @@ struct Test {}
473
498
at should_panic(…)
474
499
at target_feature = "…"
475
500
at test
501
+ at track_caller
476
502
at used
477
503
at warn(…)
478
504
"# ] ] ,
@@ -490,22 +516,30 @@ struct Test {}
490
516
r"#![<|>]" ,
491
517
expect ! [ [ r#"
492
518
at allow(…)
519
+ at automatically_derived
493
520
at cfg(…)
494
521
at cfg_attr(…)
522
+ at cold
523
+ at crate_name = ""
495
524
at deny(…)
496
525
at deprecated = "…"
497
526
at derive(…)
498
527
at doc = "…"
528
+ at export_name = "…"
499
529
at feature(…)
500
530
at forbid(…)
501
531
at global_allocator
502
532
at ignore = "…"
503
533
at inline(…)
504
534
at link
505
535
at link_name = "…"
536
+ at link_section = "…"
506
537
at macro_export
507
538
at macro_use
508
539
at must_use = "…"
540
+ at no_implicit_prelude
541
+ at no_link
542
+ at no_main
509
543
at no_mangle
510
544
at no_std
511
545
at non_exhaustive
@@ -519,6 +553,8 @@ struct Test {}
519
553
at should_panic(…)
520
554
at target_feature = "…"
521
555
at test
556
+ at track_caller
557
+ at type_length_limit = …
522
558
at used
523
559
at warn(…)
524
560
at windows_subsystem = "…"
0 commit comments