@@ -21,15 +21,17 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
21
21
22
22
let attribute = ctx. attribute_under_caret . as_ref ( ) ?;
23
23
match ( attribute. path ( ) , attribute. token_tree ( ) ) {
24
- ( Some ( path) , Some ( token_tree) ) => match path. to_string ( ) . as_str ( ) {
25
- "derive" => complete_derive ( acc, ctx, token_tree) ,
26
- "feature" => complete_lint ( acc, ctx, token_tree, FEATURES ) ,
27
- "allow" | "warn" | "deny" | "forbid" => {
24
+ ( Some ( path) , Some ( token_tree) ) => {
25
+ let path = path. syntax ( ) . text ( ) ;
26
+ if path == "derive" {
27
+ complete_derive ( acc, ctx, token_tree)
28
+ } else if path == "feature" {
29
+ complete_lint ( acc, ctx, token_tree, FEATURES )
30
+ } else if path == "allow" || path == "warn" || path == "deny" || path == "forbid" {
28
31
complete_lint ( acc, ctx, token_tree. clone ( ) , DEFAULT_LINT_COMPLETIONS ) ;
29
32
complete_lint ( acc, ctx, token_tree, CLIPPY_LINTS ) ;
30
33
}
31
- _ => { }
32
- } ,
34
+ }
33
35
( _, Some ( _token_tree) ) => { }
34
36
_ => complete_attribute_start ( acc, ctx, attribute) ,
35
37
}
0 commit comments