diff options
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index b8213d62f..f833d2a9a 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -50,6 +50,8 @@ pub(crate) struct CompletionContext<'a> { | |||
50 | pub(super) dot_receiver_is_ambiguous_float_literal: bool, | 50 | pub(super) dot_receiver_is_ambiguous_float_literal: bool, |
51 | /// If this is a call (method or function) in particular, i.e. the () are already there. | 51 | /// If this is a call (method or function) in particular, i.e. the () are already there. |
52 | pub(super) is_call: bool, | 52 | pub(super) is_call: bool, |
53 | /// If this is a macro call, i.e. the () are already there. | ||
54 | pub(super) is_macro_call: bool, | ||
53 | pub(super) is_path_type: bool, | 55 | pub(super) is_path_type: bool, |
54 | pub(super) has_type_args: bool, | 56 | pub(super) has_type_args: bool, |
55 | } | 57 | } |
@@ -102,6 +104,7 @@ impl<'a> CompletionContext<'a> { | |||
102 | is_new_item: false, | 104 | is_new_item: false, |
103 | dot_receiver: None, | 105 | dot_receiver: None, |
104 | is_call: false, | 106 | is_call: false, |
107 | is_macro_call: false, | ||
105 | is_path_type: false, | 108 | is_path_type: false, |
106 | has_type_args: false, | 109 | has_type_args: false, |
107 | dot_receiver_is_ambiguous_float_literal: false, | 110 | dot_receiver_is_ambiguous_float_literal: false, |
@@ -269,6 +272,7 @@ impl<'a> CompletionContext<'a> { | |||
269 | .and_then(ast::PathExpr::cast) | 272 | .and_then(ast::PathExpr::cast) |
270 | .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast)) | 273 | .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast)) |
271 | .is_some(); | 274 | .is_some(); |
275 | self.is_macro_call = path.syntax().parent().and_then(ast::MacroCall::cast).is_some(); | ||
272 | 276 | ||
273 | self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); | 277 | self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); |
274 | self.has_type_args = segment.type_arg_list().is_some(); | 278 | self.has_type_args = segment.type_arg_list().is_some(); |