[XL] Change in dart/sdk[main]: [DAS] Adds completion option for some shadowed names

1 view
Skip to first unread message

FMorschel (Gerrit)

unread,
Jul 29, 2026, 9:58:44 AM (7 days ago) Jul 29
to dart-analys...@google.com, rev...@dartlang.org

FMorschel has uploaded the change for review

Commit message

[DAS] Adds completion option for some shadowed names
Change-Id: I36480aec9330260673c9aca3a1bb22bdd7be5694

Change information

Files:
  • M pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
  • M pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart
  • M pkg/analysis_server/lib/src/services/completion/dart/not_imported_completion_pass.dart
  • M pkg/analysis_server/lib/src/services/completion/dart/visibility_tracker.dart
  • M pkg/analysis_server/test/client/completion_driver_test.dart
  • M pkg/analysis_server/test/lsp/completion_dart_test.dart
  • A pkg/analysis_server/test/services/completion/dart/visibility/scope_shadow_test.dart
  • M pkg/analysis_server/test/services/completion/dart/visibility/test_all.dart
Change size: XL
Delta: 8 files changed, 1022 insertions(+), 122 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: I36480aec9330260673c9aca3a1bb22bdd7be5694
Gerrit-Change-Number: 528900
Gerrit-PatchSet: 1
Gerrit-Owner: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: FMorschel <g...@fmorschel.dev>
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Aug 4, 2026, 6:02:42 PM (yesterday) Aug 4
to FMorschel, Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from FMorschel and Keerti Parthasarathy

Brian Wilkerson voted and added 2 comments

Votes added by Brian Wilkerson

Code-Review+1
Commit-Queue+1

2 comments

File pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
Line 486, Patchset 1 (Latest): '$_enclosingPrefix$qualifier${element.displayName}';
Brian Wilkerson . unresolved

It's an error if both of these are non-empty strings (both here and on line 1136).

Consider adding an assert to ensure that `withEnclosingName` is never `true` when `qualifier` is non-empty. Or consider having two constructors, one that takes `withEnclosingName` and one that takes `qualifier`.

File pkg/analysis_server/test/services/completion/dart/visibility/scope_shadow_test.dart
Line 65, Patchset 1 (Latest): this?.call
Brian Wilkerson . resolved

While technically correct, this is confusing. For the test we can tell the difference because you made them different kinds (thank you!). But for users I'm a bit concerned that it might be hard to tell them apart. I don't know what to do about it, but wanted to mention it.

Open in Gerrit

Related details

Attention is currently required from:
  • FMorschel
  • Keerti Parthasarathy
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: I36480aec9330260673c9aca3a1bb22bdd7be5694
Gerrit-Change-Number: 528900
Gerrit-PatchSet: 1
Gerrit-Owner: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: FMorschel <g...@fmorschel.dev>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 04 Aug 2026 22:02:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

FMorschel (Gerrit)

unread,
Aug 4, 2026, 11:02:44 PM (20 hours ago) Aug 4
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Keerti Parthasarathy

FMorschel voted and added 2 comments

Votes added by FMorschel

Auto-Submit+1

2 comments

File pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
Line 486, Patchset 1: '$_enclosingPrefix$qualifier${element.displayName}';
Brian Wilkerson . resolved

It's an error if both of these are non-empty strings (both here and on line 1136).

Consider adding an assert to ensure that `withEnclosingName` is never `true` when `qualifier` is non-empty. Or consider having two constructors, one that takes `withEnclosingName` and one that takes `qualifier`.

FMorschel

I've done a small refactor around the constructors for members here. So now they all have the same logic.

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

While technically correct, this is confusing. For the test we can tell the difference because you made them different kinds (thank you!). But for users I'm a bit concerned that it might be hard to tell them apart. I don't know what to do about it, but wanted to mention it.

FMorschel

Yes, I also thought so. Although I don't suspect this is really common, I just wanted to make sure we were covering this edge case correctly. I'm fine with removing the `this?.` option, but I think it would come up in so few cases that I think it's fine for us to tell users this is how their code is overlapping and could probably use a rename somewhere 😅.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • 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: I36480aec9330260673c9aca3a1bb22bdd7be5694
Gerrit-Change-Number: 528900
Gerrit-PatchSet: 1
Gerrit-Owner: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Wed, 05 Aug 2026 03:02:40 +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,
1:37 PM (5 hours ago) 1:37 PM
to FMorschel, Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from FMorschel and Keerti Parthasarathy

Brian Wilkerson voted

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

Related details

Attention is currently required from:
  • FMorschel
  • Keerti Parthasarathy
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: I36480aec9330260673c9aca3a1bb22bdd7be5694
Gerrit-Change-Number: 528900
Gerrit-PatchSet: 2
Gerrit-Owner: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: FMorschel <g...@fmorschel.dev>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: FMorschel <g...@fmorschel.dev>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Wed, 05 Aug 2026 17:37:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages