Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: pkg/analyzer_cli/lib/src/analyzer_impl.dart

Issue 2658983004: Implement AnalysisDriver.getSourceKind() and use it in analyzer-cli. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/driver_test.dart ('k') | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer_cli/lib/src/analyzer_impl.dart b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
index 256b70d9a8a57ace935f72fcc9dc357ea54e532f..f92a40ffbd86c48c4ca2d3ec90b0435ae4d5d8ba 100644
--- a/pkg/analyzer_cli/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
@@ -164,10 +164,13 @@ class AnalyzerImpl {
Future<ErrorSeverity> _analyze(int printMode) async {
// Don't try to analyze parts.
- if (context.computeKindOf(librarySource) == SourceKind.PART) {
+ String path = librarySource.fullName;
+ SourceKind librarySourceKind = analysisDriver != null
+ ? await analysisDriver.getSourceKind(path)
+ : context.computeKindOf(librarySource);
+ if (librarySourceKind == SourceKind.PART) {
stderr.writeln("Only libraries can be analyzed.");
- stderr.writeln(
- "${librarySource.fullName} is a part and can not be analyzed.");
+ stderr.writeln("${path} is a part and can not be analyzed.");
return ErrorSeverity.ERROR;
}
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/driver_test.dart ('k') | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698