aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/completion_context.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-23 15:01:06 +0100
committerGitHub <[email protected]>2019-08-23 15:01:06 +0100
commita832a2f7dd22c93bc69a7be5d24799bb042b8129 (patch)
tree15f55b3eab48c3d0bbb1975fbd4db7cbb56d3e3e /crates/ra_ide_api/src/completion/completion_context.rs
parentc12dce0073c1766f7d2b10a69f8526a8093e70dc (diff)
parent5b18a4eef9e69260ce2f105b33553c929cb7d827 (diff)
Merge #1731
1731: rename pos_field -> tuple_field r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_context.rs')
-rw-r--r--crates/ra_ide_api/src/completion/completion_context.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs
index dfaa9ce69..7139947b3 100644
--- a/crates/ra_ide_api/src/completion/completion_context.rs
+++ b/crates/ra_ide_api/src/completion/completion_context.rs
@@ -20,8 +20,8 @@ pub(crate) struct CompletionContext<'a> {
20 pub(super) module: Option<hir::Module>, 20 pub(super) module: Option<hir::Module>,
21 pub(super) function_syntax: Option<ast::FnDef>, 21 pub(super) function_syntax: Option<ast::FnDef>,
22 pub(super) use_item_syntax: Option<ast::UseItem>, 22 pub(super) use_item_syntax: Option<ast::UseItem>,
23 pub(super) struct_lit_syntax: Option<ast::StructLit>, 23 pub(super) record_lit_syntax: Option<ast::RecordLit>,
24 pub(super) struct_lit_pat: Option<ast::StructPat>, 24 pub(super) record_lit_pat: Option<ast::RecordPat>,
25 pub(super) is_param: bool, 25 pub(super) is_param: bool,
26 /// If a name-binding or reference to a const in a pattern. 26 /// If a name-binding or reference to a const in a pattern.
27 /// Irrefutable patterns (like let) are excluded. 27 /// Irrefutable patterns (like let) are excluded.
@@ -60,8 +60,8 @@ impl<'a> CompletionContext<'a> {
60 module, 60 module,
61 function_syntax: None, 61 function_syntax: None,
62 use_item_syntax: None, 62 use_item_syntax: None,
63 struct_lit_syntax: None, 63 record_lit_syntax: None,
64 struct_lit_pat: None, 64 record_lit_pat: None,
65 is_param: false, 65 is_param: false,
66 is_pat_binding: false, 66 is_pat_binding: false,
67 is_trivial_path: false, 67 is_trivial_path: false,
@@ -120,8 +120,8 @@ impl<'a> CompletionContext<'a> {
120 self.is_param = true; 120 self.is_param = true;
121 return; 121 return;
122 } 122 }
123 if name.syntax().ancestors().find_map(ast::FieldPatList::cast).is_some() { 123 if name.syntax().ancestors().find_map(ast::RecordFieldPatList::cast).is_some() {
124 self.struct_lit_pat = 124 self.record_lit_pat =
125 find_node_at_offset(original_parse.tree().syntax(), self.offset); 125 find_node_at_offset(original_parse.tree().syntax(), self.offset);
126 } 126 }
127 } 127 }
@@ -129,8 +129,8 @@ impl<'a> CompletionContext<'a> {
129 129
130 fn classify_name_ref(&mut self, original_file: SourceFile, name_ref: ast::NameRef) { 130 fn classify_name_ref(&mut self, original_file: SourceFile, name_ref: ast::NameRef) {
131 let name_range = name_ref.syntax().text_range(); 131 let name_range = name_ref.syntax().text_range();
132 if name_ref.syntax().parent().and_then(ast::NamedField::cast).is_some() { 132 if name_ref.syntax().parent().and_then(ast::RecordField::cast).is_some() {
133 self.struct_lit_syntax = find_node_at_offset(original_file.syntax(), self.offset); 133 self.record_lit_syntax = find_node_at_offset(original_file.syntax(), self.offset);
134 } 134 }
135 135
136 let top_node = name_ref 136 let top_node = name_ref