[M] Change in dart/sdk[main]: [analyzer] Fixes SearchEngine for dot shorthand constructor references

0 views
Skip to first unread message

Felipe Morschel (Gerrit)

unread,
Dec 10, 2025, 12:34:30 PM12/10/25
to dart-analys...@google.com, rev...@dartlang.org

Felipe Morschel has uploaded the change for review

Commit message

[analyzer] Fixes SearchEngine for dot shorthand constructor references
Change-Id: Ief472f2ea65e64a45a0fff9bed85a611918b30d9

Change information

Files:
  • M pkg/analysis_server/test/lsp/references_test.dart
  • M pkg/analysis_server/test/services/refactoring/legacy/rename_class_member_test.dart
  • M pkg/analysis_server/test/services/refactoring/legacy/rename_constructor_test.dart
  • M pkg/analysis_server/test/services/search/search_engine_test.dart
  • M pkg/analyzer/lib/src/dart/analysis/search.dart
Change size: M
Delta: 5 files changed, 230 insertions(+), 0 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
Gerrit-Change-Number: 467382
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 10, 2025, 12:38:20 PM12/10/25
to Samuel Rawlins, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Paul Berry and Samuel Rawlins

Felipe Morschel added 1 comment

File pkg/analyzer/lib/src/dart/analysis/search.dart
Line 673, Patchset 1 (Latest): files.addAll(await _driver.getFilesReferencingName(shortHandName));
Felipe Morschel . unresolved

I'm not sure this is fine as I implemented or if I should make this an optional parameter or something.
WDYT @paul...@google.com?

Open in Gerrit

Related details

Attention is currently required from:
  • Paul Berry
  • 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
Gerrit-Change-Number: 467382
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Kallen Tu <kall...@google.com>
Gerrit-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Wed, 10 Dec 2025 17:38:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Dec 10, 2025, 1:00:10 PM12/10/25
to Felipe Morschel, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Felipe Morschel and Paul Berry

Samuel Rawlins voted and added 1 comment

Votes added by Samuel Rawlins

Code-Review+1

1 comment

File pkg/analyzer/lib/src/dart/analysis/search.dart
Line 628, Patchset 1 (Latest): String? shortHandName;
Samuel Rawlins . unresolved

A nit, but I think we're using "shorthand" as one word, not camelcase, "shortHand"

Open in Gerrit

Related details

