| 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:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 * This method is called when analysis of the given [AnalysisContext] is | 686 * This method is called when analysis of the given [AnalysisContext] is |
| 687 * cancelled. | 687 * cancelled. |
| 688 */ | 688 */ |
| 689 void sendContextAnalysisCancelledNotifications(AnalysisContext context, String
message) { | 689 void sendContextAnalysisCancelledNotifications(AnalysisContext context, String
message) { |
| 690 Completer completer = contextAnalysisDoneCompleters.remove(context); | 690 Completer completer = contextAnalysisDoneCompleters.remove(context); |
| 691 if (completer != null) { | 691 if (completer != null) { |
| 692 completer.completeError(message); | 692 completer.completeError(message); |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 | 695 |
| 696 void shutdown() { |
| 697 running = false; |
| 698 if (index != null) { |
| 699 index.clear(); |
| 700 index.stop(); |
| 701 } |
| 702 } |
| 703 |
| 696 /** | 704 /** |
| 697 * Return the [CompilationUnit] of the Dart file with the given [path]. | 705 * Return the [CompilationUnit] of the Dart file with the given [path]. |
| 698 * Return `null` if the file is not a part of any context. | 706 * Return `null` if the file is not a part of any context. |
| 699 */ | 707 */ |
| 700 CompilationUnit test_getResolvedCompilationUnit(String path) { | 708 CompilationUnit test_getResolvedCompilationUnit(String path) { |
| 701 // prepare AnalysisContext | 709 // prepare AnalysisContext |
| 702 AnalysisContext context = getAnalysisContext(path); | 710 AnalysisContext context = getAnalysisContext(path); |
| 703 if (context == null) { | 711 if (context == null) { |
| 704 return null; | 712 return null; |
| 705 } | 713 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 /** | 760 /** |
| 753 * An enumeration of the services provided by the server domain. | 761 * An enumeration of the services provided by the server domain. |
| 754 */ | 762 */ |
| 755 class ServerService extends Enum2<ServerService> { | 763 class ServerService extends Enum2<ServerService> { |
| 756 static const ServerService STATUS = const ServerService('STATUS', 0); | 764 static const ServerService STATUS = const ServerService('STATUS', 0); |
| 757 | 765 |
| 758 static const List<ServerService> VALUES = const [STATUS]; | 766 static const List<ServerService> VALUES = const [STATUS]; |
| 759 | 767 |
| 760 const ServerService(String name, int ordinal) : super(name, ordinal); | 768 const ServerService(String name, int ordinal) : super(name, ordinal); |
| 761 } | 769 } |
| OLD | NEW |