File tree Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* Format named arguments anywhere (#1072 ).
4
4
* Format enhanced enums (#1075 ).
5
+ * Format "super." parameters (#1091 ).
5
6
6
7
# 2.2.1
7
8
Original file line number Diff line number Diff line change @@ -2584,6 +2584,21 @@ class SourceVisitor extends ThrowingAstVisitor {
2584
2584
token (node.superKeyword);
2585
2585
}
2586
2586
2587
+ @override
2588
+ void visitSuperFormalParameter (SuperFormalParameter node) {
2589
+ visitParameterMetadata (node.metadata, () {
2590
+ _beginFormalParameter (node);
2591
+ token (node.keyword, after: space);
2592
+ visit (node.type, after: split);
2593
+ token (node.superKeyword);
2594
+ token (node.period);
2595
+ visit (node.identifier);
2596
+ visit (node.parameters);
2597
+ token (node.question);
2598
+ _endFormalParameter (node);
2599
+ });
2600
+ }
2601
+
2587
2602
@override
2588
2603
void visitSwitchCase (SwitchCase node) {
2589
2604
_visitLabels (node.labels);
Original file line number Diff line number Diff line change @@ -68,4 +68,26 @@ class Foo {
68
68
<<<
69
69
class Foo {
70
70
Foo(this.bar(), baz);
71
+ }
72
+ >>> "super." parameters
73
+ class Foo {
74
+ Foo(super . a, int super . b , int super . bar());
75
+ Foo.optional([ super . a, int super . b = 123 , int super . bar() ]);
76
+ Foo.named({ required super . a, int super . b : 123 , required int super . bar() });
77
+ Foo.other( final int super.x, super.bar() ? );
78
+ }
79
+ <<<
80
+ class Foo {
81
+ Foo(super.a, int super.b,
82
+ int super.bar());
83
+ Foo.optional(
84
+ [super.a,
85
+ int super.b = 123,
86
+ int super.bar()]);
87
+ Foo.named(
88
+ {required super.a,
89
+ int super.b: 123,
90
+ required int super.bar()});
91
+ Foo.other(
92
+ final int super.x, super.bar()?);
71
93
}
Original file line number Diff line number Diff line change @@ -209,6 +209,15 @@ class Foo {
209
209
class Foo {
210
210
Foo(@bar this.field);
211
211
}
212
+ >>> metadata on "super." parameter
213
+ class Foo {
214
+ Foo(@bar super.field, [ @foo() @baz super.another ]);
215
+ }
216
+ <<<
217
+ class Foo {
218
+ Foo(@bar super.field,
219
+ [@foo() @baz super.another]);
220
+ }
212
221
>>> metadata on function-typed formal parameter
213
222
withReturnType(@foo @bar int fn(@foo param)) {}
214
223
withoutReturnType(@foo @bar fn(@foo param)) {}
You can’t perform that action at this time.
0 commit comments