| 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.services.completion.dart.keyword; | 5 library test.services.completion.dart.keyword; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:analysis_server/src/services/completion/keyword_contributor.dart
'; | 9 import 'package:analysis_server/src/services/completion/keyword_contributor.dart
'; |
| 10 import 'package:analyzer/src/generated/scanner.dart'; | 10 import 'package:analyzer/src/generated/scanner.dart'; |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 expect(computeFast(), isTrue); | 445 expect(computeFast(), isTrue); |
| 446 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); | 446 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 447 } | 447 } |
| 448 | 448 |
| 449 test_import_deferred4() { | 449 test_import_deferred4() { |
| 450 addTestSource('import "foo" d^ hide foo;'); | 450 addTestSource('import "foo" d^ hide foo;'); |
| 451 expect(computeFast(), isTrue); | 451 expect(computeFast(), isTrue); |
| 452 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); | 452 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 453 } | 453 } |
| 454 | 454 |
| 455 test_import_deferred5() { |
| 456 addTestSource('import "foo" d^'); |
| 457 expect(computeFast(), isTrue); |
| 458 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 459 } |
| 460 |
| 461 test_import_deferred6() { |
| 462 addTestSource('import "foo" d^ import'); |
| 463 expect(computeFast(), isTrue); |
| 464 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 465 } |
| 466 |
| 455 test_import_deferred_not() { | 467 test_import_deferred_not() { |
| 456 addTestSource('import "foo" as foo ^;'); | 468 addTestSource('import "foo" as foo ^;'); |
| 457 expect(computeFast(), isTrue); | 469 expect(computeFast(), isTrue); |
| 458 assertSuggestKeywords([], DART_RELEVANCE_HIGH); | 470 assertSuggestKeywords([], DART_RELEVANCE_HIGH); |
| 459 } | 471 } |
| 460 | 472 |
| 461 test_import_deferred_as() { | 473 test_import_deferred_as() { |
| 462 addTestSource('import "foo" ^;'); | 474 addTestSource('import "foo" ^;'); |
| 463 expect(computeFast(), isTrue); | 475 expect(computeFast(), isTrue); |
| 464 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); | 476 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},')); | 546 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},')); |
| 535 } | 547 } |
| 536 | 548 |
| 537 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) { | 549 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) { |
| 538 if (iter1.length != iter2.length) return false; | 550 if (iter1.length != iter2.length) return false; |
| 539 if (iter1.any((k) => !iter2.contains(k))) return false; | 551 if (iter1.any((k) => !iter2.contains(k))) return false; |
| 540 if (iter2.any((k) => !iter1.contains(k))) return false; | 552 if (iter2.any((k) => !iter1.contains(k))) return false; |
| 541 return true; | 553 return true; |
| 542 } | 554 } |
| 543 } | 555 } |
| OLD | NEW |