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

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

Issue 2986133002: Suggest covariant in parameter lists (Closed)
Patch Set: Created 3 years, 5 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/keyword_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/keyword_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
index 64caca0ebccb0da793e6555d3ccbed4185b1359f..433ea389aebb916f58442e851f01ff0b9b157fbe 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
@@ -253,6 +253,14 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
if (constructorDeclaration != null) {
_addSuggestions([Keyword.THIS]);
}
+ if (entity is Token && (entity as Token).type == TokenType.CLOSE_PAREN) {
+ _addSuggestion(Keyword.COVARIANT);
+ } else if (entity is FormalParameter) {
+ Token beginToken = (entity as FormalParameter).beginToken;
+ if (beginToken != null && request.target.offset == beginToken.end) {
+ _addSuggestion(Keyword.COVARIANT);
+ }
+ }
}
@override
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698