aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/completion_context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 3d93f7067..9e82d6854 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -63,6 +63,8 @@ pub(crate) struct CompletionContext<'a> {
63 pub(super) dot_receiver_is_ambiguous_float_literal: bool, 63 pub(super) dot_receiver_is_ambiguous_float_literal: bool,
64 /// If this is a call (method or function) in particular, i.e. the () are already there. 64 /// If this is a call (method or function) in particular, i.e. the () are already there.
65 pub(super) is_call: bool, 65 pub(super) is_call: bool,
66 /// Like `is_call`, but for tuple patterns.
67 pub(super) is_pattern_call: bool,
66 /// If this is a macro call, i.e. the () are already there. 68 /// If this is a macro call, i.e. the () are already there.
67 pub(super) is_macro_call: bool, 69 pub(super) is_macro_call: bool,
68 pub(super) is_path_type: bool, 70 pub(super) is_path_type: bool,
@@ -136,6 +138,7 @@ impl<'a> CompletionContext<'a> {
136 is_new_item: false, 138 is_new_item: false,
137 dot_receiver: None, 139 dot_receiver: None,
138 is_call: false, 140 is_call: false,
141 is_pattern_call: false,
139 is_macro_call: false, 142 is_macro_call: false,
140 is_path_type: false, 143 is_path_type: false,
141 has_type_args: false, 144 has_type_args: false,
@@ -370,6 +373,8 @@ impl<'a> CompletionContext<'a> {
370 .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast)) 373 .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast))
371 .is_some(); 374 .is_some();
372 self.is_macro_call = path.syntax().parent().and_then(ast::MacroCall::cast).is_some(); 375 self.is_macro_call = path.syntax().parent().and_then(ast::MacroCall::cast).is_some();
376 self.is_pattern_call =
377 path.syntax().parent().and_then(ast::TupleStructPat::cast).is_some();
373 378
374 self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); 379 self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some();
375 self.has_type_args = segment.type_arg_list().is_some(); 380 self.has_type_args = segment.type_arg_list().is_some();