| 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 void updateContextPackageUriResolver(Folder contextFolder, | 1050 void updateContextPackageUriResolver(Folder contextFolder, |
| 1051 UriResolver packageUriResolver) { | 1051 UriResolver packageUriResolver) { |
| 1052 AnalysisContext context = analysisServer.folderMap[contextFolder]; | 1052 AnalysisContext context = analysisServer.folderMap[contextFolder]; |
| 1053 context.sourceFactory = _createSourceFactory(packageUriResolver); | 1053 context.sourceFactory = _createSourceFactory(packageUriResolver); |
| 1054 _onContextsChangedController.add( | 1054 _onContextsChangedController.add( |
| 1055 new ContextsChangedEvent(changed: [context])); | 1055 new ContextsChangedEvent(changed: [context])); |
| 1056 analysisServer.schedulePerformAnalysisOperation(context); | 1056 analysisServer.schedulePerformAnalysisOperation(context); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 void _computingPackageMap(bool computing) { | 1059 void _computingPackageMap(bool computing) { |
| 1060 PubStatus pubStatus = new PubStatus(computing); | 1060 if (analysisServer.serverServices.contains(ServerService.STATUS)) { |
| 1061 ServerStatusParams params = new ServerStatusParams(pub: pubStatus); | 1061 PubStatus pubStatus = new PubStatus(computing); |
| 1062 analysisServer.sendNotification(params.toNotification()); | 1062 ServerStatusParams params = new ServerStatusParams(pub: pubStatus); |
| 1063 analysisServer.sendNotification(params.toNotification()); |
| 1064 } |
| 1063 } | 1065 } |
| 1064 | 1066 |
| 1065 /** | 1067 /** |
| 1066 * Set up a [SourceFactory] that resolves packages using the given | 1068 * Set up a [SourceFactory] that resolves packages using the given |
| 1067 * [packageUriResolver]. | 1069 * [packageUriResolver]. |
| 1068 */ | 1070 */ |
| 1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1071 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1070 List<UriResolver> resolvers = <UriResolver>[ | 1072 List<UriResolver> resolvers = <UriResolver>[ |
| 1071 new DartUriResolver(analysisServer.defaultSdk), | 1073 new DartUriResolver(analysisServer.defaultSdk), |
| 1072 new ResourceUriResolver(resourceProvider), | 1074 new ResourceUriResolver(resourceProvider), |
| 1073 packageUriResolver]; | 1075 packageUriResolver]; |
| 1074 return new SourceFactory(resolvers); | 1076 return new SourceFactory(resolvers); |
| 1075 } | 1077 } |
| 1076 } | 1078 } |
| OLD | NEW |