OLD | NEW |
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 /** | 5 /** |
6 * Utilities for converting Dart entities into analysis server's protocol | 6 * Utilities for converting Dart entities into analysis server's protocol |
7 * entities. | 7 * entities. |
8 */ | 8 */ |
9 library analysis_server.plugin.protocol.protocol_dart; | 9 library analysis_server.plugin.protocol.protocol_dart; |
10 | 10 |
11 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 11 import 'package:analysis_server/protocol/protocol_generated.dart'; |
12 import 'package:analysis_server/src/protocol_server.dart'; | 12 import 'package:analysis_server/src/protocol_server.dart'; |
13 import 'package:analyzer/dart/element/element.dart' as engine; | 13 import 'package:analyzer/dart/element/element.dart' as engine; |
14 import 'package:analyzer/src/generated/utilities_dart.dart' as engine; | 14 import 'package:analyzer/src/generated/utilities_dart.dart' as engine; |
15 | 15 |
16 /** | 16 /** |
17 * Return a protocol [Element] corresponding to the given [engine.Element]. | 17 * Return a protocol [Element] corresponding to the given [engine.Element]. |
18 */ | 18 */ |
19 Element convertElement(engine.Element element) { | 19 Element convertElement(engine.Element element) { |
20 String name = element.displayName; | 20 String name = element.displayName; |
21 String elementTypeParameters = _getTypeParametersString(element); | 21 String elementTypeParameters = _getTypeParametersString(element); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 bool _isStatic(engine.Element element) { | 209 bool _isStatic(engine.Element element) { |
210 // TODO(scheglov) add isStatic to Element API | 210 // TODO(scheglov) add isStatic to Element API |
211 if (element is engine.ExecutableElement) { | 211 if (element is engine.ExecutableElement) { |
212 return element.isStatic; | 212 return element.isStatic; |
213 } | 213 } |
214 if (element is engine.PropertyInducingElement) { | 214 if (element is engine.PropertyInducingElement) { |
215 return element.isStatic; | 215 return element.isStatic; |
216 } | 216 } |
217 return false; | 217 return false; |
218 } | 218 } |
OLD | NEW |