[M] Change in dart/sdk[main]: [DAS] Fixes regression in completion for unnamed parameters in closures

0 views
Skip to first unread message

Felipe Morschel (Gerrit)

unread,
Sep 17, 2025, 3:10:54 PMSep 17
to dart-analys...@google.com, rev...@dartlang.org

Felipe Morschel has uploaded the change for review

Commit message

[DAS] Fixes regression in completion for unnamed parameters in closures
Change-Id: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2

Change information

Files:
  • M pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
  • M pkg/analysis_server/lib/src/services/completion/dart/utilities.dart
  • M pkg/analysis_server/test/client/completion_driver_test.dart
  • M pkg/analysis_server/test/lsp/completion_dart_test.dart
  • M pkg/analysis_server/test/services/completion/dart/completion_test.dart
  • M pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart
  • M pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart
Change size: M
Delta: 7 files changed, 128 insertions(+), 22 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
Sep 17, 2025, 4:33:32 PMSep 17
to Felipe Morschel, Samuel Rawlins, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Felipe Morschel and Samuel Rawlins

Danny Tuppeny added 2 comments

File pkg/analysis_server/test/client/completion_driver_test.dart
Line 61, Patchset 1 (Latest): bool inlcudeDisplayText = false;
Danny Tuppeny . unresolved

nit: typo `inlcude`

Maybe also include a comment explaining what this does like the others.

Is this actually used (set) anywhere?

File pkg/analysis_server/test/lsp/completion_dart_test.dart
Line 1424, Patchset 1 (Latest): f((p1) => ^,);
Danny Tuppeny . unresolved

I think originally these would start at 0 instead of 1. I don't know if it matters, but if there is other code generating similar names that still start from 0, maybe this should be consistent?

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Felipe Morschel
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 1
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 20:33:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Sep 17, 2025, 7:11:05 PMSep 17
to Danny Tuppeny, Samuel Rawlins, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Danny Tuppeny and Samuel Rawlins

Felipe Morschel voted and added 2 comments

Votes added by Felipe Morschel

Auto-Submit+1

2 comments

File pkg/analysis_server/test/client/completion_driver_test.dart
Line 61, Patchset 1: bool inlcudeDisplayText = false;
Danny Tuppeny . resolved

nit: typo `inlcude`

Maybe also include a comment explaining what this does like the others.

Is this actually used (set) anywhere?

Felipe Morschel

I'll remove this, I was testing this out but I found other tests that filled this role for this fix. Thanks! If anyone else wants to re add this in the future is simple enough to do so.

File pkg/analysis_server/test/lsp/completion_dart_test.dart
Line 1424, Patchset 1: f((p1) => ^,);
Danny Tuppeny . resolved

I think originally these would start at 0 instead of 1. I don't know if it matters, but if there is other code generating similar names that still start from 0, maybe this should be consistent?

Felipe Morschel

Oops, sorry. Fixed it. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Danny Tuppeny
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 1
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 23:11:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Sep 18, 2025, 11:58:45 AMSep 18
to Felipe Morschel, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Danny Tuppeny and Felipe Morschel

Samuel Rawlins voted and added 1 comment

Votes added by Samuel Rawlins

Code-Review+1
Commit-Queue+2

1 comment

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

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Danny Tuppeny
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 18 Sep 2025 15:58:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Sep 18, 2025, 1:52:18 PMSep 18
to Commit Queue, Samuel Rawlins, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Danny Tuppeny and Samuel Rawlins

Felipe Morschel voted and added 2 comments

Votes added by Felipe Morschel

Auto-Submit+1

2 comments

File pkg/analysis_server/test/lsp/completion.dart
Line 17, Patchset 3 (Latest): (item1.sortText == item2.sortText)
Felipe Morschel . resolved

This ensures that when two completions have the same priority (as the ones presented by the new LSP test) then we sort them by the text we show to the user.

File pkg/analysis_server/test/lsp/completion_yaml_test.dart
Line 533, Patchset 3 (Latest): expectCompletions: ['^2.1.0', '^2.3.4'],
Felipe Morschel . resolved

Necessary after the change at `pkg/analysis_server/test/lsp/completion.dart`

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Danny Tuppeny
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 17:52:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Sep 18, 2025, 2:02:11 PMSep 18
to Felipe Morschel, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Danny Tuppeny and Felipe Morschel

Samuel Rawlins voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Danny Tuppeny
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 18 Sep 2025 18:02:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
Sep 18, 2025, 2:49:40 PMSep 18
to Felipe Morschel, Samuel Rawlins, Commit Queue, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Danny Tuppeny added 1 comment

File pkg/analysis_server/test/lsp/completion.dart
Line 17, Patchset 3 (Latest): (item1.sortText == item2.sortText)
Felipe Morschel . resolved

