Skip to content

Commit 23fe4b8

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Remove AnalysisDriver.isLibraryByUri()
Change-Id: Id4461706a583a452e9869ed29dd40631fb9a6ff7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246721 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 26b9563 commit 23fe4b8

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,23 +1000,6 @@ class AnalysisDriver implements AnalysisDriverGeneric {
10001000
return completer.future;
10011001
}
10021002

1003-
/// Return `true` is the file with the given absolute [uri] is a library,
1004-
/// or `false` if it is a part. More specifically, return `true` if the file
1005-
/// is not known to be a part.
1006-
///
1007-
/// Correspondingly, return `true` if the [uri] does not correspond to a file,
1008-
/// for any reason, e.g. the file does not exist, or the [uri] cannot be
1009-
/// resolved to a file path, or the [uri] is invalid, e.g. a `package:` URI
1010-
/// without a package name. In these cases we cannot prove that the file is
1011-
/// not a part, so it must be a library.
1012-
bool isLibraryByUri(Uri uri) {
1013-
var fileOr = _fsState.getFileForUri(uri);
1014-
return fileOr.map(
1015-
(file) => file == null || !file.isPart,
1016-
(uri) => false,
1017-
);
1018-
}
1019-
10201003
/// Return a [Future] that completes with a [ParsedUnitResult] for the file
10211004
/// with the given [path].
10221005
///

pkg/analyzer/test/src/dart/analysis/driver_test.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,16 +2459,6 @@ class B<T extends A<B>> {}
24592459
await waitForIdleWithoutExceptions();
24602460
}
24612461

2462-
test_isLibraryByUri_doesNotExist() async {
2463-
var uri = Uri.parse('file:///test.dart');
2464-
expect(driver.isLibraryByUri(uri), isTrue);
2465-
}
2466-
2467-
test_isLibraryByUri_invalidUri() async {
2468-
var uri = Uri.parse('package:aaa');
2469-
expect(driver.isLibraryByUri(uri), isTrue);
2470-
}
2471-
24722462
test_issue34619() async {
24732463
var a = convertPath('/test/lib/a.dart');
24742464
newFile(a, r'''

0 commit comments

Comments
 (0)