| 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 // TODO(scheglov) add support for the "--no-error-notification" flag. | 813 // TODO(scheglov) add support for the "--no-error-notification" flag. |
| 814 return contextDirectoryManager.isInAnalysisRoot(file); | 814 return contextDirectoryManager.isInAnalysisRoot(file); |
| 815 } | 815 } |
| 816 | 816 |
| 817 void shutdown() { | 817 void shutdown() { |
| 818 running = false; | 818 running = false; |
| 819 if (index != null) { | 819 if (index != null) { |
| 820 index.clear(); | 820 index.clear(); |
| 821 index.stop(); | 821 index.stop(); |
| 822 } | 822 } |
| 823 // Defer closing the channel so that the shutdown response can be sent. | 823 // Defer closing the channel and shutting down the instrumentation server so |
| 824 new Future(channel.close); | 824 // that the shutdown response can be sent and logged. |
| 825 new Future(() { |
| 826 channel.close(); |
| 827 instrumentationServer.shutdown(); |
| 828 }); |
| 825 } | 829 } |
| 826 | 830 |
| 827 /** | 831 /** |
| 828 * Implementation for `analysis.updateContent`. | 832 * Implementation for `analysis.updateContent`. |
| 829 */ | 833 */ |
| 830 void updateContent(String id, Map<String, dynamic> changes) { | 834 void updateContent(String id, Map<String, dynamic> changes) { |
| 831 changes.forEach((file, change) { | 835 changes.forEach((file, change) { |
| 832 AnalysisContext analysisContext = getAnalysisContext(file); | 836 AnalysisContext analysisContext = getAnalysisContext(file); |
| 833 // TODO(paulberry): handle the case where a file is referred to by more | 837 // TODO(paulberry): handle the case where a file is referred to by more |
| 834 // than one context (e.g package A depends on package B using a local | 838 // than one context (e.g package A depends on package B using a local |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 * [packageUriResolver]. | 1051 * [packageUriResolver]. |
| 1048 */ | 1052 */ |
| 1049 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1053 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1050 List<UriResolver> resolvers = <UriResolver>[ | 1054 List<UriResolver> resolvers = <UriResolver>[ |
| 1051 new DartUriResolver(analysisServer.defaultSdk), | 1055 new DartUriResolver(analysisServer.defaultSdk), |
| 1052 new ResourceUriResolver(resourceProvider), | 1056 new ResourceUriResolver(resourceProvider), |
| 1053 packageUriResolver]; | 1057 packageUriResolver]; |
| 1054 return new SourceFactory(resolvers); | 1058 return new SourceFactory(resolvers); |
| 1055 } | 1059 } |
| 1056 } | 1060 } |
| OLD | NEW |