| 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 test.domain.completion; | 5 library test.domain.completion; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/completion/completion_core.dart' | 9 import 'package:analysis_server/completion/completion_core.dart' |
| 10 show CompletionRequest, CompletionResult; | 10 show CompletionRequest, CompletionResult; |
| 11 import 'package:analysis_server/src/analysis_server.dart'; | 11 import 'package:analysis_server/src/analysis_server.dart'; |
| 12 import 'package:analysis_server/src/channel/channel.dart'; | 12 import 'package:analysis_server/src/channel/channel.dart'; |
| 13 import 'package:analysis_server/src/constants.dart'; | 13 import 'package:analysis_server/src/constants.dart'; |
| 14 import 'package:analysis_server/src/context_manager.dart'; | 14 import 'package:analysis_server/src/context_manager.dart'; |
| 15 import 'package:analysis_server/src/domain_analysis.dart'; | 15 import 'package:analysis_server/src/domain_analysis.dart'; |
| 16 import 'package:analysis_server/src/domain_completion.dart'; | 16 import 'package:analysis_server/src/domain_completion.dart'; |
| 17 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 17 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 18 import 'package:analysis_server/src/protocol.dart'; | 18 import 'package:analysis_server/src/protocol.dart'; |
| 19 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 19 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| 20 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 20 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 21 import 'package:analysis_server/src/services/index/index.dart' show Index; | 21 import 'package:analysis_server/src/services/index/index.dart' show Index; |
| 22 import 'package:analysis_server/src/services/index/local_memory_index.dart'; | 22 import 'package:analysis_server/src/services/index/local_memory_index.dart'; |
| 23 import 'package:analysis_server/src/services/search/search_engine.dart'; | 23 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 24 import 'package:analysis_server/src/source/optimizing_pub_package_map_provider.d
art'; | |
| 25 import 'package:analyzer/file_system/file_system.dart'; | 24 import 'package:analyzer/file_system/file_system.dart'; |
| 26 import 'package:analyzer/instrumentation/instrumentation.dart'; | 25 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 26 import 'package:analyzer/source/pub_package_map_provider.dart'; |
| 27 import 'package:analyzer/src/generated/engine.dart'; | 27 import 'package:analyzer/src/generated/engine.dart'; |
| 28 import 'package:analyzer/src/generated/sdk.dart'; | 28 import 'package:analyzer/src/generated/sdk.dart'; |
| 29 import 'package:analyzer/src/generated/source.dart'; | 29 import 'package:analyzer/src/generated/source.dart'; |
| 30 import 'package:plugin/manager.dart'; | 30 import 'package:plugin/manager.dart'; |
| 31 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 31 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 32 import 'package:unittest/unittest.dart'; | 32 import 'package:unittest/unittest.dart'; |
| 33 | 33 |
| 34 import 'analysis_abstract.dart'; | 34 import 'analysis_abstract.dart'; |
| 35 import 'mock_sdk.dart'; | 35 import 'mock_sdk.dart'; |
| 36 import 'mocks.dart'; | 36 import 'mocks.dart'; |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 } | 650 } |
| 651 | 651 |
| 652 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 652 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 653 } | 653 } |
| 654 | 654 |
| 655 class Test_AnalysisServer extends AnalysisServer { | 655 class Test_AnalysisServer extends AnalysisServer { |
| 656 final MockContext mockContext = new MockContext(); | 656 final MockContext mockContext = new MockContext(); |
| 657 | 657 |
| 658 Test_AnalysisServer(ServerCommunicationChannel channel, | 658 Test_AnalysisServer(ServerCommunicationChannel channel, |
| 659 ResourceProvider resourceProvider, | 659 ResourceProvider resourceProvider, |
| 660 OptimizingPubPackageMapProvider packageMapProvider, Index index, | 660 PubPackageMapProvider packageMapProvider, Index index, |
| 661 ServerPlugin serverPlugin, AnalysisServerOptions analysisServerOptions, | 661 ServerPlugin serverPlugin, AnalysisServerOptions analysisServerOptions, |
| 662 DartSdk defaultSdk, InstrumentationService instrumentationService) | 662 DartSdk defaultSdk, InstrumentationService instrumentationService) |
| 663 : super(channel, resourceProvider, packageMapProvider, index, | 663 : super(channel, resourceProvider, packageMapProvider, index, |
| 664 serverPlugin, analysisServerOptions, defaultSdk, | 664 serverPlugin, analysisServerOptions, defaultSdk, |
| 665 instrumentationService); | 665 instrumentationService); |
| 666 | 666 |
| 667 @override | 667 @override |
| 668 AnalysisContext getAnalysisContext(String path) { | 668 AnalysisContext getAnalysisContext(String path) { |
| 669 return mockContext; | 669 return mockContext; |
| 670 } | 670 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 } | 720 } |
| 721 '''); | 721 '''); |
| 722 await waitForTasksFinished(); | 722 await waitForTasksFinished(); |
| 723 Request request = | 723 Request request = |
| 724 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); | 724 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); |
| 725 Response response = handler.handleRequest(request); | 725 Response response = handler.handleRequest(request); |
| 726 expect(response.error, isNotNull); | 726 expect(response.error, isNotNull); |
| 727 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); | 727 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); |
| 728 } | 728 } |
| 729 } | 729 } |
| OLD | NEW |