Skip to content

Commit 87ccd49

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 AnalysisSession.getParsedLibraryByElement and getResolvedLibraryByElement.
Change-Id: Ia124a11f3074a2f8d05c3ec517e59d8b6828af91 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423071 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 0de0695 commit 87ccd49

File tree

3 files changed

+0
-43
lines changed

3 files changed

+0
-43
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,9 @@ package:analyzer/dart/analysis/session.dart:
252252
getFile (method: SomeFileResult Function(String))
253253
getLibraryByUri (method: Future<SomeLibraryElementResult> Function(String))
254254
getParsedLibrary (method: SomeParsedLibraryResult Function(String))
255-
getParsedLibraryByElement (method: SomeParsedLibraryResult Function(LibraryElement), deprecated)
256255
getParsedLibraryByElement2 (method: SomeParsedLibraryResult Function(LibraryElement2), experimental)
257256
getParsedUnit (method: SomeParsedUnitResult Function(String))
258257
getResolvedLibrary (method: Future<SomeResolvedLibraryResult> Function(String))
259-
getResolvedLibraryByElement (method: Future<SomeResolvedLibraryResult> Function(LibraryElement), deprecated)
260258
getResolvedLibraryByElement2 (method: Future<SomeResolvedLibraryResult> Function(LibraryElement2), experimental)
261259
getResolvedUnit (method: Future<SomeResolvedUnitResult> Function(String))
262260
getUnitElement (method: Future<SomeUnitElementResult> Function(String))

pkg/analyzer/lib/dart/analysis/session.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:analyzer/dart/analysis/analysis_context.dart';
66
import 'package:analyzer/dart/analysis/declared_variables.dart';
77
import 'package:analyzer/dart/analysis/results.dart';
88
import 'package:analyzer/dart/analysis/uri_converter.dart';
9-
import 'package:analyzer/dart/element/element.dart';
109
import 'package:analyzer/dart/element/element2.dart';
1110
import 'package:analyzer/exception/exception.dart';
1211
import 'package:analyzer/file_system/file_system.dart';
@@ -51,11 +50,6 @@ abstract class AnalysisSession {
5150
/// with the given absolute, normalized [path].
5251
SomeParsedLibraryResult getParsedLibrary(String path);
5352

54-
/// Return information about the results of parsing units of the library file
55-
/// with the given library [element].
56-
@Deprecated('Use getParsedLibraryByElement2() instead')
57-
SomeParsedLibraryResult getParsedLibraryByElement(LibraryElement element);
58-
5953
/// Return information about the results of parsing units of the library file
6054
/// with the given library [element].
6155
@experimental
@@ -70,14 +64,6 @@ abstract class AnalysisSession {
7064
/// normalized [path].
7165
Future<SomeResolvedLibraryResult> getResolvedLibrary(String path);
7266

73-
/// Return a future that will complete with information about the results of
74-
/// resolving all of the files in the library with the library [element].
75-
///
76-
/// Throw [ArgumentError] if the [element] was not produced by this session.
77-
@Deprecated('Use getResolvedLibraryByElement2() instead')
78-
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement(
79-
LibraryElement element);
80-
8167
/// Return a future that will complete with information about the results of
8268
/// resolving all of the files in the library with the library [element].
8369
///

pkg/analyzer/lib/src/dart/analysis/session.dart

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:analyzer/dart/analysis/declared_variables.dart';
77
import 'package:analyzer/dart/analysis/results.dart';
88
import 'package:analyzer/dart/analysis/session.dart';
99
import 'package:analyzer/dart/analysis/uri_converter.dart';
10-
import 'package:analyzer/dart/element/element.dart';
1110
import 'package:analyzer/dart/element/element2.dart';
1211
import 'package:analyzer/file_system/file_system.dart';
1312
import 'package:analyzer/src/dart/analysis/driver.dart' as driver;
@@ -93,18 +92,6 @@ class AnalysisSessionImpl implements AnalysisSession {
9392
return _driver.getParsedLibrary(path);
9493
}
9594

96-
@Deprecated('Use getParsedLibraryByElement2() instead')
97-
@override
98-
SomeParsedLibraryResult getParsedLibraryByElement(LibraryElement element) {
99-
checkConsistency();
100-
101-
if (element.session != this) {
102-
return NotElementOfThisSessionResult();
103-
}
104-
105-
return _driver.getParsedLibraryByUri(element.source.uri);
106-
}
107-
10895
@override
10996
SomeParsedLibraryResult getParsedLibraryByElement2(LibraryElement2 element) {
11097
checkConsistency();
@@ -128,20 +115,6 @@ class AnalysisSessionImpl implements AnalysisSession {
128115
return await _driver.getResolvedLibrary(path);
129116
}
130117

131-
@Deprecated('Use getResolvedLibraryByElement2() instead')
132-
@override
133-
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement(
134-
LibraryElement element,
135-
) async {
136-
checkConsistency();
137-
138-
if (element.session != this) {
139-
return NotElementOfThisSessionResult();
140-
}
141-
142-
return await _driver.getResolvedLibraryByUri(element.source.uri);
143-
}
144-
145118
@override
146119
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement2(
147120
LibraryElement2 element,

0 commit comments

Comments
 (0)