@@ -18,9 +18,8 @@ use text_edit::Indel;
18
18
use crate :: {
19
19
patterns:: {
20
20
for_is_prev2, has_bind_pat_parent, has_block_expr_parent, has_field_list_parent,
21
- has_impl_as_prev_sibling, has_impl_parent, has_item_list_or_source_file_parent,
22
- has_ref_parent, has_trait_as_prev_sibling, has_trait_parent, inside_impl_trait_block,
23
- is_in_loop_body, is_match_arm, previous_token,
21
+ has_impl_parent, has_item_list_or_source_file_parent, has_prev_sibling, has_ref_parent,
22
+ has_trait_parent, inside_impl_trait_block, is_in_loop_body, is_match_arm, previous_token,
24
23
} ,
25
24
CompletionConfig ,
26
25
} ;
@@ -44,7 +43,7 @@ pub(crate) enum ImmediateLocation {
44
43
}
45
44
46
45
#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
47
- pub enum PrevSibling {
46
+ pub ( crate ) enum PrevSibling {
48
47
Trait ,
49
48
Impl ,
50
49
}
@@ -323,9 +322,9 @@ impl<'a> CompletionContext<'a> {
323
322
self . previous_token = previous_token ( syntax_element. clone ( ) ) ;
324
323
self . in_loop_body = is_in_loop_body ( syntax_element. clone ( ) ) ;
325
324
self . is_match_arm = is_match_arm ( syntax_element. clone ( ) ) ;
326
- if has_impl_as_prev_sibling ( syntax_element. clone ( ) ) {
325
+ if has_prev_sibling ( syntax_element. clone ( ) , IMPL ) {
327
326
self . prev_sibling = Some ( PrevSibling :: Impl )
328
- } else if has_trait_as_prev_sibling ( syntax_element. clone ( ) ) {
327
+ } else if has_prev_sibling ( syntax_element. clone ( ) , TRAIT ) {
329
328
self . prev_sibling = Some ( PrevSibling :: Trait )
330
329
}
331
330
0 commit comments