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

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

Issue 1147213008: suggest keywords in if expression (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/keyword_contributor_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library services.completion.contributor.dart.keyword; 5 library services.completion.contributor.dart.keyword;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 node.parent.parent is CompilationUnit) { 184 node.parent.parent is CompilationUnit) {
185 _addCompilationUnitKeywords(); 185 _addCompilationUnitKeywords();
186 } 186 }
187 } 187 }
188 } 188 }
189 189
190 @override 190 @override
191 visitIfStatement(IfStatement node) { 191 visitIfStatement(IfStatement node) {
192 if (entity == node.thenStatement) { 192 if (entity == node.thenStatement) {
193 _addStatementKeywords(node); 193 _addStatementKeywords(node);
194 } else if (entity == node.condition) {
195 _addExpressionKeywords(node);
194 } 196 }
195 } 197 }
196 198
197 @override 199 @override
198 visitImportDirective(ImportDirective node) { 200 visitImportDirective(ImportDirective node) {
199 if (entity == node.asKeyword) { 201 if (entity == node.asKeyword) {
200 if (node.deferredKeyword == null) { 202 if (node.deferredKeyword == null) {
201 _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH); 203 _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH);
202 } 204 }
203 } 205 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 return false; 423 return false;
422 } 424 }
423 AstNode parent = body.parent; 425 AstNode parent = body.parent;
424 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { 426 if (parent is ConstructorDeclaration || parent is MethodDeclaration) {
425 return true; 427 return true;
426 } 428 }
427 node = parent; 429 node = parent;
428 } 430 }
429 } 431 }
430 } 432 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/keyword_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698