dart-lang / dart_style

An opinionated formatter/linter for Dart code
https://pub.dev/packages/dart_style
BSD 3-Clause "New" or "Revised" License
650 stars 121 forks source link

Make "// @dart=" version comments affect the applied style. #1600

Closed munificent closed 1 week ago

munificent commented 1 week ago

The formatter uses an incoming language version to control how the formatted code is parsed. The langauge version is also used to determine whether you get the short or tall style.

Prior to this PR, a // @dart= version comment in the formatted code would affect the language version the code is parsed at. But it wouldn't use that comment to determine whether you get the short or tall style. This fixes that.

Fix #1599.

cc @davidmorgan