| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 expect(computeFast(), isTrue); | 427 expect(computeFast(), isTrue); |
| 428 assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH); | 428 assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH); |
| 429 } | 429 } |
| 430 | 430 |
| 431 test_import_deferred() { | 431 test_import_deferred() { |
| 432 addTestSource('import "foo" ^ as foo;'); | 432 addTestSource('import "foo" ^ as foo;'); |
| 433 expect(computeFast(), isTrue); | 433 expect(computeFast(), isTrue); |
| 434 assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH); | 434 assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 435 } | 435 } |
| 436 | 436 |
| 437 test_import_deferred2() { |
| 438 addTestSource('import "foo" d^ as foo;'); |
| 439 expect(computeFast(), isTrue); |
| 440 assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| 441 } |
| 442 |
| 437 test_import_deferred_not() { | 443 test_import_deferred_not() { |
| 438 addTestSource('import "foo" as foo ^;'); | 444 addTestSource('import "foo" as foo ^;'); |
| 439 expect(computeFast(), isTrue); | 445 expect(computeFast(), isTrue); |
| 440 assertSuggestKeywords([], DART_RELEVANCE_HIGH); | 446 assertSuggestKeywords([], DART_RELEVANCE_HIGH); |
| 441 } | 447 } |
| 442 | 448 |
| 443 test_import_deferred_as() { | 449 test_import_deferred_as() { |
| 444 addTestSource('import "foo" ^;'); | 450 addTestSource('import "foo" ^;'); |
| 445 expect(computeFast(), isTrue); | 451 expect(computeFast(), isTrue); |
| 446 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); | 452 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},')); | 522 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},')); |
| 517 } | 523 } |
| 518 | 524 |
| 519 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) { | 525 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) { |
| 520 if (iter1.length != iter2.length) return false; | 526 if (iter1.length != iter2.length) return false; |
| 521 if (iter1.any((k) => !iter2.contains(k))) return false; | 527 if (iter1.any((k) => !iter2.contains(k))) return false; |
| 522 if (iter2.any((k) => !iter1.contains(k))) return false; | 528 if (iter2.any((k) => !iter1.contains(k))) return false; |
| 523 return true; | 529 return true; |
| 524 } | 530 } |
| 525 } | 531 } |
| OLD | NEW |