diff options
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 2f96861ca..9f4c582d0 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -13,8 +13,8 @@ use ra_text_edit::Indel; | |||
13 | 13 | ||
14 | use super::patterns::{ | 14 | use super::patterns::{ |
15 | has_bind_pat_parent, has_block_expr_parent, has_impl_as_prev_sibling, has_impl_parent, | 15 | has_bind_pat_parent, has_block_expr_parent, has_impl_as_prev_sibling, has_impl_parent, |
16 | has_ref_parent, has_trait_as_prev_sibling, has_trait_parent, if_is_prev, is_in_loop_body, | 16 | has_item_list_or_source_file_parent, has_ref_parent, has_trait_as_prev_sibling, |
17 | is_match_arm, unsafe_is_prev, | 17 | has_trait_parent, if_is_prev, is_in_loop_body, is_match_arm, unsafe_is_prev, |
18 | }; | 18 | }; |
19 | use crate::{call_info::ActiveParameter, completion::CompletionConfig, FilePosition}; | 19 | use crate::{call_info::ActiveParameter, completion::CompletionConfig, FilePosition}; |
20 | use test_utils::mark; | 20 | use test_utils::mark; |
@@ -76,6 +76,7 @@ pub(crate) struct CompletionContext<'a> { | |||
76 | pub(super) trait_as_prev_sibling: bool, | 76 | pub(super) trait_as_prev_sibling: bool, |
77 | pub(super) impl_as_prev_sibling: bool, | 77 | pub(super) impl_as_prev_sibling: bool, |
78 | pub(super) is_match_arm: bool, | 78 | pub(super) is_match_arm: bool, |
79 | pub(super) has_item_list_or_source_file_parent: bool, | ||
79 | } | 80 | } |
80 | 81 | ||
81 | impl<'a> CompletionContext<'a> { | 82 | impl<'a> CompletionContext<'a> { |
@@ -145,6 +146,7 @@ impl<'a> CompletionContext<'a> { | |||
145 | impl_as_prev_sibling: false, | 146 | impl_as_prev_sibling: false, |
146 | if_is_prev: false, | 147 | if_is_prev: false, |
147 | is_match_arm: false, | 148 | is_match_arm: false, |
149 | has_item_list_or_source_file_parent: false, | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | let mut original_file = original_file.syntax().clone(); | 152 | let mut original_file = original_file.syntax().clone(); |
@@ -229,6 +231,8 @@ impl<'a> CompletionContext<'a> { | |||
229 | self.impl_as_prev_sibling = has_impl_as_prev_sibling(syntax_element.clone()); | 231 | self.impl_as_prev_sibling = has_impl_as_prev_sibling(syntax_element.clone()); |
230 | self.trait_as_prev_sibling = has_trait_as_prev_sibling(syntax_element.clone()); | 232 | self.trait_as_prev_sibling = has_trait_as_prev_sibling(syntax_element.clone()); |
231 | self.is_match_arm = is_match_arm(syntax_element.clone()); | 233 | self.is_match_arm = is_match_arm(syntax_element.clone()); |
234 | self.has_item_list_or_source_file_parent = | ||
235 | has_item_list_or_source_file_parent(syntax_element.clone()); | ||
232 | } | 236 | } |
233 | 237 | ||
234 | fn fill( | 238 | fn fill( |