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

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

Issue 1963323003: More tweaks for 'for' completion. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
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 6d69c59466253ed66737aeab4e5f4da0d9cd1c85..833b0ecda2ffde74ba691f61407a9f0dd0a405ed 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
@@ -226,13 +226,14 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
if (node.initialization == entity && entity is SimpleIdentifier) {
if (_isNextTokenSynthetic(entity, TokenType.SEMICOLON)) {
_addSuggestion(Keyword.VAR, DART_RELEVANCE_HIGH);
- _addSuggestion(Keyword.FINAL, DART_RELEVANCE_HIGH);
}
}
// Actual: for (int x i^)
// Parsed: for (int x; i^;)
// Handle the degenerate case while typing - for (int x i^)
- if (node.condition == entity && entity is SimpleIdentifier) {
+ if (node.condition == entity &&
+ entity is SimpleIdentifier &&
+ node.variables != null) {
if (_isPreviousTokenSynthetic(entity, TokenType.SEMICOLON)) {
_addSuggestion(Keyword.IN, DART_RELEVANCE_HIGH);
}

Powered by Google App Engine
This is Rietveld 408576698