Skip to content

Enable language version 3.10 and format dot shorthands. #1745

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

Merged
merged 4 commits into from
Jul 22, 2025

Conversation

munificent
Copy link
Member

@munificent munificent commented Jul 18, 2025

This is using a workaround for dart-lang/sdk#60840. That issue is fixed and a new version of analyzer is published, but unfortunately there is no corresponding version of test that works with it so I can't upgrade yet.

The workaround is pretty harmless, so I'm fine with it. (The formatter uses similar logic to handle commas which also aren't represented in the AST nodes.)

I pulled the tests here by looking at the language tests for the feature (which are excellent and comprehensive) so I think I covered everything. I verified that the formatter can format everything in the SDK language tests (at least everything that can be parsed because there are error tests in there). Let me know if you see any corners of the syntax I missed. (I didn't realize that you could use const until I read the tests.)

Fix #1686.

This is using a workaround for dart-lang/sdk#60840.
That issue is fixed and a new version of analyzer is published, but
unfortunately there is no corresponding version of test that works with
it so I can't upgrade yet.

The workaround is pretty harmless, so I'm fine with it. (The formatter
uses similar logic to handle commas which also aren't represented in the
AST nodes.)
@munificent munificent requested review from natebosch and kallentu July 18, 2025 00:36
Copy link
Member

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be fine to use a dependency override to get a working pub solve before a new test is published - it's very likely compatible code and needs only a pubspec change.

munificent added a commit that referenced this pull request Jul 18, 2025
The only change in this version is allowing 3.9 as a supported language
version. This was rolled into the SDK a couple of weeks ago, but not
published.

I figure I should publish this before rolling the supported version
again to 3.10 just in case any external needs 3.9 support.

I'll land this before landing #1745.
munificent added a commit that referenced this pull request Jul 18, 2025
The only change in this version is allowing 3.9 as a supported language
version. This was rolled into the SDK a couple of weeks ago, but not
published.

I figure I should publish this before rolling the supported version
again to 3.10 just in case any external needs 3.9 support.

I'll land this before landing #1745.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@munificent
Copy link
Member Author

It would also be fine to use a dependency override to get a working pub solve before a new test is published - it's very likely compatible code and needs only a pubspec change.

I just tried that and it looks like there are a decent number of changes I'll have to make to get things working with 8.0.0, so I'll probably land the workaround for now and then update to 8.0.0 when the new test version is out.

@munificent
Copy link
Member Author

Actually, it turns out the changes were trivial so I'll sit on this PR until the new test version is out and then upload a commit that bumps to 8.0.0.

@munificent
Copy link
Member Author

OK, I updated to the latest analyzer and removed the workarounds now that the AST has everything I need. PTAL, thanks!

Copy link
Member

@kallentu kallentu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Bob!

@munificent munificent merged commit 4f2fe38 into main Jul 22, 2025
7 checks passed
@munificent munificent deleted the dot-shorthands branch July 22, 2025 20:30
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

Successfully merging this pull request may close these issues.

[Dot Shorthands] Formatter updates
3 participants