| 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 | 9 |
| 10 import 'package:analysis_server/src/analysis_logger.dart'; | 10 import 'package:analysis_server/src/analysis_logger.dart'; |
| 11 import 'package:analysis_server/src/channel/channel.dart'; | 11 import 'package:analysis_server/src/channel/channel.dart'; |
| 12 import 'package:analysis_server/src/context_manager.dart'; | 12 import 'package:analysis_server/src/context_manager.dart'; |
| 13 import 'package:analysis_server/src/operation/operation.dart'; | 13 import 'package:analysis_server/src/operation/operation.dart'; |
| 14 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 14 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
| 15 import 'package:analysis_server/src/operation/operation_queue.dart'; | 15 import 'package:analysis_server/src/operation/operation_queue.dart'; |
| 16 import 'package:analysis_server/src/protocol.dart' hide Element; | 16 import 'package:analysis_server/src/protocol.dart' hide Element; |
| 17 import 'package:analysis_server/src/services/correction/namespace.dart'; | 17 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 18 import 'package:analysis_server/src/services/index/index.dart'; | 18 import 'package:analysis_server/src/services/index/index.dart'; |
| 19 import 'package:analysis_server/src/services/search/search_engine.dart'; | 19 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 20 import 'package:analyzer/file_system/file_system.dart'; | 20 import 'package:analyzer/file_system/file_system.dart'; |
| 21 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 21 import 'package:analyzer/source/package_map_provider.dart'; | 22 import 'package:analyzer/source/package_map_provider.dart'; |
| 22 import 'package:analyzer/src/generated/ast.dart'; | 23 import 'package:analyzer/src/generated/ast.dart'; |
| 23 import 'package:analyzer/src/generated/element.dart'; | 24 import 'package:analyzer/src/generated/element.dart'; |
| 24 import 'package:analyzer/src/generated/engine.dart'; | 25 import 'package:analyzer/src/generated/engine.dart'; |
| 25 import 'package:analyzer/src/generated/java_engine.dart'; | 26 import 'package:analyzer/src/generated/java_engine.dart'; |
| 26 import 'package:analyzer/src/generated/sdk.dart'; | 27 import 'package:analyzer/src/generated/sdk.dart'; |
| 27 import 'package:analyzer/src/generated/source.dart'; | 28 import 'package:analyzer/src/generated/source.dart'; |
| 28 import 'package:analyzer/src/generated/source_io.dart'; | 29 import 'package:analyzer/src/generated/source_io.dart'; |
| 29 | 30 |
| 30 | 31 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 * server. | 107 * server. |
| 107 */ | 108 */ |
| 108 List<RequestHandler> handlers; | 109 List<RequestHandler> handlers; |
| 109 | 110 |
| 110 /** | 111 /** |
| 111 * The current default [DartSdk]. | 112 * The current default [DartSdk]. |
| 112 */ | 113 */ |
| 113 final DartSdk defaultSdk; | 114 final DartSdk defaultSdk; |
| 114 | 115 |
| 115 /** | 116 /** |
| 117 * The instrumentation server that is to be used by this analysis server. |
| 118 */ |
| 119 final InstrumentationServer instrumentationServer; |
| 120 |
| 121 /** |
| 116 * A table mapping [Folder]s to the [AnalysisContext]s associated with them. | 122 * A table mapping [Folder]s to the [AnalysisContext]s associated with them. |
| 117 */ | 123 */ |
| 118 final Map<Folder, AnalysisContext> folderMap = | 124 final Map<Folder, AnalysisContext> folderMap = |
| 119 new HashMap<Folder, AnalysisContext>(); | 125 new HashMap<Folder, AnalysisContext>(); |
| 120 | 126 |
| 121 /** | 127 /** |
| 122 * A queue of the operations to perform in this server. | 128 * A queue of the operations to perform in this server. |
| 123 */ | 129 */ |
| 124 ServerOperationQueue operationQueue; | 130 ServerOperationQueue operationQueue; |
| 125 | 131 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 * responses to the given [channel]. | 184 * responses to the given [channel]. |
| 179 * | 185 * |
| 180 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are | 186 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are |
| 181 * propagated up the call stack. The default is true to allow analysis | 187 * propagated up the call stack. The default is true to allow analysis |
| 182 * exceptions to show up in unit tests, but it should be set to false when | 188 * exceptions to show up in unit tests, but it should be set to false when |
| 183 * running a full analysis server. | 189 * running a full analysis server. |
| 184 */ | 190 */ |
| 185 AnalysisServer(this.channel, this.resourceProvider, | 191 AnalysisServer(this.channel, this.resourceProvider, |
| 186 PackageMapProvider packageMapProvider, this.index, | 192 PackageMapProvider packageMapProvider, this.index, |
| 187 AnalysisServerOptions analysisServerOptions, this.defaultSdk, | 193 AnalysisServerOptions analysisServerOptions, this.defaultSdk, |
| 188 {this.rethrowExceptions: true}) { | 194 this.instrumentationServer, {this.rethrowExceptions: true}) { |
| 189 searchEngine = createSearchEngine(index); | 195 searchEngine = createSearchEngine(index); |
| 190 operationQueue = new ServerOperationQueue(this); | 196 operationQueue = new ServerOperationQueue(this); |
| 191 contextDirectoryManager = | 197 contextDirectoryManager = |
| 192 new ServerContextManager(this, resourceProvider, packageMapProvider); | 198 new ServerContextManager(this, resourceProvider, packageMapProvider); |
| 193 contextDirectoryManager.defaultOptions.incremental = | 199 contextDirectoryManager.defaultOptions.incremental = |
| 194 analysisServerOptions.enableIncrementalResolution; | 200 analysisServerOptions.enableIncrementalResolution; |
| 195 contextDirectoryManager.defaultOptions.incrementalApi = | 201 contextDirectoryManager.defaultOptions.incrementalApi = |
| 196 analysisServerOptions.enableIncrementalResolutionApi; | 202 analysisServerOptions.enableIncrementalResolutionApi; |
| 197 AnalysisEngine.instance.logger = new AnalysisLogger(); | 203 AnalysisEngine.instance.logger = new AnalysisLogger(); |
| 198 _onAnalysisStartedController = new StreamController.broadcast(); | 204 _onAnalysisStartedController = new StreamController.broadcast(); |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 * [packageUriResolver]. | 1047 * [packageUriResolver]. |
| 1042 */ | 1048 */ |
| 1043 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1049 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1044 List<UriResolver> resolvers = <UriResolver>[ | 1050 List<UriResolver> resolvers = <UriResolver>[ |
| 1045 new DartUriResolver(analysisServer.defaultSdk), | 1051 new DartUriResolver(analysisServer.defaultSdk), |
| 1046 new ResourceUriResolver(resourceProvider), | 1052 new ResourceUriResolver(resourceProvider), |
| 1047 packageUriResolver]; | 1053 packageUriResolver]; |
| 1048 return new SourceFactory(resolvers); | 1054 return new SourceFactory(resolvers); |
| 1049 } | 1055 } |
| 1050 } | 1056 } |
| OLD | NEW |