Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop passing experiment flags to parser for features that have shipped. #1256

Merged
merged 4 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
munificent marked this conversation as resolved.
Show resolved Hide resolved
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