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

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

Issue 1158413003: remove keyword suggestions in constructor names and prefixed expressions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 _addCompilationUnitKeywords(); 143 _addCompilationUnitKeywords();
144 } 144 }
145 } 145 }
146 146
147 @override 147 @override
148 visitExpression(Expression node) { 148 visitExpression(Expression node) {
149 _addExpressionKeywords(node); 149 _addExpressionKeywords(node);
150 } 150 }
151 151
152 @override 152 @override
153 visitInstanceCreationExpression(InstanceCreationExpression node) {
Paul Berry 2015/05/29 16:00:47 Do similar cases need to be added for visitPropert
danrubel 2015/05/29 17:26:41 Good point. Will address in subsequent CL.
danrubel 2015/06/06 15:32:20 https://codereview.chromium.org/1151493004/
154 if (entity == node.constructorName) {
155 // no keywords in 'new ^' expression
156 } else {
157 super.visitInstanceCreationExpression(node);
158 }
159 }
160
161 @override
162 visitMethodInvocation(MethodInvocation node) {
163 if (entity == node.methodName) {
164 // no keywords in '.' expression
165 } else {
166 super.visitMethodInvocation(node);
167 }
168 }
169
170 @override
153 visitExpressionFunctionBody(ExpressionFunctionBody node) { 171 visitExpressionFunctionBody(ExpressionFunctionBody node) {
154 if (entity == node.expression) { 172 if (entity == node.expression) {
155 _addExpressionKeywords(node); 173 _addExpressionKeywords(node);
156 } 174 }
157 } 175 }
158 176
159 @override 177 @override
160 visitFormalParameterList(FormalParameterList node) { 178 visitFormalParameterList(FormalParameterList node) {
161 AstNode constructorDecl = 179 AstNode constructorDecl =
162 node.getAncestor((p) => p is ConstructorDeclaration); 180 node.getAncestor((p) => p is ConstructorDeclaration);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return false; 408 return false;
391 } 409 }
392 AstNode parent = body.parent; 410 AstNode parent = body.parent;
393 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { 411 if (parent is ConstructorDeclaration || parent is MethodDeclaration) {
394 return true; 412 return true;
395 } 413 }
396 node = parent; 414 node = parent;
397 } 415 }
398 } 416 }
399 } 417 }
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