[M] Change in dart/sdk[main]: [DAS] Fixes completion for dot-shorthand in FutureOr<T> and for switches

0 views
Skip to first unread message

Felipe Morschel (Gerrit)

unread,
Oct 30, 2025, 8:49:53 PM (2 days ago) Oct 30
to dart-analys...@google.com, rev...@dartlang.org

Felipe Morschel has uploaded the change for review

Commit message

[DAS] Fixes completion for dot-shorthand in FutureOr<T> and for switches
Change-Id: Ie3cfab513b409f7c12d5d920839a4d9076172580

Change information

Files:
  • M pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
  • M pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
  • M pkg/analysis_server/test/services/completion/dart/location/dot_shorthand_property_access_test.dart
  • M pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart
Change size: M
Delta: 4 files changed, 222 insertions(+), 3 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: Ie3cfab513b409f7c12d5d920839a4d9076172580
Gerrit-Change-Number: 458740
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,
Oct 30, 2025, 8:51:24 PM (2 days ago) Oct 30
to Kallen Tu, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Kallen Tu and Keerti Parthasarathy

Felipe Morschel added 1 comment

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

Feel free to replace the reviewers, just a suggestion.

Open in Gerrit

Related details

Attention is currently required from:
  • Kallen Tu
  • Keerti Parthasarathy
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: Ie3cfab513b409f7c12d5d920839a4d9076172580
Gerrit-Change-Number: 458740
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Kallen Tu <kall...@google.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Fri, 31 Oct 2025 00:51:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Kallen Tu (Gerrit)

unread,
Oct 31, 2025, 1:29:18 PM (2 days ago) Oct 31
to Felipe Morschel, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel and Keerti Parthasarathy

Kallen Tu voted and added 3 comments

Votes added by Kallen Tu

Code-Review+1

3 comments

File pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
Line 4093, Patchset 1 (Latest): if (contextType != null && (contextType.isDartAsyncFutureOr)) {
Kallen Tu . unresolved

Nit: Remove the extra parens

Line 4094, Patchset 1 (Latest): return (contextType as InterfaceType).typeArguments.firstOrNull;
Kallen Tu . unresolved

Could we use the if to promote the `contextType` to an `InterfaceType`? I think it would just replace the null check anyways. Just so we don't have to cast.

File pkg/analysis_server/test/services/completion/dart/location/dot_shorthand_property_access_test.dart
Line 168, Patchset 1 (Latest): Future<void> test_enum_functionExpression_futureOr() async {
Kallen Tu . unresolved

Can you also make some tests for classes and extension types? Just to make extra sure that they work too.

Open in Gerrit

Related details

Attention is currently required from:
  • Felipe Morschel
  • Keerti Parthasarathy
Submit Requirements:
    • requirement is not 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: Ie3cfab513b409f7c12d5d920839a4d9076172580
    Gerrit-Change-Number: 458740
    Gerrit-PatchSet: 1
    Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Comment-Date: Fri, 31 Oct 2025 17:29:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    Oct 31, 2025, 1:37:11 PM (2 days ago) Oct 31
    to Felipe Morschel, Brian Wilkerson, Kallen Tu, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Felipe Morschel and Keerti Parthasarathy

    Brian Wilkerson voted and added 1 comment

    Votes added by Brian Wilkerson

    Code-Review+1

    1 comment

    Patchset-level comments
    Brian Wilkerson . resolved

    lgtm, once Kallen's comments are addressed.

    Kallen: do we want to try to get this cherry picked? It might have a significant impact on the usability of the feature.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Felipe Morschel
    • Keerti Parthasarathy
    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: Ie3cfab513b409f7c12d5d920839a4d9076172580
    Gerrit-Change-Number: 458740
    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: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Comment-Date: Fri, 31 Oct 2025 17:37:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Kallen Tu (Gerrit)

    unread,
    Oct 31, 2025, 1:38:59 PM (2 days ago) Oct 31
    to Felipe Morschel, Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Felipe Morschel and Keerti Parthasarathy

    Kallen Tu added 1 comment

    Patchset-level comments
    Brian Wilkerson . resolved

    lgtm, once Kallen's comments are addressed.

    Kallen: do we want to try to get this cherry picked? It might have a significant impact on the usability of the feature.

    Kallen Tu

    Yep, definitely. Any fixes with completion, I want to make sure we get in before the release. I'll work on making that CP once this is submitted (and I fix the other case too

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Felipe Morschel
    • Keerti Parthasarathy
    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: Ie3cfab513b409f7c12d5d920839a4d9076172580
    Gerrit-Change-Number: 458740
    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: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Comment-Date: Fri, 31 Oct 2025 17:38:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
    satisfied_requirement
    open
    diffy

    Felipe Morschel (Gerrit)

    unread,
    Oct 31, 2025, 2:02:59 PM (2 days ago) Oct 31
    to Brian Wilkerson, Kallen Tu, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson and Kallen Tu

    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 4093, Patchset 1: if (contextType != null && (contextType.isDartAsyncFutureOr)) {
    Kallen Tu . resolved

    Nit: Remove the extra parens

    Felipe Morschel

    Done

    Line 4094, Patchset 1: return (contextType as InterfaceType).typeArguments.firstOrNull;
    Kallen Tu . resolved

    Could we use the if to promote the `contextType` to an `InterfaceType`? I think it would just replace the null check anyways. Just so we don't have to cast.

    Felipe Morschel

    Great idea! I'd just copied from above.

    File pkg/analysis_server/test/services/completion/dart/location/dot_shorthand_property_access_test.dart
    Line 168, Patchset 1: Future<void> test_enum_functionExpression_futureOr() async {
    Kallen Tu . unresolved

    Can you also make some tests for classes and extension types? Just to make extra sure that they work too.

    Felipe Morschel

    Are these enough? Or do you want something more?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Kallen Tu
    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: Ie3cfab513b409f7c12d5d920839a4d9076172580
      Gerrit-Change-Number: 458740
      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: Kallen Tu <kall...@google.com>
      Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
      Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Attention: Kallen Tu <kall...@google.com>
      Gerrit-Comment-Date: Fri, 31 Oct 2025 18:02:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Kallen Tu <kall...@google.com>
      unsatisfied_requirement
      open
      diffy

      Kallen Tu (Gerrit)

      unread,
      Oct 31, 2025, 2:09:11 PM (2 days ago) Oct 31
      to Felipe Morschel, Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Brian Wilkerson and Felipe Morschel

      Kallen Tu voted and added 1 comment

      Votes added by Kallen Tu

      Code-Review+1

      1 comment

      File pkg/analysis_server/test/services/completion/dart/location/dot_shorthand_property_access_test.dart
      Line 168, Patchset 1: Future<void> test_enum_functionExpression_futureOr() async {
      Kallen Tu . resolved

      Can you also make some tests for classes and extension types? Just to make extra sure that they work too.

      Felipe Morschel

      Are these enough? Or do you want something more?

      Kallen Tu

      These are great, thank you.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Brian Wilkerson
      • Felipe Morschel
      Submit Requirements:
        • requirement is not 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: Ie3cfab513b409f7c12d5d920839a4d9076172580
        Gerrit-Change-Number: 458740
        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: Kallen Tu <kall...@google.com>
        Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
        Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Comment-Date: Fri, 31 Oct 2025 18:09:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Kallen Tu <kall...@google.com>
        Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Brian Wilkerson (Gerrit)

        unread,
        Oct 31, 2025, 2:42:30 PM (2 days ago) Oct 31
        to Felipe Morschel, Brian Wilkerson, Kallen Tu, Keerti Parthasarathy, 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: Ie3cfab513b409f7c12d5d920839a4d9076172580
        Gerrit-Change-Number: 458740
        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: Kallen Tu <kall...@google.com>
        Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
        Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Comment-Date: Fri, 31 Oct 2025 18:42:27 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Commit Queue (Gerrit)

        unread,
        Oct 31, 2025, 3:11:29 PM (2 days ago) Oct 31
        to Felipe Morschel, Brian Wilkerson, Kallen Tu, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org

        Commit Queue submitted the change

        Change information

        Commit message:
        [DAS] Fixes completion for dot-shorthand in FutureOr<T> and for switches
        Change-Id: Ie3cfab513b409f7c12d5d920839a4d9076172580
        Reviewed-by: Brian Wilkerson <brianwi...@google.com>
        Commit-Queue: Brian Wilkerson <brianwi...@google.com>
        Auto-Submit: Felipe Morschel <g...@fmorschel.dev>
        Reviewed-by: Kallen Tu <kall...@google.com>
        Files:
        • M pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
        • M pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
        • M pkg/analysis_server/test/services/completion/dart/location/dot_shorthand_property_access_test.dart
        • M pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart
        Change size: L
        Delta: 4 files changed, 294 insertions(+), 3 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: Ie3cfab513b409f7c12d5d920839a4d9076172580
        Gerrit-Change-Number: 458740
        Gerrit-PatchSet: 3
        Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages