Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: pkg/analysis_server/test/analysis_abstract.dart

Issue 2842013003: Add support for watch events and error notifications (Closed)
Patch Set: fix comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart' 7 import 'package:analysis_server/plugin/protocol/protocol.dart'
8 hide AnalysisOptions; 8 hide AnalysisOptions;
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
11 import 'package:analysis_server/src/domain_analysis.dart'; 11 import 'package:analysis_server/src/domain_analysis.dart';
12 import 'package:analysis_server/src/plugin/notification_manager.dart'; 12 import 'package:analysis_server/src/plugin/notification_manager.dart';
13 import 'package:analysis_server/src/plugin/plugin_manager.dart'; 13 import 'package:analysis_server/src/plugin/plugin_manager.dart';
14 import 'package:analysis_server/src/plugin/server_plugin.dart'; 14 import 'package:analysis_server/src/plugin/server_plugin.dart';
15 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi n.dart'; 15 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi n.dart';
16 import 'package:analysis_server/src/services/index/index.dart'; 16 import 'package:analysis_server/src/services/index/index.dart';
17 import 'package:analyzer/context/context_root.dart' as analyzer; 17 import 'package:analyzer/context/context_root.dart' as analyzer;
18 import 'package:analyzer/file_system/file_system.dart'; 18 import 'package:analyzer/file_system/file_system.dart';
19 import 'package:analyzer/file_system/memory_file_system.dart'; 19 import 'package:analyzer/file_system/memory_file_system.dart';
20 import 'package:analyzer/instrumentation/instrumentation.dart'; 20 import 'package:analyzer/instrumentation/instrumentation.dart';
21 import 'package:analyzer/src/dart/analysis/driver.dart'; 21 import 'package:analyzer/src/dart/analysis/driver.dart';
22 import 'package:analyzer/src/generated/engine.dart'; 22 import 'package:analyzer/src/generated/engine.dart';
23 import 'package:analyzer/src/generated/sdk.dart'; 23 import 'package:analyzer/src/generated/sdk.dart';
24 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; 24 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
25 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; 25 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
26 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; 26 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
27 import 'package:plugin/manager.dart'; 27 import 'package:plugin/manager.dart';
28 import 'package:plugin/plugin.dart'; 28 import 'package:plugin/plugin.dart';
29 import 'package:test/test.dart'; 29 import 'package:test/test.dart';
30 import 'package:watcher/src/watch_event.dart';
scheglov 2017/04/26 15:55:18 Maybe package:watcher/watcher.dart?
Brian Wilkerson 2017/04/26 16:35:55 Done (We really need to fix the quick fixes, etc.
30 31
31 import 'mock_sdk.dart'; 32 import 'mock_sdk.dart';
32 import 'mocks.dart'; 33 import 'mocks.dart';
33 34
34 int findIdentifierLength(String search) { 35 int findIdentifierLength(String search) {
35 int length = 0; 36 int length = 0;
36 while (length < search.length) { 37 while (length < search.length) {
37 int c = search.codeUnitAt(length); 38 int c = search.codeUnitAt(length);
38 if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) || 39 if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
39 c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) || 40 c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 302 }
302 303
303 @override 304 @override
304 Future<Null> addPluginToContextRoot( 305 Future<Null> addPluginToContextRoot(
305 analyzer.ContextRoot contextRoot, String path) async { 306 analyzer.ContextRoot contextRoot, String path) async {
306 fail('Unexpected invocation of addPluginToContextRoot'); 307 fail('Unexpected invocation of addPluginToContextRoot');
307 return null; 308 return null;
308 } 309 }
309 310
310 @override 311 @override
311 Map<PluginInfo, Future<plugin.Response>> broadcast( 312 Map<PluginInfo, Future<plugin.Response>> broadcastRequest(
312 analyzer.ContextRoot contextRoot, plugin.RequestParams params) { 313 analyzer.ContextRoot contextRoot, plugin.RequestParams params) {
313 return broadcastResults ?? <PluginInfo, Future<plugin.Response>>{}; 314 return broadcastResults ?? <PluginInfo, Future<plugin.Response>>{};
314 } 315 }
315 316
316 @override 317 @override
318 Future<List<Future<plugin.Response>>> broadcastWatchEvent(
319 WatchEvent watchEvent) async {
320 return <Future<plugin.Response>>[];
321 }
322
323 @override
317 List<PluginInfo> pluginsForContextRoot(analyzer.ContextRoot contextRoot) { 324 List<PluginInfo> pluginsForContextRoot(analyzer.ContextRoot contextRoot) {
318 fail('Unexpected invocation of pluginsForContextRoot'); 325 fail('Unexpected invocation of pluginsForContextRoot');
319 return null; 326 return null;
320 } 327 }
321 328
322 @override 329 @override
323 void removedContextRoot(analyzer.ContextRoot contextRoot) { 330 void removedContextRoot(analyzer.ContextRoot contextRoot) {
324 fail('Unexpected invocation of removedContextRoot'); 331 fail('Unexpected invocation of removedContextRoot');
325 } 332 }
326 333
(...skipping 14 matching lines...) Expand all
341 plugin.AnalysisUpdateContentParams params) { 348 plugin.AnalysisUpdateContentParams params) {
342 analysisUpdateContentParams = params; 349 analysisUpdateContentParams = params;
343 } 350 }
344 351
345 @override 352 @override
346 Future<List<Null>> stopAll() async { 353 Future<List<Null>> stopAll() async {
347 fail('Unexpected invocation of stopAll'); 354 fail('Unexpected invocation of stopAll');
348 return null; 355 return null;
349 } 356 }
350 } 357 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698