| Index: pkg/analyzer_cli/lib/src/driver.dart
|
| diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
|
| index e91d07ef262d6373d7af382528fca49a2114cbd7..067491fde610dc26c6e1269fe12c13bf61cd5b1d 100644
|
| --- a/pkg/analyzer_cli/lib/src/driver.dart
|
| +++ b/pkg/analyzer_cli/lib/src/driver.dart
|
| @@ -244,10 +244,17 @@ class Driver implements CommandLineStarter {
|
| // Check that each part has a corresponding source in the input list.
|
| for (Source part in parts) {
|
| bool found = false;
|
| - for (var lib in context.getLibrariesContaining(part)) {
|
| - if (libUris.contains(lib.uri)) {
|
| + if (analysisDriver != null) {
|
| + var partFile = analysisDriver.fsState.getFileForPath(part.fullName);
|
| + if (libUris.contains(partFile.library?.uri)) {
|
| found = true;
|
| }
|
| + } else {
|
| + for (var lib in context.getLibrariesContaining(part)) {
|
| + if (libUris.contains(lib.uri)) {
|
| + found = true;
|
| + }
|
| + }
|
| }
|
| if (!found) {
|
| errorSink.writeln("${part.fullName} is a part and cannot be analyzed.");
|
|
|