@@ -22,24 +22,18 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
22
22
}
23
23
( _, Some ( ast:: AttrInput :: TokenTree ( token_tree) ) ) => {
24
24
let token_tree_str = token_tree. to_string ( ) ;
25
- complete_attribute_start (
26
- acc,
27
- ctx,
28
- attribute,
29
- token_tree_str. starts_with ( '(' ) && token_tree_str. ends_with ( ')' ) ,
30
- )
25
+ let nested = token_tree_str. starts_with ( '(' ) && token_tree_str. ends_with ( ')' ) ;
26
+
27
+ if !nested {
28
+ complete_attribute_start ( acc, ctx, attribute) ;
29
+ }
31
30
}
32
- _ => complete_attribute_start ( acc, ctx, attribute, false ) ,
31
+ _ => complete_attribute_start ( acc, ctx, attribute) ,
33
32
}
34
33
Some ( ( ) )
35
34
}
36
35
37
- fn complete_attribute_start (
38
- acc : & mut Completions ,
39
- ctx : & CompletionContext ,
40
- attribute : & ast:: Attr ,
41
- nested : bool ,
42
- ) {
36
+ fn complete_attribute_start ( acc : & mut Completions , ctx : & CompletionContext , attribute : & ast:: Attr ) {
43
37
for attr_completion in ATTRIBUTES {
44
38
let mut item = CompletionItem :: new (
45
39
CompletionKind :: Attribute ,
@@ -56,9 +50,7 @@ fn complete_attribute_start(
56
50
}
57
51
58
52
if attribute. kind ( ) == ast:: AttrKind :: Inner || !attr_completion. should_be_inner {
59
- if ( nested && attr_completion. should_be_inner ) || !nested {
60
- acc. add ( item) ;
61
- }
53
+ acc. add ( item) ;
62
54
}
63
55
}
64
56
}
0 commit comments