Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart

Issue 1907723002: Code completion bug fix, don't suggest optional field formal parameters that are already in the con… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase with master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
index 43514fb64d8f1928f229529ffd3973ba7b411da2..62bda0c5dd23abceb3241efb4a460354cc5fe0aa 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
@@ -36,6 +36,10 @@ class FieldFormalContributor extends DartCompletionContributor {
// Compute the list of fields already referenced in the constructor
List<String> referencedFields = new List<String>();
for (FormalParameter param in constructorDecl.parameters.parameters) {
+ if (param is DefaultFormalParameter &&
+ param.parameter is FieldFormalParameter) {
+ param = (param as DefaultFormalParameter).parameter;
+ }
if (param is FieldFormalParameter) {
SimpleIdentifier fieldId = param.identifier;
if (fieldId != null && fieldId != request.target.entity) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698