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.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index a76d1ce45..37880448a 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -57,6 +57,7 @@ pub(crate) struct CompletionContext<'a> {
57 pub(super) is_macro_call: bool, 57 pub(super) is_macro_call: bool,
58 pub(super) is_path_type: bool, 58 pub(super) is_path_type: bool,
59 pub(super) has_type_args: bool, 59 pub(super) has_type_args: bool,
60 pub(super) is_attribute: bool,
60} 61}
61 62
62impl<'a> CompletionContext<'a> { 63impl<'a> CompletionContext<'a> {
@@ -113,6 +114,7 @@ impl<'a> CompletionContext<'a> {
113 is_path_type: false, 114 is_path_type: false,
114 has_type_args: false, 115 has_type_args: false,
115 dot_receiver_is_ambiguous_float_literal: false, 116 dot_receiver_is_ambiguous_float_literal: false,
117 is_attribute: false,
116 }; 118 };
117 119
118 let mut original_file = original_file.syntax().clone(); 120 let mut original_file = original_file.syntax().clone();
@@ -306,6 +308,7 @@ impl<'a> CompletionContext<'a> {
306 .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast)) 308 .and_then(|it| it.syntax().parent().and_then(ast::CallExpr::cast))
307 .is_some(); 309 .is_some();
308 self.is_macro_call = path.syntax().parent().and_then(ast::MacroCall::cast).is_some(); 310 self.is_macro_call = path.syntax().parent().and_then(ast::MacroCall::cast).is_some();
311 self.is_attribute = path.syntax().parent().and_then(ast::Attr::cast).is_some();
309 312
310 self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); 313 self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some();
311 self.has_type_args = segment.type_arg_list().is_some(); 314 self.has_type_args = segment.type_arg_list().is_some();