You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you own code that uses dart_style as a library, you should update your code to pass in a language version. To migrate:
If this code is inside a package (as opposed to, say, the Dart core libraries), then update your constraint on dart_style to ^2.3.7. That's the version where the new parameter was added.
If you know the precise language version the code should be parsed as, then pass in that version (as an instance of the pub_semver package's Version class). This is what "real" tools should do.
For simple one-off scripts and other utilities where precise behavior doesn't matter much, you can pass in DartFormatter.latestLanguageVersion to unconditionally parse the code as the latest language version that the formatter itself supports.
When the --tall-style experiment flag ships, the passed in language version will also be used to determine whether you get the current formatting style or the new "tall" style.
I did a search through the SDK, and the constructor calls that I think are relevant are:
Hey Bob, thanks for the detailed description! The two graph_isomorphizer files aren't heavily used and we don't necessarily care about the format of the code being emitted so I've added a change to have those specify DartFormatter.latestLanguageVersion.
sdk/sdk/lib/_internal/js_dev_runtime/private/debugger.dart is actually referencing a local class named DartFormatter so that one doesn't need updating.
Greetings dart2js team friends!
The formatter is moving to being language version aware. This means that when it's parsing some code, it needs to be told what language version to parse it as. The
DartFormatter
constructor now takes an optional parameter where you can pass in the language version. In a future version of dart_style, that parameter will become mandatory.If you own code that uses dart_style as a library, you should update your code to pass in a language version. To migrate:
If this code is inside a package (as opposed to, say, the Dart core libraries), then update your constraint on dart_style to
^2.3.7
. That's the version where the new parameter was added.If you know the precise language version the code should be parsed as, then pass in that version (as an instance of the pub_semver package's
Version
class). This is what "real" tools should do.For simple one-off scripts and other utilities where precise behavior doesn't matter much, you can pass in
DartFormatter.latestLanguageVersion
to unconditionally parse the code as the latest language version that the formatter itself supports.When the
--tall-style
experiment flag ships, the passed in language version will also be used to determine whether you get the current formatting style or the new "tall" style.I did a search through the SDK, and the constructor calls that I think are relevant are:
Thank you!
The text was updated successfully, but these errors were encountered: