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

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

Issue 1958733002: Suggest 'is' in 'if (x is^)'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove solo_ Created 4 years, 7 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 a79bb40a566e4318400067b31087c8377436a5c1..6d69c59466253ed66737aeab4e5f4da0d9cd1c85 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
@@ -260,7 +260,11 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
@override
visitIfStatement(IfStatement node) {
- if (entity == node.thenStatement) {
+ if (_isPreviousTokenSynthetic(entity, TokenType.CLOSE_PAREN)) {
+ // Actual: if (x i^)
+ // Parsed: if (x) i^
+ _addSuggestion(Keyword.IS, DART_RELEVANCE_HIGH);
+ } else if (entity == node.thenStatement) {
_addStatementKeywords(node);
} else if (entity == node.condition) {
_addExpressionKeywords(node);
« 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