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

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

Issue 862803008: fix completion in for statement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 10 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/optype.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
index 7bce7304246950f18b9b0e9182e92c120b7e0771..3a6d6ef12dd042f54e0af30bf27cb6d6fd7211e7 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -224,7 +224,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
@override
void visitDefaultFormalParameter(DefaultFormalParameter node) {
- if (entity == node.defaultValue) {
+ if (identical(entity, node.defaultValue)) {
optype.includeReturnValueSuggestions = true;
optype.includeTypeNameSuggestions = true;
}
@@ -282,6 +282,17 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
@override
void visitForEachStatement(ForEachStatement node) {
+ if (identical(entity, node.identifier)) {
+ optype.includeTypeNameSuggestions = true;
+ }
+ if (identical(entity, node.loopVariable)) {
+ optype.includeTypeNameSuggestions = true;
+ }
+ if (identical(entity, node.inKeyword) && offset <= node.inKeyword.offset) {
+ if (node.identifier == null && node.loopVariable == null) {
+ optype.includeTypeNameSuggestions = true;
+ }
+ }
if (identical(entity, node.iterable)) {
optype.includeReturnValueSuggestions = true;
optype.includeTypeNameSuggestions = true;
« 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