diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs | 6 | ||||
-rw-r--r-- | crates/ra_ide/src/extend_selection.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/folding_ranges.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/inlay_hints.rs | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 221d7847e..c8704eb3e 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -37,9 +37,9 @@ pub(crate) struct CompletionContext<'a> { | |||
37 | pub(super) name_ref_syntax: Option<ast::NameRef>, | 37 | pub(super) name_ref_syntax: Option<ast::NameRef>, |
38 | pub(super) function_syntax: Option<ast::Fn>, | 38 | pub(super) function_syntax: Option<ast::Fn>, |
39 | pub(super) use_item_syntax: Option<ast::Use>, | 39 | pub(super) use_item_syntax: Option<ast::Use>, |
40 | pub(super) record_lit_syntax: Option<ast::RecordLit>, | 40 | pub(super) record_lit_syntax: Option<ast::RecordExpr>, |
41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, | 41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, |
42 | pub(super) record_field_syntax: Option<ast::RecordField>, | 42 | pub(super) record_field_syntax: Option<ast::RecordExprField>, |
43 | pub(super) impl_def: Option<ast::ImplDef>, | 43 | pub(super) impl_def: Option<ast::ImplDef>, |
44 | /// FIXME: `ActiveParameter` is string-based, which is very very wrong | 44 | /// FIXME: `ActiveParameter` is string-based, which is very very wrong |
45 | pub(super) active_parameter: Option<ActiveParameter>, | 45 | pub(super) active_parameter: Option<ActiveParameter>, |
@@ -316,7 +316,7 @@ impl<'a> CompletionContext<'a> { | |||
316 | self.name_ref_syntax = | 316 | self.name_ref_syntax = |
317 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); | 317 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); |
318 | let name_range = name_ref.syntax().text_range(); | 318 | let name_range = name_ref.syntax().text_range(); |
319 | if ast::RecordField::for_field_name(&name_ref).is_some() { | 319 | if ast::RecordExprField::for_field_name(&name_ref).is_some() { |
320 | self.record_lit_syntax = | 320 | self.record_lit_syntax = |
321 | self.sema.find_node_at_offset_with_macros(&original_file, offset); | 321 | self.sema.find_node_at_offset_with_macros(&original_file, offset); |
322 | } | 322 | } |
@@ -357,7 +357,7 @@ impl<'a> CompletionContext<'a> { | |||
357 | .take_while(|it| { | 357 | .take_while(|it| { |
358 | it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR | 358 | it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR |
359 | }) | 359 | }) |
360 | .find_map(ast::RecordField::cast); | 360 | .find_map(ast::RecordExprField::cast); |
361 | 361 | ||
362 | let parent = match name_ref.syntax().parent() { | 362 | let parent = match name_ref.syntax().parent() { |
363 | Some(it) => it, | 363 | Some(it) => it, |
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index 897177d05..efbb00d6d 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs | |||
@@ -146,7 +146,7 @@ fn missing_struct_field_fix( | |||
146 | ) -> Option<Fix> { | 146 | ) -> Option<Fix> { |
147 | let record_expr = sema.ast(d); | 147 | let record_expr = sema.ast(d); |
148 | 148 | ||
149 | let record_lit = ast::RecordLit::cast(record_expr.syntax().parent()?.parent()?)?; | 149 | let record_lit = ast::RecordExpr::cast(record_expr.syntax().parent()?.parent()?)?; |
150 | let def_id = sema.resolve_variant(record_lit)?; | 150 | let def_id = sema.resolve_variant(record_lit)?; |
151 | let module; | 151 | let module; |
152 | let def_file_id; | 152 | let def_file_id; |
@@ -263,8 +263,8 @@ fn check_struct_shorthand_initialization( | |||
263 | file_id: FileId, | 263 | file_id: FileId, |
264 | node: &SyntaxNode, | 264 | node: &SyntaxNode, |
265 | ) -> Option<()> { | 265 | ) -> Option<()> { |
266 | let record_lit = ast::RecordLit::cast(node.clone())?; | 266 | let record_lit = ast::RecordExpr::cast(node.clone())?; |
267 | let record_field_list = record_lit.record_field_list()?; | 267 | let record_field_list = record_lit.record_expr_field_list()?; |
268 | for record_field in record_field_list.fields() { | 268 | for record_field in record_field_list.fields() { |
269 | if let (Some(name_ref), Some(expr)) = (record_field.name_ref(), record_field.expr()) { | 269 | if let (Some(name_ref), Some(expr)) = (record_field.name_ref(), record_field.expr()) { |
270 | let field_name = name_ref.syntax().text().to_string(); | 270 | let field_name = name_ref.syntax().text().to_string(); |
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index b1c4561c1..597a7d82f 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs | |||
@@ -41,7 +41,7 @@ fn try_extend_selection( | |||
41 | MATCH_ARM_LIST, | 41 | MATCH_ARM_LIST, |
42 | RECORD_FIELD_DEF_LIST, | 42 | RECORD_FIELD_DEF_LIST, |
43 | TUPLE_FIELD_DEF_LIST, | 43 | TUPLE_FIELD_DEF_LIST, |
44 | RECORD_FIELD_LIST, | 44 | RECORD_EXPR_FIELD_LIST, |
45 | ENUM_VARIANT_LIST, | 45 | ENUM_VARIANT_LIST, |
46 | USE_TREE_LIST, | 46 | USE_TREE_LIST, |
47 | GENERIC_PARAM_LIST, | 47 | GENERIC_PARAM_LIST, |
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index bad079146..972505450 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs | |||
@@ -87,7 +87,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { | |||
87 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), | 87 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), |
88 | RECORD_FIELD_DEF_LIST | 88 | RECORD_FIELD_DEF_LIST |
89 | | RECORD_FIELD_PAT_LIST | 89 | | RECORD_FIELD_PAT_LIST |
90 | | RECORD_FIELD_LIST | 90 | | RECORD_EXPR_FIELD_LIST |
91 | | ITEM_LIST | 91 | | ITEM_LIST |
92 | | EXTERN_ITEM_LIST | 92 | | EXTERN_ITEM_LIST |
93 | | USE_TREE_LIST | 93 | | USE_TREE_LIST |
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index f2e4f7ee5..714ba6bd9 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs | |||
@@ -96,7 +96,7 @@ fn get_chaining_hints( | |||
96 | return None; | 96 | return None; |
97 | } | 97 | } |
98 | 98 | ||
99 | if matches!(expr, ast::Expr::RecordLit(_)) { | 99 | if matches!(expr, ast::Expr::RecordExpr(_)) { |
100 | return None; | 100 | return None; |
101 | } | 101 | } |
102 | 102 | ||