Skip to content

Commit a3f1b04

Browse files
authored
Enable support for inline class syntax (#1185)
1 parent a740aab commit a3f1b04

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Format patterns and related features.
66
* Format record expressions and record type annotations.
77
* Format class modifiers `base`, `final`, `interface`, `mixin`, and `sealed`.
8+
* Format `inline class` declarations.
89
* Format unnamed libraries.
910

1011
## Bug fixes and style changes
@@ -20,7 +21,7 @@
2021
* Fix metadata test to not fail when record syntax makes whitespace between
2122
metadata annotation names and `(` significant ([sdk#50769][]).
2223
* Require Dart 2.19.
23-
* Require `package:analyzer` `^5.1.0`.
24+
* Require `package:analyzer` `^5.7.0`.
2425

2526
[sdk#50769]: https://github.com/dart-lang/sdk/issues/50769
2627

@@ -47,7 +48,7 @@
4748
* Don't allow a line comment in an argument list to cause preceding arguments
4849
to be misformatted.
4950
* Remove blank lines after a line comment at the end of a body.
50-
* Require `package:analyzer` `>=4.4.0 <6.0.0`.
51+
* Require `package:analyzer` `>=4.4.0 <6.0.0`.
5152

5253
# 2.2.3
5354

lib/src/dart_formatter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ class DartFormatter {
206206
var featureSet = FeatureSet.fromEnableFlags2(
207207
sdkLanguageVersion: Version(2, 19, 0),
208208
flags: [
209+
'inline-class',
209210
'class-modifiers',
210211
if (patterns) 'patterns',
211212
'records',

lib/src/source_visitor.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ class SourceVisitor extends ThrowingAstVisitor {
588588
modifier(node.finalKeyword);
589589
modifier(node.sealedKeyword);
590590
modifier(node.mixinKeyword);
591+
modifier(node.inlineKeyword);
591592
token(node.classKeyword);
592593
space();
593594
token(node.name);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ environment:
99
sdk: ">=2.19.0 <3.0.0"
1010

1111
dependencies:
12-
analyzer: ^5.6.0
12+
analyzer: ^5.7.0
1313
args: ">=1.0.0 <3.0.0"
1414
path: ^1.0.0
1515
pub_semver: ">=1.4.4 <3.0.0"

test/whitespace/classes.unit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,8 @@ base mixin class C11 = Object
243243
abstract mixin class C12 = Object
244244
with Mixin;
245245
abstract base mixin class C13 = Object
246-
with Mixin;
246+
with Mixin;
247+
>>> inline classes
248+
inline class C {}
249+
<<<
250+
inline class C {}

0 commit comments

Comments
 (0)