[XL] Change in dart/sdk[main]: [DAS] Fixes type argument handling for `Create function/method/operator`

0 views
Skip to first unread message

Felipe Morschel (Gerrit)

unread,
Dec 8, 2025, 9:12:21 AM12/8/25
to dart-analys...@google.com, rev...@dartlang.org

Felipe Morschel has uploaded the change for review

Commit message

[DAS] Fixes type argument handling for `Create function/method/operator`
Change-Id: I9d8a2f9169c596236430d5c33ab24013cd52238a

Change information

Files:
  • M pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
  • M pkg/analysis_server/lib/src/services/correction/dart/create_method.dart
  • M pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
  • M pkg/analysis_server/lib/src/services/correction/dart/create_operator.dart
  • M pkg/analysis_server/lib/src/utilities/extensions/dart_type.dart
  • M pkg/analysis_server/test/src/services/correction/fix/create_function_test.dart
  • M pkg/analysis_server/test/src/services/correction/fix/create_method_test.dart
  • M pkg/analysis_server/test/src/services/correction/fix/create_operator_test.dart
  • M pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart
  • A pkg/analysis_server_plugin/lib/src/utilities/extensions/dart_type.dart
  • M pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
  • M pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart
Change size: XL
Delta: 12 files changed, 1074 insertions(+), 90 deletions(-)
Open in Gerrit

Related details

Attention set is empty
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: newchange
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Dec 8, 2025, 9:38:42 AM12/8/25
to Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted and added 1 comment

Votes added by Felipe Morschel

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Felipe Morschel . resolved

Only marked as WIP because I'd prefer to land https://dart-review.googlesource.com/c/sdk/+/459521 first. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Samuel Rawlins
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 2
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Mon, 08 Dec 2025 14:38:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Dec 10, 2025, 3:46:31 PM12/10/25
to Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Samuel Rawlins
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 3
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Wed, 10 Dec 2025 20:46:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Jan 6, 2026, 9:38:46 AMJan 6
to Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted and added 1 comment

Votes added by Felipe Morschel

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 3:
Felipe Morschel . resolved

I've rebased this.

Can I get reviews here please? CC @brianwi...@google.com and @sraw...@google.com. Thanks a lot!

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Samuel Rawlins
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 3
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Tue, 06 Jan 2026 14:38:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Jan 6, 2026, 12:50:52 PMJan 6
to Felipe Morschel, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Samuel Rawlins voted and added 3 comments

Votes added by Samuel Rawlins

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Samuel Rawlins . resolved

Quick scan for first review

File pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
Line 98, Patchset 4 (Latest): List<TypeParameterElement>? typeParametersList;
Samuel Rawlins . unresolved

Can this be

```
var typeParametersList = typeParametersSet?.toList();
```

File pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
Line 341, Patchset 4 (Latest): bool onSameLine(int offset1, int offset2) {
Samuel Rawlins . unresolved

This could be a proper method on LineInfo. I grepped around and found some other possible cases. And it would be nice to factor a few changes out from this large CL 😄


```
git grep 'lineNumber.*==' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

```
git grep '==.*lineNumber' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Felipe Morschel
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 4
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Tue, 06 Jan 2026 17:50:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Jan 6, 2026, 2:11:03 PMJan 6
to Commit Queue, Samuel Rawlins, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted and added 1 comment

Votes added by Felipe Morschel

Auto-Submit+1

1 comment

File pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
Line 341, Patchset 4 (Latest): bool onSameLine(int offset1, int offset2) {
Samuel Rawlins . unresolved

This could be a proper method on LineInfo. I grepped around and found some other possible cases. And it would be nice to factor a few changes out from this large CL 😄


```
git grep 'lineNumber.*==' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

```
git grep '==.*lineNumber' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

Felipe Morschel

Great idea! Here it is the new CL. I'll come back to this one once that one lands https://dart-review.googlesource.com/c/sdk/+/471061.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Samuel Rawlins
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 4
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Tue, 06 Jan 2026 19:11:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Jan 8, 2026, 7:35:03 AMJan 8
to Commit Queue, Samuel Rawlins, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted and added 3 comments

Votes added by Felipe Morschel

Auto-Submit+1

3 comments

Patchset-level comments
File-level comment, Patchset 4:
Felipe Morschel . resolved

Patchset 5 is related to the changes Sam requested and patchset 6 is generating `api.txt` to fix the broken tests.

File pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
Line 98, Patchset 4: List<TypeParameterElement>? typeParametersList;
Samuel Rawlins . resolved

Can this be

```
var typeParametersList = typeParametersSet?.toList();
```

Felipe Morschel

Yes, thanks! I think I was originally doing more work there but not anymore. Great catch!

File pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
Line 341, Patchset 4: bool onSameLine(int offset1, int offset2) {
Samuel Rawlins . resolved

This could be a proper method on LineInfo. I grepped around and found some other possible cases. And it would be nice to factor a few changes out from this large CL 😄


```
git grep 'lineNumber.*==' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

```
git grep '==.*lineNumber' pkg/{analysis_server,analyzer_plugin,analysis_server_plugin,linter,analyzer}
```

Felipe Morschel

Great idea! Here it is the new CL. I'll come back to this one once that one lands https://dart-review.googlesource.com/c/sdk/+/471061.

Felipe Morschel

That CL has landed.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Samuel Rawlins
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: I9d8a2f9169c596236430d5c33ab24013cd52238a
Gerrit-Change-Number: 466760
Gerrit-PatchSet: 4
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 08 Jan 2026 12:34:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages