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

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1167733004: Decide if unit without directives is a part or a library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index c4f2dfcbb44e1c96473bb913bd92119f14c73e4c..dde0ebce7e37ca7e25abbe9850eb81508fc29a3a 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -2671,8 +2671,16 @@ class ParseDartTask extends SourceBasedAnalysisTask {
SourceKind sourceKind = SourceKind.LIBRARY;
if (modificationTime == -1) {
sourceKind = SourceKind.UNKNOWN;
- } else if (!hasNonPartOfDirective && hasPartOfDirective) {
+ } else if (hasNonPartOfDirective) {
+ sourceKind = SourceKind.LIBRARY;
+ } else if (hasPartOfDirective) {
sourceKind = SourceKind.PART;
+ } else {
+ if (context.getLibrariesContaining(source).isEmpty) {
Brian Wilkerson 2015/06/02 22:01:53 While this is better, it doesn't work reliably. If
scheglov 2015/06/02 22:56:41 Right. That's there is also the change in DartWork
+ sourceKind = SourceKind.LIBRARY;
+ } else {
+ sourceKind = SourceKind.PART;
+ }
}
//
// Record outputs.
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698