@@ -6,11 +6,8 @@ import 'dart:async';
66
77import 'package:analysis_server/protocol/protocol.dart' ;
88import 'package:analysis_server/src/channel/channel.dart' ;
9- import 'package:analysis_server/src/plugin/notification_manager.dart' ;
109import 'package:analysis_server/src/plugin/plugin_manager.dart' ;
1110import 'package:analyzer/dart/analysis/context_root.dart' as analyzer;
12- import 'package:analyzer/file_system/file_system.dart' ;
13- import 'package:analyzer/instrumentation/instrumentation.dart' ;
1411import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
1512import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
1613import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
@@ -161,34 +158,9 @@ class TestPluginManager implements PluginManager {
161158 StreamController <void > pluginsChangedController =
162159 StreamController .broadcast ();
163160
164- @override
165- String get byteStorePath {
166- fail ('Unexpected invocation of byteStorePath' );
167- }
168-
169- @override
170- InstrumentationService get instrumentationService {
171- fail ('Unexpected invocation of instrumentationService' );
172- }
173-
174- @override
175- AbstractNotificationManager get notificationManager {
176- fail ('Unexpected invocation of notificationManager' );
177- }
178-
179161 @override
180162 Stream <void > get pluginsChanged => pluginsChangedController.stream;
181163
182- @override
183- ResourceProvider get resourceProvider {
184- fail ('Unexpected invocation of resourceProvider' );
185- }
186-
187- @override
188- String get sdkPath {
189- fail ('Unexpected invocation of sdkPath' );
190- }
191-
192164 @override
193165 Future <void > addPluginToContextRoot (
194166 analyzer.ContextRoot contextRoot,
@@ -203,27 +175,19 @@ class TestPluginManager implements PluginManager {
203175 analyzer.ContextRoot ? contextRoot,
204176 }) {
205177 broadcastedRequest = params;
206- return handleRequest? .call (params) ??
207- broadcastResults ??
208- < PluginInfo , Future <plugin.Response >> {};
178+ return handleRequest? .call (params) ?? broadcastResults ?? {};
209179 }
210180
211181 @override
212182 Future <List <Future <plugin.Response >>> broadcastWatchEvent (
213183 WatchEvent watchEvent,
214184 ) async {
215- return < Future <plugin. Response > > [];
185+ return [];
216186 }
217187
218188 @override
219- PluginFiles filesFor (String pluginPath) {
220- fail ('Unexpected invocation of filesFor' );
221- }
222-
223- @override
224- List <PluginInfo > pluginsForContextRoot (analyzer.ContextRoot ? contextRoot) {
225- fail ('Unexpected invocation of pluginsForContextRoot' );
226- }
189+ dynamic noSuchMethod (Invocation invocation) =>
190+ fail ('Unexpected invocation of ${invocation .memberName }' );
227191
228192 @override
229193 void removedContextRoot (analyzer.ContextRoot contextRoot) {
@@ -233,7 +197,6 @@ class TestPluginManager implements PluginManager {
233197 @override
234198 Future <void > restartPlugins () async {
235199 // Nothing to restart.
236- return ;
237200 }
238201
239202 @override
@@ -256,9 +219,4 @@ class TestPluginManager implements PluginManager {
256219 ) {
257220 analysisUpdateContentParams = params;
258221 }
259-
260- @override
261- Future <List <void >> stopAll () async {
262- fail ('Unexpected invocation of stopAll' );
263- }
264222}
0 commit comments