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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2243003002: Add a new Analysis Server flag '--enable-pub-summary-manager'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 3b41a24691390aaf7cd169e9c796de590f66145d..307ed65796f708da99f6bad321da7c2389253d63 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -40,6 +40,7 @@ import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
+import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/summary/pub_summary.dart';
import 'package:analyzer/src/task/dart.dart';
import 'package:analyzer/src/util/glob.dart';
@@ -1544,6 +1545,7 @@ class AnalysisServer {
class AnalysisServerOptions {
bool enableIncrementalResolutionApi = false;
bool enableIncrementalResolutionValidation = false;
+ bool enablePubSummaryManager = false;
bool finerGrainedInvalidation = false;
bool noErrorNotification = false;
bool noIndex = false;
@@ -1603,8 +1605,19 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
_createSourceFactory(context, options, disposition, folder);
context.analysisOptions = options;
- // TODO(scheglov) use linked bundles
-// analysisServer.pubSummaryManager.getLinkedBundles(context);
+ if (analysisServer.options.enablePubSummaryManager) {
+ List<LinkedPubPackage> linkedBundles =
+ analysisServer.pubSummaryManager.getLinkedBundles(context);
+ if (linkedBundles.isNotEmpty) {
+ SummaryDataStore store = new SummaryDataStore([]);
+ for (LinkedPubPackage package in linkedBundles) {
+ store.addBundle(null, package.unlinked);
+ store.addBundle(null, package.linked);
+ }
+ context.resultProvider =
+ new InputPackagesResultProvider(context, store);
+ }
+ }
analysisServer._onContextsChangedController
.add(new ContextsChangedEvent(added: [context]));
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698