| 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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 void removeContext(Folder folder) { | 1035 void removeContext(Folder folder) { |
| 1036 AnalysisContext context = analysisServer.folderMap.remove(folder); | 1036 AnalysisContext context = analysisServer.folderMap.remove(folder); |
| 1037 if (analysisServer.index != null) { | 1037 if (analysisServer.index != null) { |
| 1038 analysisServer.index.removeContext(context); | 1038 analysisServer.index.removeContext(context); |
| 1039 } | 1039 } |
| 1040 _onContextsChangedController.add( | 1040 _onContextsChangedController.add( |
| 1041 new ContextsChangedEvent(removed: [context])); | 1041 new ContextsChangedEvent(removed: [context])); |
| 1042 analysisServer.sendContextAnalysisDoneNotifications( | 1042 analysisServer.sendContextAnalysisDoneNotifications( |
| 1043 context, | 1043 context, |
| 1044 AnalysisDoneReason.CONTEXT_REMOVED); | 1044 AnalysisDoneReason.CONTEXT_REMOVED); |
| 1045 context.dispose(); |
| 1045 } | 1046 } |
| 1046 | 1047 |
| 1047 @override | 1048 @override |
| 1048 void updateContextPackageUriResolver(Folder contextFolder, | 1049 void updateContextPackageUriResolver(Folder contextFolder, |
| 1049 UriResolver packageUriResolver) { | 1050 UriResolver packageUriResolver) { |
| 1050 AnalysisContext context = analysisServer.folderMap[contextFolder]; | 1051 AnalysisContext context = analysisServer.folderMap[contextFolder]; |
| 1051 context.sourceFactory = _createSourceFactory(packageUriResolver); | 1052 context.sourceFactory = _createSourceFactory(packageUriResolver); |
| 1052 _onContextsChangedController.add( | 1053 _onContextsChangedController.add( |
| 1053 new ContextsChangedEvent(changed: [context])); | 1054 new ContextsChangedEvent(changed: [context])); |
| 1054 analysisServer.schedulePerformAnalysisOperation(context); | 1055 analysisServer.schedulePerformAnalysisOperation(context); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1067 * [packageUriResolver]. | 1068 * [packageUriResolver]. |
| 1068 */ | 1069 */ |
| 1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1070 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1070 List<UriResolver> resolvers = <UriResolver>[ | 1071 List<UriResolver> resolvers = <UriResolver>[ |
| 1071 new DartUriResolver(analysisServer.defaultSdk), | 1072 new DartUriResolver(analysisServer.defaultSdk), |
| 1072 new ResourceUriResolver(resourceProvider), | 1073 new ResourceUriResolver(resourceProvider), |
| 1073 packageUriResolver]; | 1074 packageUriResolver]; |
| 1074 return new SourceFactory(resolvers); | 1075 return new SourceFactory(resolvers); |
| 1075 } | 1076 } |
| 1076 } | 1077 } |
| OLD | NEW |