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

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

Issue 1362353003: suggest argument name completions for annotations - fixes #24296 and fixes #24259 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/arglist_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/arglist_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
index 61194fc03c32c075c2227fbd779ae2354943229d..4f7780d5f2626643deeb2d90b3587591cbc284c4 100644
--- a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
@@ -141,23 +141,20 @@ class _ArgListAstVisitor extends GeneralizingAstVisitor<_ArgSuggestionBuilder> {
}
}
}
- if (parent is InstanceCreationExpression) {
- ConstructorName constructorName = parent.constructorName;
- if (constructorName != null) {
- String name = constructorName.toSource();
- if (name.length > 0) {
- /*
- * If a local declaration is found, then return null
- * indicating that suggestions were added
- * and no further action is necessary
- */
- if (new _LocalArgSuggestionBuilder(request, request.offset, name)
- .visit(node)) {
- return null;
- }
- return new _ArgSuggestionBuilder(request, name);
- }
+ String constructorName;
+ if (parent is Annotation && parent.name != null) {
+ constructorName = parent.name.toSource();
+ }
+ if (parent is InstanceCreationExpression &&
+ parent.constructorName != null) {
+ constructorName = parent.constructorName.toSource();
+ }
+ if (constructorName != null && constructorName.length > 0) {
+ if (new _LocalArgSuggestionBuilder(
+ request, request.offset, constructorName).visit(node)) {
+ return null;
}
+ return new _ArgSuggestionBuilder(request, constructorName);
}
}
return null;
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/arglist_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698