| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 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/server_plugin.dart'; | 12 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 13 import 'package:analyzer/file_system/memory_file_system.dart'; | 13 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 14 import 'package:analyzer/instrumentation/instrumentation.dart'; | 14 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 15 import 'package:analyzer/src/generated/engine.dart'; | 15 import 'package:analyzer/src/generated/engine.dart'; |
| 16 import 'package:analyzer/src/generated/sdk.dart'; | 16 import 'package:analyzer/src/generated/sdk.dart'; |
| 17 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| 17 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; | 18 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
| 18 import 'package:plugin/manager.dart'; | 19 import 'package:plugin/manager.dart'; |
| 19 import 'package:plugin/plugin.dart'; | 20 import 'package:plugin/plugin.dart'; |
| 20 import 'package:test/test.dart'; | 21 import 'package:test/test.dart'; |
| 21 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 22 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 22 | 23 |
| 23 import 'analysis_abstract.dart'; | 24 import 'analysis_abstract.dart'; |
| 24 import 'mock_sdk.dart'; | 25 import 'mock_sdk.dart'; |
| 25 import 'mocks.dart'; | 26 import 'mocks.dart'; |
| 26 | 27 |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 serverChannel = new MockServerChannel(); | 445 serverChannel = new MockServerChannel(); |
| 445 resourceProvider = new MemoryResourceProvider(); | 446 resourceProvider = new MemoryResourceProvider(); |
| 446 // Create an SDK in the mock file system. | 447 // Create an SDK in the mock file system. |
| 447 new MockSdk(resourceProvider: resourceProvider); | 448 new MockSdk(resourceProvider: resourceProvider); |
| 448 server = new AnalysisServer( | 449 server = new AnalysisServer( |
| 449 serverChannel, | 450 serverChannel, |
| 450 resourceProvider, | 451 resourceProvider, |
| 451 new MockPackageMapProvider(), | 452 new MockPackageMapProvider(), |
| 452 null, | 453 null, |
| 453 serverPlugin, | 454 serverPlugin, |
| 454 new AnalysisServerOptions(), | 455 new AnalysisServerOptions()..enableNewAnalysisDriver = true, |
| 455 new DartSdkManager('/', false), | 456 new DartSdkManager('/', false), |
| 456 InstrumentationService.NULL_SERVICE); | 457 InstrumentationService.NULL_SERVICE); |
| 457 handler = new AnalysisDomainHandler(server); | 458 handler = new AnalysisDomainHandler(server); |
| 458 // listen for notifications | 459 // listen for notifications |
| 459 Stream<Notification> notificationStream = | 460 Stream<Notification> notificationStream = |
| 460 serverChannel.notificationController.stream; | 461 serverChannel.notificationController.stream; |
| 461 notificationStream.listen((Notification notification) { | 462 notificationStream.listen((Notification notification) { |
| 462 if (notification.event == ANALYSIS_ERRORS) { | 463 if (notification.event == ANALYSIS_ERRORS) { |
| 463 var decoded = new AnalysisErrorsParams.fromNotification(notification); | 464 var decoded = new AnalysisErrorsParams.fromNotification(notification); |
| 464 filesErrors[decoded.file] = decoded.errors; | 465 filesErrors[decoded.file] = decoded.errors; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 plugin.AnalysisSetSubscriptionsParams params = | 813 plugin.AnalysisSetSubscriptionsParams params = |
| 813 pluginManager.analysisSetSubscriptionsParams; | 814 pluginManager.analysisSetSubscriptionsParams; |
| 814 expect(params, isNotNull); | 815 expect(params, isNotNull); |
| 815 Map<plugin.AnalysisService, List<String>> subscriptions = | 816 Map<plugin.AnalysisService, List<String>> subscriptions = |
| 816 params.subscriptions; | 817 params.subscriptions; |
| 817 expect(subscriptions, hasLength(1)); | 818 expect(subscriptions, hasLength(1)); |
| 818 List<String> files = subscriptions[plugin.AnalysisService.HIGHLIGHTS]; | 819 List<String> files = subscriptions[plugin.AnalysisService.HIGHLIGHTS]; |
| 819 expect(files, [testFile]); | 820 expect(files, [testFile]); |
| 820 } | 821 } |
| 821 } | 822 } |
| OLD | NEW |