| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 src.services.index; | 5 library src.services.index; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_server/analysis/index/index_core.dart'; | 9 import 'package:analysis_server/analysis/index_core.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| 11 import 'package:analyzer/src/generated/engine.dart'; | 11 import 'package:analyzer/src/generated/engine.dart'; |
| 12 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * A wrapper around an [Element] that implements the [IndexableObject] interface
. | 15 * A wrapper around an [Element] that implements the [IndexableObject] interface
. |
| 16 */ | 16 */ |
| 17 class IndexableElement implements IndexableObject { | 17 class IndexableElement implements IndexableObject { |
| 18 /** | 18 /** |
| 19 * The element being wrapped. | 19 * The element being wrapped. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 ClassElement classElement = element.enclosingElement; | 153 ClassElement classElement = element.enclosingElement; |
| 154 int constructorIndex = classElement.constructors.indexOf(element); | 154 int constructorIndex = classElement.constructors.indexOf(element); |
| 155 return _constructorKinds.putIfAbsent(constructorIndex, | 155 return _constructorKinds.putIfAbsent(constructorIndex, |
| 156 () => new IndexableElementKind._(ElementKind.CONSTRUCTOR)); | 156 () => new IndexableElementKind._(ElementKind.CONSTRUCTOR)); |
| 157 } | 157 } |
| 158 ElementKind elementKind = element.kind; | 158 ElementKind elementKind = element.kind; |
| 159 return _kindMap.putIfAbsent( | 159 return _kindMap.putIfAbsent( |
| 160 elementKind, () => new IndexableElementKind._(elementKind)); | 160 elementKind, () => new IndexableElementKind._(elementKind)); |
| 161 } | 161 } |
| 162 } | 162 } |
| OLD | NEW |