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

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

Issue 2347123004: Issue 27374. Include all configuration sources into REFERENCED_SOURCES. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | pkg/analyzer/test/src/task/dart_test.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 18bc4df82cd0e509a488ce50f0d06af68a489555..324ad51b81339490e991cf6c20a14586a75ef2ae 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -4087,22 +4087,35 @@ class ParseDartTask extends SourceBasedAnalysisTask {
ReferencedNames referencedNames = new ReferencedNames(_source);
new ReferencedNamesBuilder(referencedNames).build(unit);
//
- // Record outputs.
+ // Compute source lists.
//
List<Source> explicitlyImportedSources =
explicitlyImportedSourceSet.toList();
List<Source> exportedSources = exportedSourceSet.toList();
List<Source> importedSources = importedSourceSet.toList();
List<Source> includedSources = includedSourceSet.toList();
- List<AnalysisError> parseErrors = getUniqueErrors(errorListener.errors);
List<Source> unitSources = <Source>[_source]..addAll(includedSourceSet);
- List<Source> referencedSources = (new Set<Source>()
- ..addAll(importedSources)
- ..addAll(exportedSources)
- ..addAll(unitSources))
- .toList();
List<LibrarySpecificUnit> librarySpecificUnits =
unitSources.map((s) => new LibrarySpecificUnit(_source, s)).toList();
+ //
+ // Compute referenced sources.
+ //
+ Set<Source> referencedSources = new Set<Source>();
+ referencedSources.add(coreLibrarySource);
+ referencedSources.addAll(unitSources);
+ for (Directive directive in unit.directives) {
+ if (directive is NamespaceDirective) {
+ referencedSources.add(directive.uriSource);
+ for (Configuration configuration in directive.configurations) {
+ referencedSources.add(configuration.uriSource);
+ }
+ }
+ }
+ referencedSources.removeWhere((source) => source == null);
+ //
+ // Record outputs.
+ //
+ List<AnalysisError> parseErrors = getUniqueErrors(errorListener.errors);
outputs[EXPLICITLY_IMPORTED_LIBRARIES] = explicitlyImportedSources;
outputs[EXPORTED_LIBRARIES] = exportedSources;
outputs[IMPORTED_LIBRARIES] = importedSources;
@@ -4111,7 +4124,7 @@ class ParseDartTask extends SourceBasedAnalysisTask {
outputs[PARSE_ERRORS] = parseErrors;
outputs[PARSED_UNIT] = unit;
outputs[REFERENCED_NAMES] = referencedNames;
- outputs[REFERENCED_SOURCES] = referencedSources;
+ outputs[REFERENCED_SOURCES] = referencedSources.toList();
outputs[SOURCE_KIND] = sourceKind;
outputs[UNITS] = unitSources;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698