| 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'; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 PackageMapProvider packageMapProvider, this.index, | 192 PackageMapProvider packageMapProvider, this.index, |
| 193 AnalysisServerOptions analysisServerOptions, this.defaultSdk, | 193 AnalysisServerOptions analysisServerOptions, this.defaultSdk, |
| 194 this.instrumentationService, {this.rethrowExceptions: true}) { | 194 this.instrumentationService, {this.rethrowExceptions: true}) { |
| 195 searchEngine = createSearchEngine(index); | 195 searchEngine = createSearchEngine(index); |
| 196 operationQueue = new ServerOperationQueue(this); | 196 operationQueue = new ServerOperationQueue(this); |
| 197 contextDirectoryManager = | 197 contextDirectoryManager = |
| 198 new ServerContextManager(this, resourceProvider, packageMapProvider); | 198 new ServerContextManager(this, resourceProvider, packageMapProvider); |
| 199 contextDirectoryManager.defaultOptions.incremental = true; | 199 contextDirectoryManager.defaultOptions.incremental = true; |
| 200 contextDirectoryManager.defaultOptions.incrementalApi = | 200 contextDirectoryManager.defaultOptions.incrementalApi = |
| 201 analysisServerOptions.enableIncrementalResolutionApi; | 201 analysisServerOptions.enableIncrementalResolutionApi; |
| 202 contextDirectoryManager.defaultOptions.incrementalValidation = |
| 203 analysisServerOptions.enableIncrementalResolutionValidation; |
| 202 AnalysisEngine.instance.logger = new AnalysisLogger(); | 204 AnalysisEngine.instance.logger = new AnalysisLogger(); |
| 203 _onAnalysisStartedController = new StreamController.broadcast(); | 205 _onAnalysisStartedController = new StreamController.broadcast(); |
| 204 _onAnalysisCompleteController = new StreamController.broadcast(); | 206 _onAnalysisCompleteController = new StreamController.broadcast(); |
| 205 _onFileAnalyzedController = new StreamController.broadcast(); | 207 _onFileAnalyzedController = new StreamController.broadcast(); |
| 206 _onPriorityChangeController = | 208 _onPriorityChangeController = |
| 207 new StreamController<PriorityChangeEvent>.broadcast(); | 209 new StreamController<PriorityChangeEvent>.broadcast(); |
| 208 running = true; | 210 running = true; |
| 209 Notification notification = new ServerConnectedParams().toNotification(); | 211 Notification notification = new ServerConnectedParams().toNotification(); |
| 210 channel.sendNotification(notification); | 212 channel.sendNotification(notification); |
| 211 channel.listen(handleRequest, onDone: done, onError: error); | 213 channel.listen(handleRequest, onDone: done, onError: error); |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 new ServerErrorParams( | 939 new ServerErrorParams( |
| 938 true, | 940 true, |
| 939 exceptionString, | 941 exceptionString, |
| 940 stackTraceString).toNotification()); | 942 stackTraceString).toNotification()); |
| 941 } | 943 } |
| 942 } | 944 } |
| 943 | 945 |
| 944 | 946 |
| 945 class AnalysisServerOptions { | 947 class AnalysisServerOptions { |
| 946 bool enableIncrementalResolutionApi = false; | 948 bool enableIncrementalResolutionApi = false; |
| 949 bool enableIncrementalResolutionValidation = false; |
| 947 } | 950 } |
| 948 | 951 |
| 949 /** | 952 /** |
| 950 * A [ContextsChangedEvent] indicate what contexts were added or removed. | 953 * A [ContextsChangedEvent] indicate what contexts were added or removed. |
| 951 * | 954 * |
| 952 * No context should be added to the event more than once. It does not make | 955 * No context should be added to the event more than once. It does not make |
| 953 * sense, for example, for a context to be both added and removed. | 956 * sense, for example, for a context to be both added and removed. |
| 954 */ | 957 */ |
| 955 class ContextsChangedEvent { | 958 class ContextsChangedEvent { |
| 956 | 959 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 * [packageUriResolver]. | 1079 * [packageUriResolver]. |
| 1077 */ | 1080 */ |
| 1078 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1081 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1079 List<UriResolver> resolvers = <UriResolver>[ | 1082 List<UriResolver> resolvers = <UriResolver>[ |
| 1080 new DartUriResolver(analysisServer.defaultSdk), | 1083 new DartUriResolver(analysisServer.defaultSdk), |
| 1081 new ResourceUriResolver(resourceProvider), | 1084 new ResourceUriResolver(resourceProvider), |
| 1082 packageUriResolver]; | 1085 packageUriResolver]; |
| 1083 return new SourceFactory(resolvers); | 1086 return new SourceFactory(resolvers); |
| 1084 } | 1087 } |
| 1085 } | 1088 } |
| OLD | NEW |