[S] Change in dart/sdk[main]: [analysis_server] Use the minimum of SDK language version and formatt...

0 views
Skip to first unread message

Danny Tuppeny (Gerrit)

unread,
Mar 12, 2026, 2:08:58 PMMar 12
to Brian Wilkerson, Kallen Tu, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Danny Tuppeny added 1 comment

File pkg/analyzer_plugin/lib/src/utilities/formatter.dart
Line 11, Patchset 1 (Latest):
/// The default version to use for formatting code when there is no better
/// effective language version for the code.
///
/// This is the minimum of the latest version supported by the formatter or
/// the current language version.
final defaultFormatterVersion =
DartFormatter.latestLanguageVersion < ExperimentStatus.currentVersion
? DartFormatter.latestLanguageVersion
: ExperimentStatus.currentVersion;
Danny Tuppeny . resolved

Please check this logic seems sound to you. I don't think we should ever default to formatting with a higher number just because the formatter is from the future, but we also can't just use the current language version because that would require rolling the formatter at the same time as bumping the language version in the SDK?

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Gerrit-Change-Number: 487580
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-CC: Bob Nystrom <rnys...@google.com>
Gerrit-CC: Kallen Tu <kall...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 18:08:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Mar 12, 2026, 3:35:42 PMMar 12
to Danny Tuppeny, Brian Wilkerson, Kallen Tu, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny

Brian Wilkerson voted and added 1 comment

Votes added by Brian Wilkerson

Code-Review+1
Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Brian Wilkerson . resolved

I don't have enough understanding of the problem to know whether this is the right fix. I'm guessing that this will work, but I don't know whether it's the best solution.

I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Gerrit-Change-Number: 487580
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-CC: Bob Nystrom <rnys...@google.com>
Gerrit-CC: Kallen Tu <kall...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 19:35:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
Mar 12, 2026, 4:00:31 PMMar 12
to Kallen Tu, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Kallen Tu

Danny Tuppeny added 1 comment

Patchset-level comments
Brian Wilkerson . resolved

I don't have enough understanding of the problem to know whether this is the right fix. I'm guessing that this will work, but I don't know whether it's the best solution.

I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

Danny Tuppeny

I'm guessing that this will work, but I don't know whether it's the best solution.

Yeah, I do have a slight worry that if the formatter has never been ahead of the SDK language before, whether there might be other edge cases we've not considered. If the 3.12 branch isn't far off I would probably suggest waiting until after, but I don't know if that's the case.


> I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

