aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-06 15:27:34 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-06 15:27:34 +0100
commitef782adc293deb287128f005dbab2038ba3ccdc1 (patch)
tree6e451b71b482e75a5a30548ab8f769c5ec17864c /crates/ra_syntax/src
parent32db5884ada59c72aa7ab9f88910ef7c8f882e7d (diff)
parent12f8472d2800b2d7c05cb1fc466c80072ed8e283 (diff)
Merge #1163
1163: fill struct fields diagnostic r=matklad a=pasa implementation of #1095 Co-authored-by: Sergey Parilin <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs8
-rw-r--r--crates/ra_syntax/src/grammar.ron7
2 files changed, 9 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 89d3a35c5..e73fe22e9 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -2371,6 +2371,10 @@ impl NamedFieldList {
2371 pub fn fields(&self) -> impl Iterator<Item = &NamedField> { 2371 pub fn fields(&self) -> impl Iterator<Item = &NamedField> {
2372 super::children(self) 2372 super::children(self)
2373 } 2373 }
2374
2375 pub fn spread(&self) -> Option<&Expr> {
2376 super::child_opt(self)
2377 }
2374} 2378}
2375 2379
2376// NeverType 2380// NeverType
@@ -3564,10 +3568,6 @@ impl StructLit {
3564 pub fn named_field_list(&self) -> Option<&NamedFieldList> { 3568 pub fn named_field_list(&self) -> Option<&NamedFieldList> {
3565 super::child_opt(self) 3569 super::child_opt(self)
3566 } 3570 }
3567
3568 pub fn spread(&self) -> Option<&Expr> {
3569 super::child_opt(self)
3570 }
3571} 3571}
3572 3572
3573// StructPat 3573// StructPat
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index c7abdd6dc..b8665bbc8 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -451,8 +451,11 @@ Grammar(
451 traits: [ "AttrsOwner" ] 451 traits: [ "AttrsOwner" ]
452 ), 452 ),
453 "MatchGuard": (options: ["Expr"]), 453 "MatchGuard": (options: ["Expr"]),
454 "StructLit": (options: ["Path", "NamedFieldList", ["spread", "Expr"]]), 454 "StructLit": (options: ["Path", "NamedFieldList"]),
455 "NamedFieldList": (collections: [ ["fields", "NamedField"] ]), 455 "NamedFieldList": (
456 collections: [ ["fields", "NamedField"] ],
457 options: [["spread", "Expr"]]
458 ),
456 "NamedField": (options: ["NameRef", "Expr"]), 459 "NamedField": (options: ["NameRef", "Expr"]),
457 "CallExpr": ( 460 "CallExpr": (
458 traits: ["ArgListOwner"], 461 traits: ["ArgListOwner"],