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

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

Issue 2034713004: improve completions in closures and switch statements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 6 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/lib/src/services/completion/dart/optype.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 6b328b2a8f302203e893fe3adb8d1fd55d67ae10..5a8d8cbacf4ca3c93dde5a0f41d88f2da699b76c 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
@@ -77,6 +77,16 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
}
@override
+ visitAsExpression(AsExpression node) {
+ if (identical(entity, node.asOperator) &&
+ node.expression is ParenthesizedExpression) {
+ _addSuggestion2(ASYNC, relevance: DART_RELEVANCE_HIGH);
+ _addSuggestion2(ASYNC_STAR, relevance: DART_RELEVANCE_HIGH);
+ _addSuggestion2(SYNC_STAR, relevance: DART_RELEVANCE_HIGH);
+ }
+ }
+
+ @override
visitBlock(Block node) {
if (entity is ExpressionStatement) {
Expression expression = (entity as ExpressionStatement).expression;
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/optype.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698