I just wasn't sure how familiar she is with server so thought I'd defer the decision to you two 😄 (I've moved her over now though)

Open in Gerrit

Related details

Attention is currently required from:
  • Kallen Tu
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Gerrit-Change-Number: 487580
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-CC: Bob Nystrom <rnys...@google.com>
Gerrit-Attention: Kallen Tu <kall...@google.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 20:00:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kallen Tu (Gerrit)

unread,
Mar 13, 2026, 4:13:58 PMMar 13
to Danny Tuppeny, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny

Kallen Tu added 1 comment

Patchset-level comments
Brian Wilkerson . resolved

I don't have enough understanding of the problem to know whether this is the right fix. I'm guessing that this will work, but I don't know whether it's the best solution.

I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

Danny Tuppeny

I'm guessing that this will work, but I don't know whether it's the best solution.

Yeah, I do have a slight worry that if the formatter has never been ahead of the SDK language before, whether there might be other edge cases we've not considered. If the 3.12 branch isn't far off I would probably suggest waiting until after, but I don't know if that's the case.


> I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

I just wasn't sure how familiar she is with server so thought I'd defer the decision to you two 😄 (I've moved her over now though)

Kallen Tu

Looking through the history of dart_style rolls, it seems that the language version supported by the formatter has been lower than the SDK before (https://github.com/dart-lang/sdk/commit/3d63e3a09934a4d8a80c87129cbe5cd340fc86c9 Here where we're rolling formatter supporting 3.11 in 3.12 beta 1), but I'm not sure if we've ever been ahead of the SDK version. This also seems to be the case for 3.9 -> 3.10.
I'm not sure how the server handled this before?

So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

But regarding the test here, I think that'll still break if we don't have this change right? Once we get bumped into 3.13 beta 1, the formatter version will be lower than the `ExperimentStatus.currentVersion` until we make a roll.

Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Gerrit-Change-Number: 487580
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-CC: Bob Nystrom <rnys...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Comment-Date: Fri, 13 Mar 2026 20:13:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kallen Tu (Gerrit)

unread,
Mar 13, 2026, 4:56:45 PMMar 13
to Danny Tuppeny, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny

Kallen Tu voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 20:56:42 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    Mar 13, 2026, 4:59:11 PMMar 13
    to Danny Tuppeny, Kallen Tu, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Danny Tuppeny

    Brian Wilkerson voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Danny Tuppeny
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 20:59:08 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Danny Tuppeny (Gerrit)

    unread,
    Mar 13, 2026, 5:04:15 PMMar 13
    to Kallen Tu, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Kallen Tu

    Danny Tuppeny added 1 comment

    Patchset-level comments
    Brian Wilkerson . resolved

    I don't have enough understanding of the problem to know whether this is the right fix. I'm guessing that this will work, but I don't know whether it's the best solution.

    I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

    Danny Tuppeny

    I'm guessing that this will work, but I don't know whether it's the best solution.

    Yeah, I do have a slight worry that if the formatter has never been ahead of the SDK language before, whether there might be other edge cases we've not considered. If the 3.12 branch isn't far off I would probably suggest waiting until after, but I don't know if that's the case.


    > I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

    I just wasn't sure how familiar she is with server so thought I'd defer the decision to you two 😄 (I've moved her over now though)

    Kallen Tu

    Looking through the history of dart_style rolls, it seems that the language version supported by the formatter has been lower than the SDK before (https://github.com/dart-lang/sdk/commit/3d63e3a09934a4d8a80c87129cbe5cd340fc86c9 Here where we're rolling formatter supporting 3.11 in 3.12 beta 1), but I'm not sure if we've ever been ahead of the SDK version. This also seems to be the case for 3.9 -> 3.10.
    I'm not sure how the server handled this before?

    So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

    But regarding the test here, I think that'll still break if we don't have this change right? Once we get bumped into 3.13 beta 1, the formatter version will be lower than the `ExperimentStatus.currentVersion` until we make a roll.

    Danny Tuppeny

    I'm not sure how the server handled this before?

    Handled the formatter being ahead? I guess it's possible it hasn't happened before (but it's also possible that it just didn't cause any issues - the failing test here is something I added very recently).


    > So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

    This might mean we can't land some primary constructor changes until then, though probably only those that trigger formatting (and it's possible once https://dart-review.googlesource.com/c/sdk/+/487841 lands, maybe that's not an issue either).


    > But regarding the test here, I think that'll still break if we don't have this change right?

    Yep, I think the new test might fail whenever the two are out of sync, so I think we should still proceed with this CL even if we don't intended for the formatter to be ahead. It's possible that with this change the formatter being ahead is a non-issue, but I don't know what that value (`DartFormatter.latestLanguageVersion`) is used for inside the formatter - perhaps Bob has the most context to determine that.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kallen Tu
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Attention: Kallen Tu <kall...@google.com>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 21:04:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
    Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
    Comment-In-Reply-To: Kallen Tu <kall...@google.com>
    satisfied_requirement
    open
    diffy

    Kallen Tu (Gerrit)

    unread,
    Mar 13, 2026, 5:08:46 PMMar 13
    to Danny Tuppeny, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Danny Tuppeny

    Kallen Tu added 1 comment

    Patchset-level comments
    Brian Wilkerson . resolved

    I don't have enough understanding of the problem to know whether this is the right fix. I'm guessing that this will work, but I don't know whether it's the best solution.

    I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

    Danny Tuppeny

    I'm guessing that this will work, but I don't know whether it's the best solution.

    Yeah, I do have a slight worry that if the formatter has never been ahead of the SDK language before, whether there might be other edge cases we've not considered. If the 3.12 branch isn't far off I would probably suggest waiting until after, but I don't know if that's the case.


    > I'm also not sure who else ought to review this. I would have guessed Kallen, but you added her as a CC rather than as a reviewer.

    I just wasn't sure how familiar she is with server so thought I'd defer the decision to you two 😄 (I've moved her over now though)

    Kallen Tu

    Looking through the history of dart_style rolls, it seems that the language version supported by the formatter has been lower than the SDK before (https://github.com/dart-lang/sdk/commit/3d63e3a09934a4d8a80c87129cbe5cd340fc86c9 Here where we're rolling formatter supporting 3.11 in 3.12 beta 1), but I'm not sure if we've ever been ahead of the SDK version. This also seems to be the case for 3.9 -> 3.10.
    I'm not sure how the server handled this before?

    So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

    But regarding the test here, I think that'll still break if we don't have this change right? Once we get bumped into 3.13 beta 1, the formatter version will be lower than the `ExperimentStatus.currentVersion` until we make a roll.

    Danny Tuppeny

    I'm not sure how the server handled this before?

    Handled the formatter being ahead? I guess it's possible it hasn't happened before (but it's also possible that it just didn't cause any issues - the failing test here is something I added very recently).


    > So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

    This might mean we can't land some primary constructor changes until then, though probably only those that trigger formatting (and it's possible once https://dart-review.googlesource.com/c/sdk/+/487841 lands, maybe that's not an issue either).


    > But regarding the test here, I think that'll still break if we don't have this change right?

    Yep, I think the new test might fail whenever the two are out of sync, so I think we should still proceed with this CL even if we don't intended for the formatter to be ahead. It's possible that with this change the formatter being ahead is a non-issue, but I don't know what that value (`DartFormatter.latestLanguageVersion`) is used for inside the formatter - perhaps Bob has the most context to determine that.

    Kallen Tu

    Handled the formatter being ahead?

    Ah, handled the formatter being behind I mean. There was some period of time where we were on formatter Dart version 3.11 while the SDK was in 3.12.

    So for the dart_style roll, I can hold off until we reach 3.13 beta 1 (Apr 7) to avoid versioning gymnastics.

    This might mean we can't land some primary constructor changes until then

    Yeah, I immediately realized we probably can't do that. Konstantin has work that requires an analyzer update in https://github.com/dart-lang/dart_style/pull/1815#event-23559758606. So we'll have to push things in.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Danny Tuppeny
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 21:08:41 +0000
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    Mar 13, 2026, 5:15:28 PMMar 13
    to Danny Tuppeny, Kallen Tu, Commit Queue, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Danny Tuppeny

    Brian Wilkerson added 1 comment

    Patchset-level comments
    Brian Wilkerson

    The only language feature I see that was released in 3.12 was private_named_parameters, and that didn't require any changes to either the parser or the formatter. Which would explain why it was ok in that case.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Danny Tuppeny
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 21:15:25 +0000
    satisfied_requirement
    open
    diffy

    Commit Queue (Gerrit)

    unread,
    Mar 13, 2026, 5:42:07 PMMar 13
    to Danny Tuppeny, Kallen Tu, Brian Wilkerson, Bob Nystrom, dart-analys...@google.com, rev...@dartlang.org

    Commit Queue submitted the change

    Change information

    Commit message:
    [analysis_server] Use the minimum of SDK language version and formatter version for formatting

    This allows the formatter to be both ahead or behind the SDK version and still format correctly. We should not use a newer language version than the SDK is using, and we cannot use a newer version than the formatter supports.
    Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Commit-Queue: Brian Wilkerson <brianwi...@google.com>
    Reviewed-by: Kallen Tu <kall...@google.com>
    Reviewed-by: Brian Wilkerson <brianwi...@google.com>
    Files:
    • M pkg/analysis_server/lib/src/g3/utilities.dart
    • M pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart
    • M pkg/analysis_server/lib/src/handler/legacy/legacy_handler.dart
    • M pkg/analyzer_plugin/lib/src/utilities/formatter.dart
    • M pkg/analyzer_plugin/test/src/utilities/formatter_test.dart
    Change size: S
    Delta: 5 files changed, 19 insertions(+), 7 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Kallen Tu, +1 by Brian Wilkerson
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 2
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    open
    diffy
    satisfied_requirement

    Bob Nystrom (Gerrit)

    unread,
    Apr 13, 2026, 5:39:52 PM (3 days ago) Apr 13
    to Danny Tuppeny, dart-...@luci-project-accounts.iam.gserviceaccount.com, Kallen Tu, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org

    Bob Nystrom added 1 comment

    Patchset-level comments
    Bob Nystrom

    Handled the formatter being ahead? I guess it's possible it hasn't happened before

    I don't think it has happened before. The formatter has only cared about language versioning since around Dart 3.7. Since then, I've usually bumped DartFormatter.latestLanguageVersion to the upcoming SDK version and rolled that into the SDK shortly before a release. I don't usually get ahead of the SDK but primary constructors + me going on leave (I'm back!) made things a little wonky.

    In general, I wish the formatter didn't have that hardcoded constant in there at all. It's a chore to remember to bump that for every SDK release. Unfortunately, it's in the public API as a constant and used by some packages, so it wouldn't be possible to change the way this works without a breaking change. Longer-term I would like to come up with a cleaner way for the formatter to handle defaulting to a language version, but I'm not sure what that looks like yet.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
    Gerrit-Change-Number: 487580
    Gerrit-PatchSet: 2
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-CC: Bob Nystrom <rnys...@google.com>
    Gerrit-Comment-Date: Mon, 13 Apr 2026 21:39:49 +0000
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages