| 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 library services.index; | 5 library services.index; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 LocationWithData(Location location, this.data) | 308 LocationWithData(Location location, this.data) |
| 309 : super(location.element, location.offset, location.length); | 309 : super(location.element, location.offset, location.length); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 /** | 313 /** |
| 314 * An [Element] which is used to index references to the name without specifying | 314 * An [Element] which is used to index references to the name without specifying |
| 315 * a concrete kind of this name - field, method or something else. | 315 * a concrete kind of this name - field, method or something else. |
| 316 */ | 316 */ |
| 317 class NameElement extends ElementImpl { | 317 class NameElement extends ElementImpl { |
| 318 NameElement(String name) : super('name:$name', -1); | 318 NameElement(String name) : super("name:${name}", -1); |
| 319 | 319 |
| 320 @override | 320 @override |
| 321 ElementKind get kind => ElementKind.NAME; | 321 ElementKind get kind => ElementKind.NAME; |
| 322 | 322 |
| 323 @override | 323 @override |
| 324 bool operator ==(Object other) { | |
| 325 return other is NameElement && other.name == name; | |
| 326 } | |
| 327 | |
| 328 @override | |
| 329 accept(ElementVisitor visitor) => null; | 324 accept(ElementVisitor visitor) => null; |
| 330 } | 325 } |
| 331 | 326 |
| 332 | 327 |
| 333 /** | 328 /** |
| 334 * Relationship between an element and a location. Relationships are identified | 329 * Relationship between an element and a location. Relationships are identified |
| 335 * by a globally unique identifier. | 330 * by a globally unique identifier. |
| 336 */ | 331 */ |
| 337 class Relationship { | 332 class Relationship { |
| 338 /** | 333 /** |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 static final UniverseElement INSTANCE = new UniverseElement._(); | 370 static final UniverseElement INSTANCE = new UniverseElement._(); |
| 376 | 371 |
| 377 UniverseElement._() : super("--universe--", -1); | 372 UniverseElement._() : super("--universe--", -1); |
| 378 | 373 |
| 379 @override | 374 @override |
| 380 ElementKind get kind => ElementKind.UNIVERSE; | 375 ElementKind get kind => ElementKind.UNIVERSE; |
| 381 | 376 |
| 382 @override | 377 @override |
| 383 accept(ElementVisitor visitor) => null; | 378 accept(ElementVisitor visitor) => null; |
| 384 } | 379 } |
| OLD | NEW |