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

Please pass in a language version to DartFormatter() #3302

Closed
munificent opened this issue Oct 22, 2024 · 2 comments
Closed

Please pass in a language version to DartFormatter() #3302

munificent opened this issue Oct 22, 2024 · 2 comments
Assignees

Comments

@munificent
Copy link

munificent commented Oct 22, 2024

In drift_dev/lib/src/backends/build/drift_builder.dart, a call to DartFormatter() from the dart_style package is being used to format the generated code.

We're in the process of moving dart_style to a new formatting style. That involves making the formatter aware of the language version of what it's formatting.

That in turn means that the library API now lets you pass in a language version. In dart_style 2.3.7 you can pass in a language version but the parameter is optional. In the forthcoming 3.0.0 release, that parameter will become mandatory. If you can, please update drift to start passing in a language version. If you know the language version of the code being parsed, pass that in. If you just want to always format the code at the latest language version, you can use DartFormatter.latestLanguageVersion. When you do, make sure to update your dependency constraint on dart_style to ^2.3.7.

Thank you!

@simolus3 simolus3 self-assigned this Oct 23, 2024
@simolus3
Copy link
Owner

Thanks for taking the time to file these detailed issues! I have updated drift to include the language version in 4c896a5.

@munificent
Copy link
Author

Thank you for the quick turnaround! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants