Skip to content

Commit

Permalink
Stop passing experiment flags to parser for features that have shipped.
Browse files Browse the repository at this point in the history
Fix #1245.
  • Loading branch information
munificent committed Aug 28, 2023
1 parent 4c58ddf commit 8815e20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 2.3.3-dev

* Remove support for `inline class` since that syntax has changed.
* Fix regression in splitting type annotations with library prefixes (#1249).
* Remove support for `inline class` since that syntax has changed.
* Stop passing experiment flags to parser for features that have shipped.

## 2.3.2

Expand Down
20 changes: 9 additions & 11 deletions lib/src/dart_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,15 @@ class DartFormatter {
{required bool patterns}) {
// Enable all features that are enabled by default in the current analyzer
// version.
var featureSet = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version(2, 19, 0),
flags: [
'inline-class',
'class-modifiers',
if (patterns) 'patterns',
'records',
'sealed-class',
'unnamed-libraries',
],
);
FeatureSet featureSet;
if (patterns) {
featureSet = FeatureSet.latestLanguageVersion();
} else {
featureSet = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version(2, 19, 0),
flags: [],
);
}

return parseString(
content: source,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
sdk: "^3.0.0"

dependencies:
analyzer: '>=5.12.0 <7.0.0'
analyzer: '^6.2.0'
args: ">=1.0.0 <3.0.0"
path: ^1.0.0
pub_semver: ">=1.4.4 <3.0.0"
Expand All @@ -22,7 +22,7 @@ dev_dependencies:
# and publishing to npm hasn't been used in a while.
# node_preamble: ^1.0.0
lints: ^2.0.0
test: ^1.16.8
test: ^1.24.6
test_descriptor: ^2.0.0
test_process: ^2.0.0
yaml: ">=2.0.0 <4.0.0"
Expand Down

0 comments on commit 8815e20

Please sign in to comment.