File tree 3 files changed +11
-11
lines changed
crates/ide-completion/src
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -371,10 +371,7 @@ impl<'a> CompletionContext<'a> {
371
371
// FIXME: This shouldn't exist
372
372
pub ( crate ) fn is_path_disallowed ( & self ) -> bool {
373
373
self . previous_token_is ( T ! [ unsafe ] )
374
- || matches ! (
375
- self . prev_sibling,
376
- Some ( ImmediatePrevSibling :: Attribute | ImmediatePrevSibling :: Visibility )
377
- )
374
+ || matches ! ( self . prev_sibling, Some ( ImmediatePrevSibling :: Visibility ) )
378
375
|| matches ! (
379
376
self . completion_location,
380
377
Some ( ImmediateLocation :: RecordPat ( _) | ImmediateLocation :: RecordExpr ( _) )
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ pub(crate) enum ImmediatePrevSibling {
24
24
TraitDefName ,
25
25
ImplDefType ,
26
26
Visibility ,
27
- Attribute ,
28
27
}
29
28
30
29
#[ derive( Clone , Debug , PartialEq , Eq ) ]
@@ -124,7 +123,6 @@ pub(crate) fn determine_prev_sibling(name_like: &ast::NameLike) -> Option<Immedi
124
123
} else {
125
124
return None
126
125
} ,
127
- ast:: Attr ( _) => ImmediatePrevSibling :: Attribute ,
128
126
_ => return None ,
129
127
}
130
128
} ;
@@ -484,9 +482,4 @@ mod tests {
484
482
fn test_vis_prev_sibling ( ) {
485
483
check_prev_sibling ( r"pub w$0" , ImmediatePrevSibling :: Visibility ) ;
486
484
}
487
-
488
- #[ test]
489
- fn test_attr_prev_sibling ( ) {
490
- check_prev_sibling ( r"#[attr] w$0" , ImmediatePrevSibling :: Attribute ) ;
491
- }
492
485
}
Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ fn in_item_list_after_attr() {
78
78
check (
79
79
r#"#[attr] $0"# ,
80
80
expect ! [ [ r#"
81
+ ma makro!(…) macro_rules! makro
82
+ md module
81
83
kw const
84
+ kw crate::
82
85
kw enum
83
86
kw extern
84
87
kw fn
@@ -87,8 +90,10 @@ fn in_item_list_after_attr() {
87
90
kw pub
88
91
kw pub(crate)
89
92
kw pub(super)
93
+ kw self::
90
94
kw static
91
95
kw struct
96
+ kw super::
92
97
kw trait
93
98
kw type
94
99
kw union
@@ -184,11 +189,16 @@ fn in_impl_assoc_item_list_after_attr() {
184
189
check (
185
190
r#"impl Struct { #[attr] $0 }"# ,
186
191
expect ! [ [ r#"
192
+ ma makro!(…) macro_rules! makro
193
+ md module
187
194
kw const
195
+ kw crate::
188
196
kw fn
189
197
kw pub
190
198
kw pub(crate)
191
199
kw pub(super)
200
+ kw self::
201
+ kw super::
192
202
kw type
193
203
kw unsafe
194
204
"# ] ] ,
You can’t perform that action at this time.
0 commit comments