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

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

Issue 2652823002: Use single InputPackagesResultProvider, without SdkSummaryResultProvider. (Closed)
Patch Set: Fixes for analyzer_cli. 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
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 c9c59b603f447bae82c35b3772d78474e883490d..67ca0b07db6d234d589708faf17662f0e827daee 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -32,6 +32,7 @@ import 'package:analyzer/src/generated/utilities_general.dart'
import 'package:analyzer/src/lint/registry.dart';
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/source/source_resource.dart';
+import 'package:analyzer/src/summary/idl.dart';
import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/summary/summary_sdk.dart' show SummaryBasedDartSdk;
import 'package:analyzer/src/task/options.dart';
@@ -516,6 +517,11 @@ class Driver implements CommandLineStarter {
// Once options and embedders are processed, setup the SDK.
_setupSdk(options, useSummaries);
+ PackageBundle sdkBundle = sdk.getLinkedBundle();
+ if (sdkBundle != null) {
+ summaryDataStore.addBundle(null, sdkBundle);
+ }
+
// Choose a package resolution policy and a diet parsing policy based on
// the command-line options.
SourceFactory sourceFactory = _chooseUriResolutionPolicy(
@@ -530,8 +536,10 @@ class Driver implements CommandLineStarter {
});
_context.sourceFactory = sourceFactory;
- _context.resultProvider =
- new InputPackagesResultProvider(_context, summaryDataStore);
+ if (sdkBundle != null) {
+ _context.resultProvider =
+ new InputPackagesResultProvider(_context, summaryDataStore);
+ }
}
/// Return discovered packagespec, or `null` if none is found.

Powered by Google App Engine
This is Rietveld 408576698