diff options
author | Geoffrey Copin <[email protected]> | 2020-04-09 23:35:43 +0100 |
---|---|---|
committer | Geoffrey Copin <[email protected]> | 2020-04-09 23:57:03 +0100 |
commit | 730a927c5e6b382690e88f482a03701636242a2c (patch) | |
tree | e148e93832b9b7c1ddedaaa4c5d10f80d07abec6 /crates/ra_syntax | |
parent | 176f7f61175bc433c56083a758bd7a28a8ae31f8 (diff) |
Implement assist "Reorder field names"
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 20f663046..79b225622 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -3256,6 +3256,7 @@ pub enum Pat { | |||
3256 | RangePat(RangePat), | 3256 | RangePat(RangePat), |
3257 | LiteralPat(LiteralPat), | 3257 | LiteralPat(LiteralPat), |
3258 | MacroPat(MacroPat), | 3258 | MacroPat(MacroPat), |
3259 | RecordFieldPat(RecordFieldPat), | ||
3259 | } | 3260 | } |
3260 | impl From<OrPat> for Pat { | 3261 | impl From<OrPat> for Pat { |
3261 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } | 3262 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } |
@@ -3302,12 +3303,15 @@ impl From<LiteralPat> for Pat { | |||
3302 | impl From<MacroPat> for Pat { | 3303 | impl From<MacroPat> for Pat { |
3303 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } | 3304 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } |
3304 | } | 3305 | } |
3306 | impl From<RecordFieldPat> for Pat { | ||
3307 | fn from(node: RecordFieldPat) -> Pat { Pat::RecordFieldPat(node) } | ||
3308 | } | ||
3305 | impl AstNode for Pat { | 3309 | impl AstNode for Pat { |
3306 | fn can_cast(kind: SyntaxKind) -> bool { | 3310 | fn can_cast(kind: SyntaxKind) -> bool { |
3307 | match kind { | 3311 | match kind { |
3308 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT | 3312 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT |
3309 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT | 3313 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT |
3310 | | LITERAL_PAT | MACRO_PAT => true, | 3314 | | LITERAL_PAT | MACRO_PAT | RECORD_FIELD_PAT => true, |
3311 | _ => false, | 3315 | _ => false, |
3312 | } | 3316 | } |
3313 | } | 3317 | } |
@@ -3328,6 +3332,7 @@ impl AstNode for Pat { | |||
3328 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), | 3332 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), |
3329 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), | 3333 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), |
3330 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), | 3334 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), |
3335 | RECORD_FIELD_PAT => Pat::RecordFieldPat(RecordFieldPat { syntax }), | ||
3331 | _ => return None, | 3336 | _ => return None, |
3332 | }; | 3337 | }; |
3333 | Some(res) | 3338 | Some(res) |
@@ -3349,6 +3354,7 @@ impl AstNode for Pat { | |||
3349 | Pat::RangePat(it) => &it.syntax, | 3354 | Pat::RangePat(it) => &it.syntax, |
3350 | Pat::LiteralPat(it) => &it.syntax, | 3355 | Pat::LiteralPat(it) => &it.syntax, |
3351 | Pat::MacroPat(it) => &it.syntax, | 3356 | Pat::MacroPat(it) => &it.syntax, |
3357 | Pat::RecordFieldPat(it) => &it.syntax, | ||
3352 | } | 3358 | } |
3353 | } | 3359 | } |
3354 | } | 3360 | } |