| 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 code_transformer.src.resolver; | 5 library code_transformer.src.resolver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart' show Expression; | 9 import 'package:analyzer/src/generated/ast.dart' show Expression; |
| 10 import 'package:analyzer/src/generated/constant.dart' show EvaluationResult; | 10 import 'package:analyzer/src/generated/constant.dart' show EvaluationResult; |
| 11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
| 12 import 'package:barback/barback.dart'; | 12 import 'package:barback/barback.dart'; |
| 13 import 'package:source_maps/refactor.dart'; | 13 import 'package:source_maps/refactor.dart'; |
| 14 import 'package:source_maps/span.dart' show SourceFile, Span; | 14 import 'package:source_span/source_span.dart'; |
| 15 | 15 |
| 16 | 16 |
| 17 /// Class for working with a barback based resolved AST. | 17 /// Class for working with a barback based resolved AST. |
| 18 abstract class Resolver { | 18 abstract class Resolver { |
| 19 /// Update the status of all the sources referenced by the entry points and | 19 /// Update the status of all the sources referenced by the entry points and |
| 20 /// update the resolved library. If [entryPoints] is omitted, the primary | 20 /// update the resolved library. If [entryPoints] is omitted, the primary |
| 21 /// asset of [transform] is used as the only entry point. | 21 /// asset of [transform] is used as the only entry point. |
| 22 /// | 22 /// |
| 23 /// [release] must be called when done handling this Resolver to allow it | 23 /// [release] must be called when done handling this Resolver to allow it |
| 24 /// to be used by later phases. | 24 /// to be used by later phases. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 /// | 79 /// |
| 80 /// Returns null if the library cannot be imported via an absolute URI or | 80 /// Returns null if the library cannot be imported via an absolute URI or |
| 81 /// from [from] (if provided). | 81 /// from [from] (if provided). |
| 82 Uri getImportUri(LibraryElement lib, {AssetId from}); | 82 Uri getImportUri(LibraryElement lib, {AssetId from}); |
| 83 | 83 |
| 84 /// Get the asset ID of the file containing the asset. | 84 /// Get the asset ID of the file containing the asset. |
| 85 AssetId getSourceAssetId(Element element); | 85 AssetId getSourceAssetId(Element element); |
| 86 | 86 |
| 87 /// Get the source span where the specified element was defined or null if | 87 /// Get the source span where the specified element was defined or null if |
| 88 /// the element came from the Dart SDK. | 88 /// the element came from the Dart SDK. |
| 89 Span getSourceSpan(Element element); | 89 SourceSpan getSourceSpan(Element element); |
| 90 | 90 |
| 91 /// Get a [SourceFile] with the contents of the file that defines [element], | 91 /// Get a [SourceFile] with the contents of the file that defines [element], |
| 92 /// or null if the element came from the Dart SDK. | 92 /// or null if the element came from the Dart SDK. |
| 93 SourceFile getSourceFile(Element element); | 93 SourceFile getSourceFile(Element element); |
| 94 | 94 |
| 95 /// Creates a text edit transaction for the given element if it is able | 95 /// Creates a text edit transaction for the given element if it is able |
| 96 /// to be edited, returns null otherwise. | 96 /// to be edited, returns null otherwise. |
| 97 /// | 97 /// |
| 98 /// The transaction contains the entire text of the source file where the | 98 /// The transaction contains the entire text of the source file where the |
| 99 /// element originated. If the element was from a library part then the | 99 /// element originated. If the element was from a library part then the |
| 100 /// source file is the part file rather than the library. | 100 /// source file is the part file rather than the library. |
| 101 TextEditTransaction createTextEditTransaction(Element element); | 101 TextEditTransaction createTextEditTransaction(Element element); |
| 102 } | 102 } |
| OLD | NEW |