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_assists/src/handlers/change_return_type_to_result.rs | 2 +- crates/ra_assists/src/handlers/extract_variable.rs | 2 +- crates/ra_assists/src/handlers/fix_visibility.rs | 2 +- crates/ra_assists/src/handlers/reorder_fields.rs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_assists/src/handlers') diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs index 52e24af6c..12018fc6a 100644 --- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs +++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs @@ -240,7 +240,7 @@ fn get_tail_expr_from_block(expr: &Expr) -> Option> { Expr::ParenExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), Expr::PathExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), Expr::Label(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), - Expr::RecordLit(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), + Expr::RecordExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), Expr::IndexExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), Expr::MethodCallExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), Expr::AwaitExpr(expr) => Some(vec![NodeType::Leaf(expr.syntax().clone())]), diff --git a/crates/ra_assists/src/handlers/extract_variable.rs b/crates/ra_assists/src/handlers/extract_variable.rs index 098adf078..b925a2884 100644 --- a/crates/ra_assists/src/handlers/extract_variable.rs +++ b/crates/ra_assists/src/handlers/extract_variable.rs @@ -45,7 +45,7 @@ pub(crate) fn extract_variable(acc: &mut Assists, ctx: &AssistContext) -> Option target, move |edit| { let field_shorthand = - match to_extract.syntax().parent().and_then(ast::RecordField::cast) { + match to_extract.syntax().parent().and_then(ast::RecordExprField::cast) { Some(field) => field.name_ref(), None => None, }; diff --git a/crates/ra_assists/src/handlers/fix_visibility.rs b/crates/ra_assists/src/handlers/fix_visibility.rs index 1d3ed3c6a..1aefa79cc 100644 --- a/crates/ra_assists/src/handlers/fix_visibility.rs +++ b/crates/ra_assists/src/handlers/fix_visibility.rs @@ -82,7 +82,7 @@ fn add_vis_to_referenced_module_def(acc: &mut Assists, ctx: &AssistContext) -> O } fn add_vis_to_referenced_record_field(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { - let record_field: ast::RecordField = ctx.find_node_at_offset()?; + let record_field: ast::RecordExprField = ctx.find_node_at_offset()?; let (record_field_def, _) = ctx.sema.resolve_record_field(&record_field)?; let current_module = ctx.sema.scope(record_field.syntax()).module()?; diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs index 2ac1c56cf..120250e79 100644 --- a/crates/ra_assists/src/handlers/reorder_fields.rs +++ b/crates/ra_assists/src/handlers/reorder_fields.rs @@ -23,7 +23,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; // ``` // pub(crate) fn reorder_fields(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { - reorder::(acc, ctx).or_else(|| reorder::(acc, ctx)) + reorder::(acc, ctx).or_else(|| reorder::(acc, ctx)) } fn reorder(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { @@ -56,7 +56,7 @@ fn reorder(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { fn get_fields_kind(node: &SyntaxNode) -> Vec { match node.kind() { - RECORD_LIT => vec![RECORD_FIELD], + RECORD_EXPR => vec![RECORD_EXPR_FIELD], RECORD_PAT => vec![RECORD_FIELD_PAT, BIND_PAT], _ => vec![], } @@ -65,7 +65,7 @@ fn get_fields_kind(node: &SyntaxNode) -> Vec { fn get_field_name(node: &SyntaxNode) -> String { let res = match_ast! { match node { - ast::RecordField(field) => field.field_name().map(|it| it.to_string()), + ast::RecordExprField(field) => field.field_name().map(|it| it.to_string()), ast::RecordFieldPat(field) => field.field_name().map(|it| it.to_string()), _ => None, } -- cgit v1.2.3