| OLD | NEW |
| 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:math' show max; | 10 import 'dart:math' show max; |
| 11 | 11 |
| 12 import 'package:analysis_server/plugin/protocol/protocol.dart' | 12 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 13 hide AnalysisOptions, Element; | 13 hide AnalysisOptions, Element; |
| 14 import 'package:analysis_server/src/analysis_logger.dart'; | 14 import 'package:analysis_server/src/analysis_logger.dart'; |
| 15 import 'package:analysis_server/src/channel/channel.dart'; | 15 import 'package:analysis_server/src/channel/channel.dart'; |
| 16 import 'package:analysis_server/src/context_manager.dart'; | 16 import 'package:analysis_server/src/context_manager.dart'; |
| 17 import 'package:analysis_server/src/operation/operation.dart'; | 17 import 'package:analysis_server/src/operation/operation.dart'; |
| 18 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 18 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
| 19 import 'package:analysis_server/src/operation/operation_queue.dart'; | 19 import 'package:analysis_server/src/operation/operation_queue.dart'; |
| 20 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 20 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 21 import 'package:analysis_server/src/services/correction/namespace.dart'; | 21 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 22 import 'package:analysis_server/src/services/index/index.dart'; | 22 import 'package:analysis_server/src/services/index/index.dart'; |
| 23 import 'package:analysis_server/src/services/index2/index2.dart'; |
| 23 import 'package:analysis_server/src/services/search/search_engine.dart'; | 24 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 24 import 'package:analyzer/dart/element/element.dart'; | 25 import 'package:analyzer/dart/element/element.dart'; |
| 25 import 'package:analyzer/file_system/file_system.dart'; | 26 import 'package:analyzer/file_system/file_system.dart'; |
| 26 import 'package:analyzer/instrumentation/instrumentation.dart'; | 27 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 27 import 'package:analyzer/plugin/embedded_resolver_provider.dart'; | 28 import 'package:analyzer/plugin/embedded_resolver_provider.dart'; |
| 28 import 'package:analyzer/plugin/resolver_provider.dart'; | 29 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 29 import 'package:analyzer/source/embedder.dart'; | 30 import 'package:analyzer/source/embedder.dart'; |
| 30 import 'package:analyzer/source/pub_package_map_provider.dart'; | 31 import 'package:analyzer/source/pub_package_map_provider.dart'; |
| 31 import 'package:analyzer/src/generated/ast.dart'; | 32 import 'package:analyzer/src/generated/ast.dart'; |
| 32 import 'package:analyzer/src/generated/engine.dart'; | 33 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 * The [ResourceProvider] using which paths are converted into [Resource]s. | 100 * The [ResourceProvider] using which paths are converted into [Resource]s. |
| 100 */ | 101 */ |
| 101 final ResourceProvider resourceProvider; | 102 final ResourceProvider resourceProvider; |
| 102 | 103 |
| 103 /** | 104 /** |
| 104 * The [Index] for this server, may be `null` if indexing is disabled. | 105 * The [Index] for this server, may be `null` if indexing is disabled. |
| 105 */ | 106 */ |
| 106 final Index index; | 107 final Index index; |
| 107 | 108 |
| 108 /** | 109 /** |
| 110 * The [Index2] for this server, may be `null` if indexing is disabled. |
| 111 */ |
| 112 final Index2 index2; |
| 113 |
| 114 /** |
| 109 * The [SearchEngine] for this server, may be `null` if indexing is disabled. | 115 * The [SearchEngine] for this server, may be `null` if indexing is disabled. |
| 110 */ | 116 */ |
| 111 final SearchEngine searchEngine; | 117 final SearchEngine searchEngine; |
| 112 | 118 |
| 113 /** | 119 /** |
| 114 * The plugin associated with this analysis server. | 120 * The plugin associated with this analysis server. |
| 115 */ | 121 */ |
| 116 final ServerPlugin serverPlugin; | 122 final ServerPlugin serverPlugin; |
| 117 | 123 |
| 118 /** | 124 /** |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are | 304 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are |
| 299 * propagated up the call stack. The default is true to allow analysis | 305 * propagated up the call stack. The default is true to allow analysis |
| 300 * exceptions to show up in unit tests, but it should be set to false when | 306 * exceptions to show up in unit tests, but it should be set to false when |
| 301 * running a full analysis server. | 307 * running a full analysis server. |
| 302 */ | 308 */ |
| 303 AnalysisServer( | 309 AnalysisServer( |
| 304 this.channel, | 310 this.channel, |
| 305 this.resourceProvider, | 311 this.resourceProvider, |
| 306 PubPackageMapProvider packageMapProvider, | 312 PubPackageMapProvider packageMapProvider, |
| 307 Index _index, | 313 Index _index, |
| 314 Index2 _index2, |
| 308 this.serverPlugin, | 315 this.serverPlugin, |
| 309 this.options, | 316 this.options, |
| 310 this.defaultSdkCreator, | 317 this.defaultSdkCreator, |
| 311 this.instrumentationService, | 318 this.instrumentationService, |
| 312 {ResolverProvider packageResolverProvider: null, | 319 {ResolverProvider packageResolverProvider: null, |
| 313 EmbeddedResolverProvider embeddedResolverProvider: null, | 320 EmbeddedResolverProvider embeddedResolverProvider: null, |
| 314 this.rethrowExceptions: true}) | 321 this.rethrowExceptions: true}) |
| 315 : index = _index, | 322 : index = _index, |
| 323 index2 = _index2, |
| 316 searchEngine = _index != null ? createSearchEngine(_index) : null { | 324 searchEngine = _index != null ? createSearchEngine(_index) : null { |
| 317 _performance = performanceDuringStartup; | 325 _performance = performanceDuringStartup; |
| 318 defaultContextOptions.incremental = true; | 326 defaultContextOptions.incremental = true; |
| 319 defaultContextOptions.incrementalApi = | 327 defaultContextOptions.incrementalApi = |
| 320 options.enableIncrementalResolutionApi; | 328 options.enableIncrementalResolutionApi; |
| 321 defaultContextOptions.incrementalValidation = | 329 defaultContextOptions.incrementalValidation = |
| 322 options.enableIncrementalResolutionValidation; | 330 options.enableIncrementalResolutionValidation; |
| 323 defaultContextOptions.generateImplicitErrors = false; | 331 defaultContextOptions.generateImplicitErrors = false; |
| 324 operationQueue = new ServerOperationQueue(); | 332 operationQueue = new ServerOperationQueue(); |
| 325 contextManager = new ContextManagerImpl( | 333 contextManager = new ContextManagerImpl( |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 /** | 1711 /** |
| 1704 * The [PerformanceTag] for time spent in server request handlers. | 1712 * The [PerformanceTag] for time spent in server request handlers. |
| 1705 */ | 1713 */ |
| 1706 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1714 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 1707 | 1715 |
| 1708 /** | 1716 /** |
| 1709 * The [PerformanceTag] for time spent in split store microtasks. | 1717 * The [PerformanceTag] for time spent in split store microtasks. |
| 1710 */ | 1718 */ |
| 1711 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1719 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 1712 } | 1720 } |
| OLD | NEW |