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/reorder_fields.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/handlers/reorder_fields.rs') 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 From 14cb96ec0e6be3b99bfe4ea373c058dcbd2a4f79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 19:54:16 +0200 Subject: Allign RecordPat with RecordExpr --- crates/ra_assists/src/handlers/reorder_fields.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/handlers/reorder_fields.rs') diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs index 120250e79..6a19a4002 100644 --- a/crates/ra_assists/src/handlers/reorder_fields.rs +++ b/crates/ra_assists/src/handlers/reorder_fields.rs @@ -57,7 +57,7 @@ fn reorder(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { fn get_fields_kind(node: &SyntaxNode) -> Vec { match node.kind() { RECORD_EXPR => vec![RECORD_EXPR_FIELD], - RECORD_PAT => vec![RECORD_FIELD_PAT, BIND_PAT], + RECORD_PAT => vec![RECORD_PAT_FIELD, BIND_PAT], _ => vec![], } } @@ -66,7 +66,7 @@ fn get_field_name(node: &SyntaxNode) -> String { let res = match_ast! { match node { ast::RecordExprField(field) => field.field_name().map(|it| it.to_string()), - ast::RecordFieldPat(field) => field.field_name().map(|it| it.to_string()), + ast::RecordPatField(field) => field.field_name().map(|it| it.to_string()), _ => None, } }; -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_assists/src/handlers/reorder_fields.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src/handlers/reorder_fields.rs') diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs index 6a19a4002..c9b743a06 100644 --- a/crates/ra_assists/src/handlers/reorder_fields.rs +++ b/crates/ra_assists/src/handlers/reorder_fields.rs @@ -57,7 +57,7 @@ fn reorder(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { fn get_fields_kind(node: &SyntaxNode) -> Vec { match node.kind() { RECORD_EXPR => vec![RECORD_EXPR_FIELD], - RECORD_PAT => vec![RECORD_PAT_FIELD, BIND_PAT], + RECORD_PAT => vec![RECORD_PAT_FIELD, IDENT_PAT], _ => vec![], } } -- cgit v1.2.3