This ensures that when two completions have the same priority (as the ones presented by the new LSP test) then we sort them by the text we show to the user.

Danny Tuppeny

Do we want this? If I understand correctly, this isn't sorting what the user sees, it's just sorting what the tests look at. I think it would be best if tests could assert the ordering of the returned items even when the sort text is the same - I'm not sure what the advantage of doing this here is.

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 18 Sep 2025 18:49:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Sep 18, 2025, 2:58:06 PMSep 18
to Samuel Rawlins, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Danny Tuppeny

Felipe Morschel added 1 comment

File pkg/analysis_server/test/lsp/completion.dart
Line 17, Patchset 3 (Latest): (item1.sortText == item2.sortText)
Felipe Morschel . resolved

This ensures that when two completions have the same priority (as the ones presented by the new LSP test) then we sort them by the text we show to the user.

Danny Tuppeny

Do we want this? If I understand correctly, this isn't sorting what the user sees, it's just sorting what the tests look at. I think it would be best if tests could assert the ordering of the returned items even when the sort text is the same - I'm not sure what the advantage of doing this here is.

Felipe Morschel

I'm not sure we could handle how the clients sort the text after `sortText` sorting (which we expect them to but obviously could be ignored).

The latest [failing bot](https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8703375698794674353/+/u/test_results/new_test_failures__logs_) showed an error at `pkg/analysis_server/test/lsp/completion_dart_test.dart:1341` with the sorting being different than what I wrote. But locally, if I swapped them I got the error and this way I didn't (not sure why).

But the thing is, I don't expect this difference to be relevant to the users considering the clients use at least `sortText`. If we wan't to be sure, then we probably need to enhance that value for the cases I had to change here (that and related tests and at `pkg/analysis_server/test/lsp/completion_yaml_test.dart`). I don't see any real value between sorting them "better" to the end user at this point, but of course I could be wrong.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 18:58:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
satisfied_requirement
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
Sep 18, 2025, 3:06:50 PMSep 18
to Felipe Morschel, Samuel Rawlins, Commit Queue, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Danny Tuppeny added 1 comment

File pkg/analysis_server/test/lsp/completion.dart
Line 17, Patchset 3 (Latest): (item1.sortText == item2.sortText)
Felipe Morschel . resolved

This ensures that when two completions have the same priority (as the ones presented by the new LSP test) then we sort them by the text we show to the user.

Danny Tuppeny

Do we want this? If I understand correctly, this isn't sorting what the user sees, it's just sorting what the tests look at. I think it would be best if tests could assert the ordering of the returned items even when the sort text is the same - I'm not sure what the advantage of doing this here is.

Felipe Morschel

I'm not sure we could handle how the clients sort the text after `sortText` sorting (which we expect them to but obviously could be ignored).

The latest [failing bot](https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8703375698794674353/+/u/test_results/new_test_failures__logs_) showed an error at `pkg/analysis_server/test/lsp/completion_dart_test.dart:1341` with the sorting being different than what I wrote. But locally, if I swapped them I got the error and this way I didn't (not sure why).

But the thing is, I don't expect this difference to be relevant to the users considering the clients use at least `sortText`. If we wan't to be sure, then we probably need to enhance that value for the cases I had to change here (that and related tests and at `pkg/analysis_server/test/lsp/completion_yaml_test.dart`). I don't see any real value between sorting them "better" to the end user at this point, but of course I could be wrong.

Danny Tuppeny

Odd, I would expect the sorting to be deterministic. I'd be interested to understand why it was different for you, but I don't think it's worth holding this fix up.

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 18 Sep 2025 19:06:44 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
Sep 22, 2025, 7:02:21 AMSep 22
to Felipe Morschel, Samuel Rawlins, Commit Queue, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Danny Tuppeny added 1 comment

File pkg/analysis_server/test/lsp/completion.dart
Line 17, Patchset 3 (Latest): (item1.sortText == item2.sortText)
Felipe Morschel . resolved

This ensures that when two completions have the same priority (as the ones presented by the new LSP test) then we sort them by the text we show to the user.

Danny Tuppeny

Do we want this? If I understand correctly, this isn't sorting what the user sees, it's just sorting what the tests look at. I think it would be best if tests could assert the ordering of the returned items even when the sort text is the same - I'm not sure what the advantage of doing this here is.

Felipe Morschel

I'm not sure we could handle how the clients sort the text after `sortText` sorting (which we expect them to but obviously could be ignored).

The latest [failing bot](https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8703375698794674353/+/u/test_results/new_test_failures__logs_) showed an error at `pkg/analysis_server/test/lsp/completion_dart_test.dart:1341` with the sorting being different than what I wrote. But locally, if I swapped them I got the error and this way I didn't (not sure why).

But the thing is, I don't expect this difference to be relevant to the users considering the clients use at least `sortText`. If we wan't to be sure, then we probably need to enhance that value for the cases I had to change here (that and related tests and at `pkg/analysis_server/test/lsp/completion_yaml_test.dart`). I don't see any real value between sorting them "better" to the end user at this point, but of course I could be wrong.

Danny Tuppeny

Odd, I would expect the sorting to be deterministic. I'd be interested to understand why it was different for you, but I don't think it's worth holding this fix up.

Danny Tuppeny

I had a quick look but couldn't explain why the sort would differ - for me it seemed to always come out as the server set it if the `sortText`s are the same (including if I flipped `_addClosureSuggestion` to put the `=>` version first).

However, the sort we use in the handler doesn't appear to be stable, so it's not guaranteed to be the same and we probably shouldn't have the tests depend on it, so I think this change probably makes sense (either that, or making it stable in the handler, but since the client is going to re-sort and may be unstable, that's probably not worth it).

Gerrit-Comment-Date: Mon, 22 Sep 2025 11:02:13 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Sep 22, 2025, 7:11:34 PMSep 22
to Felipe Morschel, Samuel Rawlins, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel

Brian Wilkerson added 1 comment

File pkg/analysis_server/test/services/completion/dart/completion_test.dart
Line 5921, Patchset 3 (Parent): switch
Brian Wilkerson . unresolved
I can't think of any reasonable use for `true`, `false`, or `const`, but `null` should be included if the parameter is nullable (and I think it won't be, so please add the following as a test, but without the comment):
```dart
typedef void callback(int k);
void x(callback? q){}
void r() {
callback v;
x(^); // null is valid here
}
```
and I can see a use case for a `switch` expression, so that should be offered
```dart
typedef void callback(int k);
void x(callback q){}
void r(int i) {
callback u, v;
x(^); // could be
// switch (i) {
// < 0 => u,
// _ => v,
// }
}
```
Open in Gerrit

Related details

Attention is currently required from:
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Mon, 22 Sep 2025 23:11:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Sep 22, 2025, 10:36:28 PMSep 22
to Samuel Rawlins, Commit Queue, Danny Tuppeny, 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

File pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
Line 334, Patchset 4 (Latest): // TODO(FMorschel): Determine if the expected type is bool and only
Felipe Morschel . resolved

I'll do this on a follow up CL since this might be a bigger change to the tests expected outputs.

Line 337, Patchset 4 (Latest): // TODO(FMorschel): Determine if the parameter type has a constant
Felipe Morschel . resolved

I'm not sure I can do that reliably yet but I'll look into it in another CL too.

File pkg/analysis_server/test/services/completion/dart/completion_test.dart
Brian Wilkerson . resolved
I can't think of any reasonable use for `true`, `false`, or `const`, but `null` should be included if the parameter is nullable (and I think it won't be, so please add the following as a test, but without the comment):
```dart
typedef void callback(int k);
void x(callback? q){}
void r() {
callback v;
x(^); // null is valid here
}
```
and I can see a use case for a `switch` expression, so that should be offered
```dart
typedef void callback(int k);
void x(callback q){}
void r(int i) {
callback u, v;
x(^); // could be
// switch (i) {
// < 0 => u,
// _ => v,
// }
}
```
Felipe Morschel

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Tue, 23 Sep 2025 02:36:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Sep 24, 2025, 1:50:17 PMSep 24
to Felipe Morschel, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Samuel Rawlins voted and added 1 comment

Votes added by Samuel Rawlins

Code-Review+1

1 comment

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

This looks great to me!

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Wed, 24 Sep 2025 17:50:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Sep 25, 2025, 5:49:44 PMSep 25
to Felipe Morschel, Samuel Rawlins, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel

Brian Wilkerson added 3 comments

Patchset-level comments
Brian Wilkerson . resolved

Sorry, I commented on this a while back, but appear to have forgotten to send my comments.

File pkg/analysis_server/test/services/completion/dart/completion_test.dart
Line 6794, Patchset 3: null
Brian Wilkerson . unresolved

`null` is a reasonable suggestion. The parameter has type `dynamic`, which is nullable even though it doesn't have a `?` after it.

Line 9875, Patchset 3: null
Brian Wilkerson . unresolved

Ditto: the parameter is nullable because it's `dynamic`.

Open in Gerrit

Related details

Attention is currently required from:
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 25 Sep 2025 21:49:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Sep 25, 2025, 11:38:29 PMSep 25
to Samuel Rawlins, Commit Queue, Danny Tuppeny, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Samuel Rawlins

Felipe Morschel voted and added 2 comments

Votes added by Felipe Morschel

Auto-Submit+1

2 comments

File pkg/analysis_server/test/services/completion/dart/completion_test.dart
Brian Wilkerson . resolved

`null` is a reasonable suggestion. The parameter has type `dynamic`, which is nullable even though it doesn't have a `?` after it.

Felipe Morschel

Done

Brian Wilkerson . resolved

Ditto: the parameter is nullable because it's `dynamic`.

Felipe Morschel

Done

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 03:38:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Oct 28, 2025, 2:40:03 PM (4 days ago) Oct 28
to Felipe Morschel, Brian Wilkerson, Samuel Rawlins, Commit Queue, Danny Tuppeny, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel and Samuel Rawlins

Brian Wilkerson voted

Code-Review+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Felipe Morschel
  • 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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 6
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Tue, 28 Oct 2025 18:40:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Oct 28, 2025, 3:47:41 PM (4 days ago) Oct 28
to Brian Wilkerson, Samuel Rawlins, Commit Queue, Danny Tuppeny, 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 6:
Felipe Morschel . unresolved

I'm opening a comment here after also pinging you on the issue so you can find this either here or on GitHub.
@brianwi...@google.com @sraw...@google.com

Felipe Morschel

I had to rebase and refactor this a bit because of https://dart-review.googlesource.com/c/sdk/+/453041. We should be good now.

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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 6
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Tue, 28 Oct 2025 19:47:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Oct 28, 2025, 4:01:44 PM (4 days ago) Oct 28
to Felipe Morschel, Brian Wilkerson, Commit Queue, Danny Tuppeny, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Samuel Rawlins voted Code-Review+1

Code-Review+1
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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
Gerrit-Change-Number: 450180
Gerrit-PatchSet: 7
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-CC: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Tue, 28 Oct 2025 20:01:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Oct 28, 2025, 4:57:34 PM (4 days ago) Oct 28
to Felipe Morschel, Brian Wilkerson, Samuel Rawlins, Commit Queue, Danny Tuppeny, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel

Brian Wilkerson voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Felipe Morschel
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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
    Gerrit-Change-Number: 450180
    Gerrit-PatchSet: 7
    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-CC: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Comment-Date: Tue, 28 Oct 2025 20:57:30 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Commit Queue (Gerrit)

    unread,
    Oct 28, 2025, 4:57:44 PM (4 days ago) Oct 28
    to Felipe Morschel, Brian Wilkerson, Samuel Rawlins, Danny Tuppeny, dart-analys...@google.com, rev...@dartlang.org

    Commit Queue submitted the change

    Change information

    Commit message:
    [DAS] Fixes regression in completion for unnamed parameters in closures
    Change-Id: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
    Commit-Queue: Brian Wilkerson <brianwi...@google.com>
    Reviewed-by: Brian Wilkerson <brianwi...@google.com>
    Auto-Submit: Felipe Morschel <g...@fmorschel.dev>
    Reviewed-by: Samuel Rawlins <sraw...@google.com>
    Files:
    • M pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
    • M pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart
    • M pkg/analysis_server/lib/src/services/completion/dart/utilities.dart
    • M pkg/analysis_server/test/client/completion_driver_test.dart
    • M pkg/analysis_server/test/lsp/completion.dart
    • M pkg/analysis_server/test/lsp/completion_dart_test.dart
    • M pkg/analysis_server/test/lsp/completion_yaml_test.dart
    • M pkg/analysis_server/test/services/completion/dart/completion_test.dart
    • M pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart
    • M pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart
    • M pkg/analysis_server/test/services/completion/dart/location/function_invocation_test.dart
    Change size: M
    Delta: 11 files changed, 190 insertions(+), 29 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Samuel Rawlins, +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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
    Gerrit-Change-Number: 450180
    Gerrit-PatchSet: 8
    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-CC: Danny Tuppeny <da...@tuppeny.com>
    open
    diffy
    satisfied_requirement

    Felipe Morschel (Gerrit)

    unread,
    Oct 29, 2025, 6:31:00 PM (3 days ago) Oct 29
    to Commit Queue, Brian Wilkerson, Samuel Rawlins, Danny Tuppeny, dart-analys...@google.com, rev...@dartlang.org

    Felipe Morschel added 1 comment

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

    I'm opening a comment here after also pinging you on the issue so you can find this either here or on GitHub.
    @brianwi...@google.com @sraw...@google.com

    Felipe Morschel

    I had to rebase and refactor this a bit because of https://dart-review.googlesource.com/c/sdk/+/453041. We should be good now.

    Felipe Morschel

    Done

    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: Ia190a35188d2e9cf67fd7a6e75580cbcf2f9c6a2
    Gerrit-Change-Number: 450180
    Gerrit-PatchSet: 8
    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-CC: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 22:30:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages