| 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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 completer.completeError(message); | 694 completer.completeError(message); |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 | 697 |
| 698 void shutdown() { | 698 void shutdown() { |
| 699 running = false; | 699 running = false; |
| 700 if (index != null) { | 700 if (index != null) { |
| 701 index.clear(); | 701 index.clear(); |
| 702 index.stop(); | 702 index.stop(); |
| 703 } | 703 } |
| 704 // Defer closing the channel so that the shutdown response can be sent. |
| 705 new Future(channel.close); |
| 704 } | 706 } |
| 705 | 707 |
| 706 /** | 708 /** |
| 707 * Return the [CompilationUnit] of the Dart file with the given [path]. | 709 * Return the [CompilationUnit] of the Dart file with the given [path]. |
| 708 * Return `null` if the file is not a part of any context. | 710 * Return `null` if the file is not a part of any context. |
| 709 */ | 711 */ |
| 710 CompilationUnit test_getResolvedCompilationUnit(String path) { | 712 CompilationUnit test_getResolvedCompilationUnit(String path) { |
| 711 // prepare AnalysisContext | 713 // prepare AnalysisContext |
| 712 AnalysisContext context = getAnalysisContext(path); | 714 AnalysisContext context = getAnalysisContext(path); |
| 713 if (context == null) { | 715 if (context == null) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 /** | 790 /** |
| 789 * An enumeration of the services provided by the server domain. | 791 * An enumeration of the services provided by the server domain. |
| 790 */ | 792 */ |
| 791 class ServerService extends Enum2<ServerService> { | 793 class ServerService extends Enum2<ServerService> { |
| 792 static const ServerService STATUS = const ServerService('STATUS', 0); | 794 static const ServerService STATUS = const ServerService('STATUS', 0); |
| 793 | 795 |
| 794 static const List<ServerService> VALUES = const [STATUS]; | 796 static const List<ServerService> VALUES = const [STATUS]; |
| 795 | 797 |
| 796 const ServerService(String name, int ordinal) : super(name, ordinal); | 798 const ServerService(String name, int ordinal) : super(name, ordinal); |
| 797 } | 799 } |
| OLD | NEW |