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

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

Issue 831273002: fix local setter suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.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.computer.dart.local; 5 library services.completion.computer.dart.local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element,
10 ElementKind; 10 ElementKind;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 } 193 }
194 194
195 @override 195 @override
196 void declaredMethod(MethodDeclaration declaration) { 196 void declaredMethod(MethodDeclaration declaration) {
197 if (typesOnly) { 197 if (typesOnly) {
198 return; 198 return;
199 } 199 }
200 protocol.ElementKind kind; 200 protocol.ElementKind kind;
201 String parameters; 201 String parameters;
202 TypeName returnType = declaration.returnType;
202 if (declaration.isGetter) { 203 if (declaration.isGetter) {
203 kind = protocol.ElementKind.GETTER; 204 kind = protocol.ElementKind.GETTER;
204 parameters = '()'; 205 parameters = null;
205 } else if (declaration.isSetter) { 206 } else if (declaration.isSetter) {
206 if (excludeVoidReturn) { 207 if (excludeVoidReturn) {
207 return; 208 return;
208 } 209 }
209 kind = protocol.ElementKind.SETTER; 210 kind = protocol.ElementKind.SETTER;
210 parameters = '(${declaration.returnType.toSource()} value)'; 211 returnType = null;
211 } else { 212 } else {
212 if (excludeVoidReturn && _isVoid(declaration.returnType)) { 213 if (excludeVoidReturn && _isVoid(returnType)) {
213 return; 214 return;
214 } 215 }
215 kind = protocol.ElementKind.METHOD; 216 kind = protocol.ElementKind.METHOD;
216 parameters = declaration.parameters.toSource(); 217 parameters = declaration.parameters.toSource();
217 } 218 }
218 bool isDeprecated = _isDeprecated(declaration); 219 bool isDeprecated = _isDeprecated(declaration);
219 CompletionSuggestion suggestion = _addSuggestion( 220 CompletionSuggestion suggestion = _addSuggestion(
220 declaration.name, 221 declaration.name,
221 declaration.returnType, 222 returnType,
222 declaration.parent, 223 declaration.parent,
223 isDeprecated); 224 isDeprecated);
224 if (suggestion != null) { 225 if (suggestion != null) {
225 suggestion.element = _createElement( 226 suggestion.element = _createElement(
226 kind, 227 kind,
227 declaration.name, 228 declaration.name,
228 parameters, 229 parameters,
229 declaration.returnType, 230 returnType,
230 declaration.isAbstract, 231 declaration.isAbstract,
231 isDeprecated); 232 isDeprecated);
232 } 233 }
233 } 234 }
234 235
235 @override 236 @override
236 void declaredParam(SimpleIdentifier name, TypeName type) { 237 void declaredParam(SimpleIdentifier name, TypeName type) {
237 if (typesOnly) { 238 if (typesOnly) {
238 return; 239 return;
239 } 240 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if (name == null || name.length <= 0) { 376 if (name == null || name.length <= 0) {
376 return DYNAMIC; 377 return DYNAMIC;
377 } 378 }
378 TypeArgumentList typeArgs = type.typeArguments; 379 TypeArgumentList typeArgs = type.typeArguments;
379 if (typeArgs != null) { 380 if (typeArgs != null) {
380 //TODO (danrubel) include type arguments 381 //TODO (danrubel) include type arguments
381 } 382 }
382 return name; 383 return name;
383 } 384 }
384 } 385 }
OLDNEW
« 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