| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 AnalysisServer(this.channel, this.resourceProvider, | 185 AnalysisServer(this.channel, this.resourceProvider, |
| 186 PackageMapProvider packageMapProvider, this.index, | 186 PackageMapProvider packageMapProvider, this.index, |
| 187 AnalysisServerOptions analysisServerOptions, this.defaultSdk, | 187 AnalysisServerOptions analysisServerOptions, this.defaultSdk, |
| 188 {this.rethrowExceptions: true}) { | 188 {this.rethrowExceptions: true}) { |
| 189 searchEngine = createSearchEngine(index); | 189 searchEngine = createSearchEngine(index); |
| 190 operationQueue = new ServerOperationQueue(this); | 190 operationQueue = new ServerOperationQueue(this); |
| 191 contextDirectoryManager = | 191 contextDirectoryManager = |
| 192 new ServerContextManager(this, resourceProvider, packageMapProvider); | 192 new ServerContextManager(this, resourceProvider, packageMapProvider); |
| 193 contextDirectoryManager.defaultOptions.incremental = | 193 contextDirectoryManager.defaultOptions.incremental = |
| 194 analysisServerOptions.enableIncrementalResolution; | 194 analysisServerOptions.enableIncrementalResolution; |
| 195 contextDirectoryManager.defaultOptions.incrementalApi = |
| 196 analysisServerOptions.enableIncrementalResolutionApi; |
| 195 AnalysisEngine.instance.logger = new AnalysisLogger(); | 197 AnalysisEngine.instance.logger = new AnalysisLogger(); |
| 196 _onAnalysisStartedController = new StreamController.broadcast(); | 198 _onAnalysisStartedController = new StreamController.broadcast(); |
| 197 _onAnalysisCompleteController = new StreamController.broadcast(); | 199 _onAnalysisCompleteController = new StreamController.broadcast(); |
| 198 _onFileAnalyzedController = new StreamController.broadcast(); | 200 _onFileAnalyzedController = new StreamController.broadcast(); |
| 199 _onPriorityChangeController = | 201 _onPriorityChangeController = |
| 200 new StreamController<PriorityChangeEvent>.broadcast(); | 202 new StreamController<PriorityChangeEvent>.broadcast(); |
| 201 running = true; | 203 running = true; |
| 202 Notification notification = new ServerConnectedParams().toNotification(); | 204 Notification notification = new ServerConnectedParams().toNotification(); |
| 203 channel.sendNotification(notification); | 205 channel.sendNotification(notification); |
| 204 channel.listen(handleRequest, onDone: done, onError: error); | 206 channel.listen(handleRequest, onDone: done, onError: error); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 new ServerErrorParams( | 913 new ServerErrorParams( |
| 912 true, | 914 true, |
| 913 exceptionString, | 915 exceptionString, |
| 914 stackTraceString).toNotification()); | 916 stackTraceString).toNotification()); |
| 915 } | 917 } |
| 916 } | 918 } |
| 917 | 919 |
| 918 | 920 |
| 919 class AnalysisServerOptions { | 921 class AnalysisServerOptions { |
| 920 bool enableIncrementalResolution = false; | 922 bool enableIncrementalResolution = false; |
| 923 bool enableIncrementalResolutionApi = false; |
| 921 } | 924 } |
| 922 | 925 |
| 923 /** | 926 /** |
| 924 * A [ContextsChangedEvent] indicate what contexts were added or removed. | 927 * A [ContextsChangedEvent] indicate what contexts were added or removed. |
| 925 * | 928 * |
| 926 * No context should be added to the event more than once. It does not make | 929 * No context should be added to the event more than once. It does not make |
| 927 * sense, for example, for a context to be both added and removed. | 930 * sense, for example, for a context to be both added and removed. |
| 928 */ | 931 */ |
| 929 class ContextsChangedEvent { | 932 class ContextsChangedEvent { |
| 930 | 933 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 * [packageUriResolver]. | 1034 * [packageUriResolver]. |
| 1032 */ | 1035 */ |
| 1033 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1036 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1034 List<UriResolver> resolvers = <UriResolver>[ | 1037 List<UriResolver> resolvers = <UriResolver>[ |
| 1035 new DartUriResolver(analysisServer.defaultSdk), | 1038 new DartUriResolver(analysisServer.defaultSdk), |
| 1036 new ResourceUriResolver(resourceProvider), | 1039 new ResourceUriResolver(resourceProvider), |
| 1037 packageUriResolver]; | 1040 packageUriResolver]; |
| 1038 return new SourceFactory(resolvers); | 1041 return new SourceFactory(resolvers); |
| 1039 } | 1042 } |
| 1040 } | 1043 } |
| OLD | NEW |