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

Side by Side Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 791553007: suggest fields rather than synthetic getters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 protocol.server; 5 library protocol.server;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analysis_server/src/services/search/search_engine.dart' as 8 import 'package:analysis_server/src/services/search/search_engine.dart' as
9 engine; 9 engine;
10 import 'package:analyzer/src/generated/ast.dart' as engine; 10 import 'package:analyzer/src/generated/ast.dart' as engine;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 364
365 365
366 String _getReturnTypeString(engine.Element element) { 366 String _getReturnTypeString(engine.Element element) {
367 if (element is engine.ExecutableElement) { 367 if (element is engine.ExecutableElement) {
368 if (element.kind == engine.ElementKind.SETTER) { 368 if (element.kind == engine.ElementKind.SETTER) {
369 return null; 369 return null;
370 } else { 370 } else {
371 return element.returnType.toString(); 371 return element.returnType.toString();
372 } 372 }
373 } else if (element is engine.VariableElement) {
374 engine.DartType type = element.type;
375 return type != null ? type.displayName : 'dynamic';
373 } else { 376 } else {
374 return null; 377 return null;
375 } 378 }
376 } 379 }
377 380
378 bool _isAbstract(engine.Element element) { 381 bool _isAbstract(engine.Element element) {
379 // TODO(scheglov) add isAbstract to Element API 382 // TODO(scheglov) add isAbstract to Element API
380 if (element is engine.ClassElement) { 383 if (element is engine.ClassElement) {
381 return element.isAbstract; 384 return element.isAbstract;
382 } 385 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 startColumn = offsetLocation.columnNumber; 438 startColumn = offsetLocation.columnNumber;
436 } 439 }
437 } 440 }
438 return new Location( 441 return new Location(
439 source.fullName, 442 source.fullName,
440 range.offset, 443 range.offset,
441 range.length, 444 range.length,
442 startLine, 445 startLine,
443 startColumn); 446 startColumn);
444 } 447 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698