OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 | 7 |
8 import 'package:analyzer/file_system/file_system.dart'; | 8 import 'package:analyzer/file_system/file_system.dart'; |
9 import 'package:analyzer/src/dart/analysis/driver.dart'; | 9 import 'package:analyzer/src/dart/analysis/driver.dart'; |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 Completer<Response> completer = completers.remove(response.id); | 113 Completer<Response> completer = completers.remove(response.id); |
114 completer.complete(response); | 114 completer.complete(response); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 /** | 118 /** |
119 * A concrete implementation of a server plugin that is suitable for testing. | 119 * A concrete implementation of a server plugin that is suitable for testing. |
120 */ | 120 */ |
121 class MockServerPlugin extends ServerPlugin { | 121 class MockServerPlugin extends ServerPlugin { |
122 MockChannel mockChannel = new MockChannel(); | |
123 | |
124 MockServerPlugin(ResourceProvider resourceProvider) : super(resourceProvider); | 122 MockServerPlugin(ResourceProvider resourceProvider) : super(resourceProvider); |
125 | 123 |
126 @override | 124 @override |
127 PluginCommunicationChannel get channel => mockChannel; | |
128 | |
129 @override | |
130 List<String> get fileGlobsToAnalyze => <String>['*.dart']; | 125 List<String> get fileGlobsToAnalyze => <String>['*.dart']; |
131 | 126 |
132 @override | 127 @override |
133 String get name => 'Test Plugin'; | 128 String get name => 'Test Plugin'; |
134 | 129 |
135 @override | 130 @override |
136 String get version => '0.1.0'; | 131 String get version => '0.1.0'; |
137 | 132 |
138 @override | 133 @override |
139 AnalysisDriverGeneric createAnalysisDriver(ContextRoot contextRoot) { | 134 AnalysisDriverGeneric createAnalysisDriver(ContextRoot contextRoot) { |
(...skipping 28 matching lines...) Expand all Loading... |
168 | 163 |
169 @override | 164 @override |
170 Uri get uri => Uri.parse('package:test/test.dart'); | 165 Uri get uri => Uri.parse('package:test/test.dart'); |
171 | 166 |
172 @override | 167 @override |
173 UriKind get uriKind => UriKind.PACKAGE_URI; | 168 UriKind get uriKind => UriKind.PACKAGE_URI; |
174 | 169 |
175 @override | 170 @override |
176 bool exists() => true; | 171 bool exists() => true; |
177 } | 172 } |
OLD | NEW |