| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 9 | 10 |
| 10 /** | 11 /** |
| 11 * Provider for resolved and unresolved [CompilationUnit]s that contain, or | 12 * Provider for resolved and unresolved [CompilationUnit]s that contain, or |
| 12 * [AstNode]s that declare [Element]s. | 13 * [AstNode]s that declare [Element]s. |
| 13 */ | 14 */ |
| 14 abstract class AstProvider { | 15 abstract class AstProvider { |
| 15 /** | 16 /** |
| 17 * Return the driver that is used to provide ASTs. |
| 18 */ |
| 19 AnalysisDriver get driver; |
| 20 |
| 21 /** |
| 16 * Completes with the [SimpleIdentifier] that declares the [element]. The | 22 * Completes with the [SimpleIdentifier] that declares the [element]. The |
| 17 * enclosing unit is only parsed, but not resolved. Completes with `null` if | 23 * enclosing unit is only parsed, but not resolved. Completes with `null` if |
| 18 * the [element] is synthetic, or the file where it is declared cannot be | 24 * the [element] is synthetic, or the file where it is declared cannot be |
| 19 * parsed, etc. | 25 * parsed, etc. |
| 20 */ | 26 */ |
| 21 Future<SimpleIdentifier> getParsedNameForElement(Element element); | 27 Future<SimpleIdentifier> getParsedNameForElement(Element element); |
| 22 | 28 |
| 23 /** | 29 /** |
| 24 * Completes with the parsed [CompilationUnit] that contains the [element]. | 30 * Completes with the parsed [CompilationUnit] that contains the [element]. |
| 25 */ | 31 */ |
| 26 Future<CompilationUnit> getParsedUnitForElement(Element element); | 32 Future<CompilationUnit> getParsedUnitForElement(Element element); |
| 27 | 33 |
| 28 /** | 34 /** |
| 29 * Completes with the [SimpleIdentifier] that declares the [element]. The | 35 * Completes with the [SimpleIdentifier] that declares the [element]. The |
| 30 * enclosing unit is fully resolved. Completes with `null` if the [element] | 36 * enclosing unit is fully resolved. Completes with `null` if the [element] |
| 31 * is synthetic, or the file where it is declared cannot be parsed and | 37 * is synthetic, or the file where it is declared cannot be parsed and |
| 32 * resolved, etc. | 38 * resolved, etc. |
| 33 */ | 39 */ |
| 34 Future<SimpleIdentifier> getResolvedNameForElement(Element element); | 40 Future<SimpleIdentifier> getResolvedNameForElement(Element element); |
| 35 | 41 |
| 36 /** | 42 /** |
| 37 * Completes with the resolved [CompilationUnit] that contains the [element]. | 43 * Completes with the resolved [CompilationUnit] that contains the [element]. |
| 38 */ | 44 */ |
| 39 Future<CompilationUnit> getResolvedUnitForElement(Element element); | 45 Future<CompilationUnit> getResolvedUnitForElement(Element element); |
| 40 } | 46 } |
| OLD | NEW |