Attention is currently required from:
  • Felipe Morschel
  • Paul Berry
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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
    Gerrit-Change-Number: 467382
    Gerrit-PatchSet: 1
    Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
    Gerrit-CC: Kallen Tu <kall...@google.com>
    Gerrit-Attention: Paul Berry <paul...@google.com>
    Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 18:00:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Felipe Morschel (Gerrit)

    unread,
    Dec 10, 2025, 1:01:42 PM12/10/25
    to Samuel Rawlins, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Paul Berry and Samuel Rawlins

    Felipe Morschel voted and added 1 comment

    Votes added by Felipe Morschel

    Auto-Submit+1

    1 comment

    File pkg/analyzer/lib/src/dart/analysis/search.dart
    Line 628, Patchset 1: String? shortHandName;
    Samuel Rawlins . resolved

    A nit, but I think we're using "shorthand" as one word, not camelcase, "shortHand"

    Felipe Morschel

    Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Paul Berry
    • 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
      Gerrit-Change-Number: 467382
      Gerrit-PatchSet: 2
      Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
      Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
      Gerrit-Reviewer: Paul Berry <paul...@google.com>
      Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
      Gerrit-CC: Kallen Tu <kall...@google.com>
      Gerrit-Attention: Paul Berry <paul...@google.com>
      Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
      Gerrit-Comment-Date: Wed, 10 Dec 2025 18:01:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
      unsatisfied_requirement
      open
      diffy

      Samuel Rawlins (Gerrit)

      unread,
      Dec 10, 2025, 1:06:01 PM12/10/25
      to Felipe Morschel, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Felipe Morschel and Paul Berry

      Samuel Rawlins voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Felipe Morschel
      • Paul Berry
      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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
        Gerrit-Change-Number: 467382
        Gerrit-PatchSet: 2
        Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Reviewer: Paul Berry <paul...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-CC: Kallen Tu <kall...@google.com>
        Gerrit-Attention: Paul Berry <paul...@google.com>
        Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
        Gerrit-Comment-Date: Wed, 10 Dec 2025 18:05:58 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Felipe Morschel (Gerrit)

        unread,
        Dec 10, 2025, 3:21:44 PM12/10/25
        to Commit Queue, Samuel Rawlins, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Paul Berry 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:
        Felipe Morschel . resolved

        Fixed the implementation for the broken tests. The problem was that we had an example where both the class name _and_ the constructor name were referenced, so the file was verified twice.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Paul Berry
        • 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
          Gerrit-Change-Number: 467382
          Gerrit-PatchSet: 2
          Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Paul Berry <paul...@google.com>
          Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
          Gerrit-CC: Kallen Tu <kall...@google.com>
          Gerrit-Attention: Paul Berry <paul...@google.com>
          Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
          Gerrit-Comment-Date: Wed, 10 Dec 2025 20:21:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          open
          diffy

          Felipe Morschel (Gerrit)

          unread,
          Jan 12, 2026, 12:00:40 PMJan 12
          to Commit Queue, Samuel Rawlins, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
          Attention needed from Paul Berry and Samuel Rawlins

          Felipe Morschel voted and added 1 comment

          Votes added by Felipe Morschel

          Auto-Submit+1

          1 comment

          File pkg/analyzer/lib/src/dart/analysis/search.dart
          Line 673, Patchset 1: files.addAll(await _driver.getFilesReferencingName(shortHandName));
          Felipe Morschel . resolved

          I'm not sure this is fine as I implemented or if I should make this an optional parameter or something.
          WDYT @paul...@google.com?

          Felipe Morschel

          I've decided on an optional parameter since then this doesn't need to revisit all files again a second time.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Paul Berry
          • 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
          Gerrit-Change-Number: 467382
          Gerrit-PatchSet: 3
          Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Paul Berry <paul...@google.com>
          Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
          Gerrit-CC: Kallen Tu <kall...@google.com>
          Gerrit-Attention: Paul Berry <paul...@google.com>
          Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
          Gerrit-Comment-Date: Mon, 12 Jan 2026 17:00:36 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
          unsatisfied_requirement
          open
          diffy

          Felipe Morschel (Gerrit)

          unread,
          Jan 12, 2026, 12:45:58 PMJan 12
          to Commit Queue, Samuel Rawlins, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
          Attention needed from Paul Berry 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 4:
          Felipe Morschel . resolved

          Small note, I did some testing and this also fixes the main issue raised at https://github.com/dart-lang/sdk/issues/55348 (there is still a problem but I'll note it there and create a different CL for it). I've added a test-case for it and mentioned at the CL description.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Paul Berry
          • 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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
          Gerrit-Change-Number: 467382
          Gerrit-PatchSet: 6
          Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
          Gerrit-Reviewer: Paul Berry <paul...@google.com>
          Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
          Gerrit-CC: Kallen Tu <kall...@google.com>
          Gerrit-Attention: Paul Berry <paul...@google.com>
          Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
          Gerrit-Comment-Date: Mon, 12 Jan 2026 17:45:55 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          open
          diffy

          Samuel Rawlins (Gerrit)

          unread,
          Jan 12, 2026, 1:01:05 PMJan 12
          to Felipe Morschel, Commit Queue, Paul Berry, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
          Attention needed from Felipe Morschel and Paul Berry

          Samuel Rawlins voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Felipe Morschel
          • Paul Berry
          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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
            Gerrit-Change-Number: 467382
            Gerrit-PatchSet: 6
            Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
            Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
            Gerrit-Reviewer: Paul Berry <paul...@google.com>
            Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
            Gerrit-CC: Kallen Tu <kall...@google.com>
            Gerrit-Attention: Paul Berry <paul...@google.com>
            Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
            Gerrit-Comment-Date: Mon, 12 Jan 2026 18:01:00 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy

            Felipe Morschel (Gerrit)

            unread,
            Jan 12, 2026, 1:56:00 PMJan 12
            to Konstantin Shcheglov, Samuel Rawlins, Commit Queue, Kallen Tu, dart-analys...@google.com, rev...@dartlang.org
            Attention needed from Konstantin Shcheglov

            Felipe Morschel added 1 comment

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

            Given that Paul didn't answer here, I'm replacing him with @sche...@google.com since this is very similar to https://dart-review.googlesource.com/c/sdk/+/472360 which just landed.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Konstantin Shcheglov
            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: Ief472f2ea65e64a45a0fff9bed85a611918b30d9
            Gerrit-Change-Number: 467382
            Gerrit-PatchSet: 6
            Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
            Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
            Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
            Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
            Gerrit-CC: Kallen Tu <kall...@google.com>
            Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
            Gerrit-Comment-Date: Mon, 12 Jan 2026 18:55:55 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages