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

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

Issue 1417603002: Fix for suggesting methods as a *name* of a local variable declaration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/completion_test_util.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/keyword_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
index 332a7e85e1e81f96bc898465cf718a0b39a1ee36..0da2c8c1652cc8e69e924c34257f9c77ab7840cd 100644
--- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
@@ -187,9 +187,13 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
@override
visitForStatement(ForStatement node) {
- if (entity == node.rightSeparator && entity.toString() != ';') {
- // Handle the degenerate case while typing - for (int x i^)
- _addSuggestion(Keyword.IN, DART_RELEVANCE_HIGH);
+ // Handle the degenerate case while typing - for (int x i^)
+ if (node.condition == entity && entity is SimpleIdentifier) {
+ Token entityToken = (entity as SimpleIdentifier).beginToken;
+ if (entityToken.previous.isSynthetic &&
+ entityToken.previous.type == TokenType.SEMICOLON) {
+ _addSuggestion(Keyword.IN, DART_RELEVANCE_HIGH);
+ }
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698