| 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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 465 |
| 466 test_imports_prefixed() { | 466 test_imports_prefixed() { |
| 467 addTestFile(''' | 467 addTestFile(''' |
| 468 import 'dart:html' as foo; | 468 import 'dart:html' as foo; |
| 469 main() {^} | 469 main() {^} |
| 470 '''); | 470 '''); |
| 471 return getSuggestions().then((_) { | 471 return getSuggestions().then((_) { |
| 472 expect(replacementOffset, equals(completionOffset)); | 472 expect(replacementOffset, equals(completionOffset)); |
| 473 expect(replacementLength, equals(0)); | 473 expect(replacementLength, equals(0)); |
| 474 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); | 474 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); |
| 475 assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo'); | 475 assertHasResult(CompletionSuggestionKind.IDENTIFIER, 'foo'); |
| 476 assertNoResult('HtmlElement'); | 476 assertNoResult('HtmlElement'); |
| 477 assertNoResult('test'); | 477 assertNoResult('test'); |
| 478 }); | 478 }); |
| 479 } | 479 } |
| 480 | 480 |
| 481 test_imports_prefixed2() { | 481 test_imports_prefixed2() { |
| 482 addTestFile(''' | 482 addTestFile(''' |
| 483 import 'dart:html' as foo; | 483 import 'dart:html' as foo; |
| 484 main() {foo.^} | 484 main() {foo.^} |
| 485 '''); | 485 '''); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 877 } |
| 878 '''); | 878 '''); |
| 879 await waitForTasksFinished(); | 879 await waitForTasksFinished(); |
| 880 Request request = | 880 Request request = |
| 881 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); | 881 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); |
| 882 Response response = handler.handleRequest(request); | 882 Response response = handler.handleRequest(request); |
| 883 expect(response.error, isNotNull); | 883 expect(response.error, isNotNull); |
| 884 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); | 884 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); |
| 885 } | 885 } |
| 886 } | 886 } |
| OLD | NEW |