| Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
|
| diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
|
| index 34dee148973a167079ac578ab93bd78383fe3c77..05d8f46a6010f56acef900a2ca00a3eeb5d002d7 100644
|
| --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
|
| +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
|
| @@ -587,6 +587,21 @@ class AnalysisDriver {
|
| }
|
|
|
| /**
|
| + * Return a [Future] that completes with the [SourceKind] for the Dart
|
| + * file with the given [path]. If the file is not a Dart file or cannot
|
| + * be analyzed, the [Future] completes with `null`.
|
| + *
|
| + * The [path] must be absolute and normalized.
|
| + */
|
| + Future<SourceKind> getSourceKind(String path) async {
|
| + if (AnalysisEngine.isDartFileName(path)) {
|
| + FileState file = _fsState.getFileForPath(path);
|
| + return file.isPart ? SourceKind.PART : SourceKind.LIBRARY;
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + /**
|
| * Return a [Future] that completes with top-level declarations with the
|
| * given [name] in all known libraries.
|
| */
|
|
|