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

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2220703002: Initial implementation of pub summary manager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweak 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 import 'dart:io' as io; 10 import 'dart:io' as io;
11 import 'dart:math' show max; 11 import 'dart:math' show max;
12 12
13 import 'package:analysis_server/plugin/protocol/protocol.dart' 13 import 'package:analysis_server/plugin/protocol/protocol.dart'
14 hide AnalysisOptions, Element; 14 hide AnalysisOptions, Element;
15 import 'package:analysis_server/src/analysis_logger.dart'; 15 import 'package:analysis_server/src/analysis_logger.dart';
16 import 'package:analysis_server/src/channel/channel.dart'; 16 import 'package:analysis_server/src/channel/channel.dart';
17 import 'package:analysis_server/src/context_manager.dart'; 17 import 'package:analysis_server/src/context_manager.dart';
18 import 'package:analysis_server/src/operation/operation.dart'; 18 import 'package:analysis_server/src/operation/operation.dart';
19 import 'package:analysis_server/src/operation/operation_analysis.dart'; 19 import 'package:analysis_server/src/operation/operation_analysis.dart';
20 import 'package:analysis_server/src/operation/operation_queue.dart'; 20 import 'package:analysis_server/src/operation/operation_queue.dart';
21 import 'package:analysis_server/src/plugin/server_plugin.dart'; 21 import 'package:analysis_server/src/plugin/server_plugin.dart';
22 import 'package:analysis_server/src/services/correction/namespace.dart'; 22 import 'package:analysis_server/src/services/correction/namespace.dart';
23 import 'package:analysis_server/src/services/index/index.dart'; 23 import 'package:analysis_server/src/services/index/index.dart';
24 import 'package:analysis_server/src/services/search/search_engine.dart'; 24 import 'package:analysis_server/src/services/search/search_engine.dart';
25 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 25 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
26 import 'package:analysis_server/src/single_context_manager.dart'; 26 import 'package:analysis_server/src/single_context_manager.dart';
27 import 'package:analysis_server/src/pub_summary.dart';
27 import 'package:analyzer/dart/ast/ast.dart'; 28 import 'package:analyzer/dart/ast/ast.dart';
28 import 'package:analyzer/dart/element/element.dart'; 29 import 'package:analyzer/dart/element/element.dart';
29 import 'package:analyzer/file_system/file_system.dart'; 30 import 'package:analyzer/file_system/file_system.dart';
30 import 'package:analyzer/instrumentation/instrumentation.dart'; 31 import 'package:analyzer/instrumentation/instrumentation.dart';
31 import 'package:analyzer/plugin/resolver_provider.dart'; 32 import 'package:analyzer/plugin/resolver_provider.dart';
32 import 'package:analyzer/source/pub_package_map_provider.dart'; 33 import 'package:analyzer/source/pub_package_map_provider.dart';
33 import 'package:analyzer/src/context/builder.dart'; 34 import 'package:analyzer/src/context/builder.dart';
34 import 'package:analyzer/src/dart/ast/utilities.dart'; 35 import 'package:analyzer/src/dart/ast/utilities.dart';
35 import 'package:analyzer/src/dart/sdk/sdk.dart'; 36 import 'package:analyzer/src/dart/sdk/sdk.dart';
36 import 'package:analyzer/src/generated/engine.dart'; 37 import 'package:analyzer/src/generated/engine.dart';
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 StreamController<ContextsChangedEvent> _onContextsChangedController = 293 StreamController<ContextsChangedEvent> _onContextsChangedController =
293 new StreamController<ContextsChangedEvent>.broadcast(); 294 new StreamController<ContextsChangedEvent>.broadcast();
294 295
295 /** 296 /**
296 * The file resolver provider used to override the way file URI's are 297 * The file resolver provider used to override the way file URI's are
297 * resolved in some contexts. 298 * resolved in some contexts.
298 */ 299 */
299 ResolverProvider fileResolverProvider; 300 ResolverProvider fileResolverProvider;
300 301
301 /** 302 /**
303 * The manager of pub package summaries.
304 */
305 PubSummaryManager pubSummaryManager;
306
307 /**
302 * Initialize a newly created server to receive requests from and send 308 * Initialize a newly created server to receive requests from and send
303 * responses to the given [channel]. 309 * responses to the given [channel].
304 * 310 *
305 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are 311 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are
306 * propagated up the call stack. The default is true to allow analysis 312 * propagated up the call stack. The default is true to allow analysis
307 * exceptions to show up in unit tests, but it should be set to false when 313 * exceptions to show up in unit tests, but it should be set to false when
308 * running a full analysis server. 314 * running a full analysis server.
309 */ 315 */
310 AnalysisServer( 316 AnalysisServer(
311 this.channel, 317 this.channel,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 _onPriorityChangeController = 362 _onPriorityChangeController =
357 new StreamController<PriorityChangeEvent>.broadcast(); 363 new StreamController<PriorityChangeEvent>.broadcast();
358 running = true; 364 running = true;
359 onAnalysisStarted.first.then((_) { 365 onAnalysisStarted.first.then((_) {
360 onAnalysisComplete.then((_) { 366 onAnalysisComplete.then((_) {
361 performanceAfterStartup = new ServerPerformance(); 367 performanceAfterStartup = new ServerPerformance();
362 _performance = performanceAfterStartup; 368 _performance = performanceAfterStartup;
363 }); 369 });
364 }); 370 });
365 _setupIndexInvalidation(); 371 _setupIndexInvalidation();
372 pubSummaryManager = new PubSummaryManager(resourceProvider, this);
366 Notification notification = 373 Notification notification =
367 new ServerConnectedParams(VERSION, io.pid).toNotification(); 374 new ServerConnectedParams(VERSION, io.pid).toNotification();
368 channel.sendNotification(notification); 375 channel.sendNotification(notification);
369 channel.listen(handleRequest, onDone: done, onError: error); 376 channel.listen(handleRequest, onDone: done, onError: error);
370 handlers = serverPlugin.createDomains(this); 377 handlers = serverPlugin.createDomains(this);
371 } 378 }
372 379
373 /** 380 /**
374 * Return the [AnalysisContext]s that are being used to analyze the analysis 381 * Return the [AnalysisContext]s that are being used to analyze the analysis
375 * roots. 382 * roots.
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 /** 1798 /**
1792 * The [PerformanceTag] for time spent in server request handlers. 1799 * The [PerformanceTag] for time spent in server request handlers.
1793 */ 1800 */
1794 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1801 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1795 1802
1796 /** 1803 /**
1797 * The [PerformanceTag] for time spent in split store microtasks. 1804 * The [PerformanceTag] for time spent in split store microtasks.
1798 */ 1805 */
1799 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1806 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1800 } 1807 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/pub_summary.dart » ('j') | pkg/analysis_server/lib/src/pub_summary.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698