Skip to content

Commit

Permalink
Fixed MixinDeclaration with base.
Browse files Browse the repository at this point in the history
  • Loading branch information
eggnstone committed Jul 19, 2024
1 parent 3b22840 commit c0368f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/src/Formatters/MixinDeclarationFormatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MixinDeclarationFormatter extends IFormatter
throw FormatException('Not a MixinDeclaration: ${node.runtimeType}');

formatState.acceptList(node.sortedCommentAndAnnotations, astVisitor, '$methodName/node.sortedCommentAndAnnotations');
formatState.copyEntity(node.baseKeyword, astVisitor, '$methodName/node.baseKeyword');
formatState.copyEntity(node.mixinKeyword, astVisitor, '$methodName/node.mixinKeyword');
formatState.copyEntity(node.name, astVisitor, '$methodName/node.name');
formatState.copyEntity(node.typeParameters, astVisitor, '$methodName/node.typeParameters');
Expand Down
9 changes: 4 additions & 5 deletions test/Formatters/MixinDeclarationFormatter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ void main()
final List<TestGroupConfig> testGroupConfigs = <TestGroupConfig>[
TestGroupConfig(
inputNodeCreator: AstCreator.createDeclaration,
inputMiddle: 'mixin M on A, B{}',
name: 'MixinDeclaration / mixin M on A, B{}',
inputMiddle: 'base mixin M on A, B{}',
name: 'MixinDeclaration / base mixin M on A, B{}',
astVisitors: <TestVisitor<void>>[
//TestVisitor<OnClause>(8, 'on A, B') OnClause => MixinOnClause
TestVisitor<MixinOnClause>(8, 'on A, B')
TestVisitor<MixinOnClause>(13, 'on A, B')
],
testConfigs: <TestConfig>[
TestConfig.none(),
TestConfig('mixin M on A, B\n{\n}\n')
TestConfig('base mixin M on A, B\n{\n}\n')
]
)
];
Expand Down

0 comments on commit c0368f0

Please sign in to comment.