@@ -5,7 +5,6 @@ import 'package:analyzer/dart/analysis/results.dart';
5
5
import 'package:analyzer/dart/analysis/session.dart' ;
6
6
import 'package:analyzer/dart/ast/ast.dart' ;
7
7
import 'package:analyzer/dart/element/element.dart' ;
8
- import 'package:analyzer/dart/element/element2.dart' ;
9
8
import 'package:analyzer/error/error.dart' ;
10
9
11
10
import '../asset/id.dart' ;
@@ -30,17 +29,6 @@ abstract class Resolver {
30
29
/// instance because due to imports or exports.
31
30
Stream <LibraryElement > get libraries;
32
31
33
- /// All libraries resolved by this resolver.
34
- ///
35
- /// This includes the following libraries:
36
- /// - The primary input of this resolver (in other words, the
37
- /// [BuildStep.inputId] of a build step).
38
- /// - Libraries resolved with a direct [libraryFor] call.
39
- /// - Every public `dart:` library part of the SDK.
40
- /// - All libraries recursively accessible from the mentioned sources, for
41
- /// instance because due to imports or exports.
42
- Stream <LibraryElement2 > get libraries2;
43
-
44
32
/// Returns the parsed [AstNode] for [Element] .
45
33
///
46
34
/// This should always be preferred over using the [AnalysisSession]
@@ -54,19 +42,6 @@ abstract class Resolver {
54
42
/// reason.
55
43
Future <AstNode ?> astNodeFor (Element element, {bool resolve = false });
56
44
57
- /// Returns the parsed [AstNode] for [Element] .
58
- ///
59
- /// This should always be preferred over using the [AnalysisSession]
60
- /// directly, because it avoids [InconsistentAnalysisException] issues.
61
- ///
62
- /// If [resolve] is `true` then you will get a resolved ast node, otherwise
63
- /// it will only be a parsed ast node.
64
- ///
65
- /// Returns `null` if the ast node can not be found. This can happen if an
66
- /// element is coming from a summary, or is unavailable for some other
67
- /// reason.
68
- Future <AstNode ?> astNodeFor2 (Fragment element, {bool resolve = false });
69
-
70
45
/// Returns a parsed AST structor representing the file defined in [assetId] .
71
46
///
72
47
/// * If the [assetId] has syntax errors, and [allowSyntaxErrors] is set to
@@ -85,14 +60,6 @@ abstract class Resolver {
85
60
Future <LibraryElement > libraryFor (AssetId assetId,
86
61
{bool allowSyntaxErrors = false });
87
62
88
- /// Returns a resolved library representing the file defined in [assetId] .
89
- ///
90
- /// * Throws [NonLibraryAssetException] if [assetId] is not a Dart library.
91
- /// * If the [assetId] has syntax errors, and [allowSyntaxErrors] is set to
92
- /// `false` (the default), throws a [SyntaxErrorInAssetException] .
93
- Future <LibraryElement2 > libraryFor2 (AssetId assetId,
94
- {bool allowSyntaxErrors = false });
95
-
96
63
/// Returns the first resolved library identified by [libraryName] .
97
64
///
98
65
/// A library is resolved if it's recursively accessible from the entry point
@@ -105,19 +72,6 @@ abstract class Resolver {
105
72
/// being unique.
106
73
Future <LibraryElement ?> findLibraryByName (String libraryName);
107
74
108
- /// Returns the first resolved library identified by [libraryName] .
109
- ///
110
- /// A library is resolved if it's recursively accessible from the entry point
111
- /// or subsequent calls to [libraryFor] . In other words, this searches for
112
- /// libraries in [libraries] .
113
- /// If no library can be found, returns `null` .
114
- ///
115
- /// **NOTE**: In general, its recommended to use [libraryFor] with an absolute
116
- /// asset id instead of a named identifier that has the possibility of not
117
- /// being unique.
118
- Future <LibraryElement2 ?> findLibraryByName2 (
119
- String libraryName);
120
-
121
75
/// Returns the [AssetId] of the Dart library or part declaring [element] .
122
76
///
123
77
/// If [element] is defined in the SDK or in a summary throws
@@ -127,16 +81,6 @@ abstract class Resolver {
127
81
/// The returned asset is not necessarily the asset that should be imported to
128
82
/// use the element, it may be a part file instead of the library.
129
83
Future <AssetId > assetIdForElement (Element element);
130
-
131
- /// Returns the [AssetId] of the Dart library or part declaring [element] .
132
- ///
133
- /// If [element] is defined in the SDK or in a summary throws
134
- /// `UnresolvableAssetException` , although a non-throwing return here does not
135
- /// guarantee that the asset is readable.
136
- ///
137
- /// The returned asset is not necessarily the asset that should be imported to
138
- /// use the element, it may be a part file instead of the library.
139
- Future <AssetId > assetIdForElement2 (Element2 element);
140
84
}
141
85
142
86
/// A resolver that should be manually released at the end of a build step.
0 commit comments