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

Side by Side Diff: pkg/analysis_server/lib/src/computer/element.dart

Issue 462403005: Move Location factories and RefactoringProblemSeverity.max into the generated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 computer.element; 5 library computer.element;
6 6
7 import 'package:analysis_server/src/protocol2.dart'; 7 import 'package:analysis_server/src/protocol2.dart';
8 import 'package:analyzer/src/generated/element.dart' as engine; 8 import 'package:analyzer/src/generated/element.dart' as engine;
9 import 'package:analyzer/src/generated/utilities_dart.dart' as engine; 9 import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
10 10
(...skipping 12 matching lines...) Expand all
23 String elementReturnType = _getReturnTypeString(element); 23 String elementReturnType = _getReturnTypeString(element);
24 return new Element( 24 return new Element(
25 new ElementKind.fromEngine(element.kind), 25 new ElementKind.fromEngine(element.kind),
26 name, 26 name,
27 Element.makeFlags(isPrivate: element.isPrivate, 27 Element.makeFlags(isPrivate: element.isPrivate,
28 isDeprecated: element.isDeprecated, 28 isDeprecated: element.isDeprecated,
29 isAbstract: _isAbstract(element), 29 isAbstract: _isAbstract(element),
30 isConst: _isConst(element), 30 isConst: _isConst(element),
31 isFinal: _isFinal(element), 31 isFinal: _isFinal(element),
32 isStatic: _isStatic(element)), 32 isStatic: _isStatic(element)),
33 location: new Location.fromElement(element), 33 location: new Location.forElement(element),
34 parameters: elementParameters, 34 parameters: elementParameters,
35 returnType: elementReturnType); 35 returnType: elementReturnType);
36 } 36 }
37 37
38 String _getParametersString(engine.Element element) { 38 String _getParametersString(engine.Element element) {
39 // TODO(scheglov) expose the corresponding feature from ExecutableElement 39 // TODO(scheglov) expose the corresponding feature from ExecutableElement
40 if (element is engine.ExecutableElement) { 40 if (element is engine.ExecutableElement) {
41 var sb = new StringBuffer(); 41 var sb = new StringBuffer();
42 String closeOptionalString = ''; 42 String closeOptionalString = '';
43 for (var parameter in element.parameters) { 43 for (var parameter in element.parameters) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 bool _isStatic(engine.Element element) { 107 bool _isStatic(engine.Element element) {
108 // TODO(scheglov) add isStatic to Element API 108 // TODO(scheglov) add isStatic to Element API
109 if (element is engine.ExecutableElement) { 109 if (element is engine.ExecutableElement) {
110 return element.isStatic; 110 return element.isStatic;
111 } 111 }
112 if (element is engine.PropertyInducingElement) { 112 if (element is engine.PropertyInducingElement) {
113 return element.isStatic; 113 return element.isStatic;
114 } 114 }
115 return false; 115 return false;
116 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698