Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: pkg/analysis_server/test/services/completion/keyword_contributor_test.dart

Issue 1068263002: improve parser recovery for import statements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() { 437 test_import_deferred2() {
438 addTestSource('import "foo" d^ as foo;'); 438 addTestSource('import "foo" d^ as foo;');
439 expect(computeFast(), isTrue); 439 expect(computeFast(), isTrue);
440 assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH); 440 assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH);
441 } 441 }
442 442
443 test_import_deferred3() {
444 addTestSource('import "foo" d^ show foo;');
445 expect(computeFast(), isTrue);
446 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
447 }
448
449 test_import_deferred4() {
450 addTestSource('import "foo" d^ hide foo;');
451 expect(computeFast(), isTrue);
452 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
453 }
454
443 test_import_deferred_not() { 455 test_import_deferred_not() {
444 addTestSource('import "foo" as foo ^;'); 456 addTestSource('import "foo" as foo ^;');
445 expect(computeFast(), isTrue); 457 expect(computeFast(), isTrue);
446 assertSuggestKeywords([], DART_RELEVANCE_HIGH); 458 assertSuggestKeywords([], DART_RELEVANCE_HIGH);
447 } 459 }
448 460
449 test_import_deferred_as() { 461 test_import_deferred_as() {
450 addTestSource('import "foo" ^;'); 462 addTestSource('import "foo" ^;');
451 expect(computeFast(), isTrue); 463 expect(computeFast(), isTrue);
452 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH); 464 assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},')); 534 sorted.forEach((k) => msg.writeln(' Keyword.${k.name},'));
523 } 535 }
524 536
525 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) { 537 bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) {
526 if (iter1.length != iter2.length) return false; 538 if (iter1.length != iter2.length) return false;
527 if (iter1.any((k) => !iter2.contains(k))) return false; 539 if (iter1.any((k) => !iter2.contains(k))) return false;
528 if (iter2.any((k) => !iter1.contains(k))) return false; 540 if (iter2.any((k) => !iter1.contains(k))) return false;
529 return true; 541 return true;
530 } 542 }
531 } 543 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698