From 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:21:30 +0200 Subject: Rename RecordLit -> RecordExpr --- crates/ra_ide/src/completion/completion_context.rs | 8 ++++---- crates/ra_ide/src/diagnostics.rs | 6 +++--- crates/ra_ide/src/extend_selection.rs | 2 +- crates/ra_ide/src/folding_ranges.rs | 2 +- crates/ra_ide/src/inlay_hints.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/ra_ide') 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> { pub(super) name_ref_syntax: Option, pub(super) function_syntax: Option, pub(super) use_item_syntax: Option, - pub(super) record_lit_syntax: Option, + pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, - pub(super) record_field_syntax: Option, + pub(super) record_field_syntax: Option, pub(super) impl_def: Option, /// FIXME: `ActiveParameter` is string-based, which is very very wrong pub(super) active_parameter: Option, @@ -316,7 +316,7 @@ impl<'a> CompletionContext<'a> { self.name_ref_syntax = find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); let name_range = name_ref.syntax().text_range(); - if ast::RecordField::for_field_name(&name_ref).is_some() { + if ast::RecordExprField::for_field_name(&name_ref).is_some() { self.record_lit_syntax = self.sema.find_node_at_offset_with_macros(&original_file, offset); } @@ -357,7 +357,7 @@ impl<'a> CompletionContext<'a> { .take_while(|it| { it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR }) - .find_map(ast::RecordField::cast); + .find_map(ast::RecordExprField::cast); let parent = match name_ref.syntax().parent() { 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( ) -> Option { let record_expr = sema.ast(d); - let record_lit = ast::RecordLit::cast(record_expr.syntax().parent()?.parent()?)?; + let record_lit = ast::RecordExpr::cast(record_expr.syntax().parent()?.parent()?)?; let def_id = sema.resolve_variant(record_lit)?; let module; let def_file_id; @@ -263,8 +263,8 @@ fn check_struct_shorthand_initialization( file_id: FileId, node: &SyntaxNode, ) -> Option<()> { - let record_lit = ast::RecordLit::cast(node.clone())?; - let record_field_list = record_lit.record_field_list()?; + let record_lit = ast::RecordExpr::cast(node.clone())?; + let record_field_list = record_lit.record_expr_field_list()?; for record_field in record_field_list.fields() { if let (Some(name_ref), Some(expr)) = (record_field.name_ref(), record_field.expr()) { 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( MATCH_ARM_LIST, RECORD_FIELD_DEF_LIST, TUPLE_FIELD_DEF_LIST, - RECORD_FIELD_LIST, + RECORD_EXPR_FIELD_LIST, ENUM_VARIANT_LIST, USE_TREE_LIST, 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 { ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), RECORD_FIELD_DEF_LIST | RECORD_FIELD_PAT_LIST - | RECORD_FIELD_LIST + | RECORD_EXPR_FIELD_LIST | ITEM_LIST | EXTERN_ITEM_LIST | 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( return None; } - if matches!(expr, ast::Expr::RecordLit(_)) { + if matches!(expr, ast::Expr::RecordExpr(_)) { return None; } -- cgit v1.2.3