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

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

Issue 1053663002: add type completions after "on" in a try block (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix tests 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.util; 5 library test.services.completion.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol 9 import 'package:analysis_server/src/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 assertNotSuggested('_c'); 1538 assertNotSuggested('_c');
1539 assertSuggestLocalVariable('a', 'A'); 1539 assertSuggestLocalVariable('a', 'A');
1540 assertSuggestLocalClass('A'); 1540 assertSuggestLocalClass('A');
1541 assertSuggestLocalClass('X'); 1541 assertSuggestLocalClass('X');
1542 // top level results are partially filtered 1542 // top level results are partially filtered
1543 //assertSuggestImportedClass('Object'); 1543 //assertSuggestImportedClass('Object');
1544 assertNotSuggested('=='); 1544 assertNotSuggested('==');
1545 }); 1545 });
1546 } 1546 }
1547 1547
1548 test_CatchClause_onType() {
1549 // TypeName CatchClause TryStatement
1550 addTestSource('class A {a() {try{var x;} on ^ {}}}');
1551 computeFast();
1552 return computeFull((bool result) {
1553 expect(request.replacementOffset, completionOffset);
1554 expect(request.replacementLength, 0);
1555 assertSuggestLocalClass('A');
1556 assertSuggestImportedClass('Object');
1557 assertNotSuggested('a');
1558 assertNotSuggested('x');
1559 });
1560 }
1561
1562 test_CatchClause_onType_noBrackets() {
1563 // TypeName CatchClause TryStatement
1564 addTestSource('class A {a() {try{var x;} on ^}}');
1565 computeFast();
1566 return computeFull((bool result) {
1567 expect(request.replacementOffset, completionOffset);
1568 expect(request.replacementLength, 0);
1569 assertSuggestLocalClass('A');
1570 assertSuggestImportedClass('Object');
1571 assertNotSuggested('x');
1572 });
1573 }
1574
1548 test_CatchClause_typed() { 1575 test_CatchClause_typed() {
1549 // Block CatchClause TryStatement 1576 // Block CatchClause TryStatement
1550 addTestSource('class A {a() {try{var x;} on E catch (e) {^}}}'); 1577 addTestSource('class A {a() {try{var x;} on E catch (e) {^}}}');
1551 computeFast(); 1578 computeFast();
1552 return computeFull((bool result) { 1579 return computeFull((bool result) {
1553 expect(request.replacementOffset, completionOffset); 1580 expect(request.replacementOffset, completionOffset);
1554 expect(request.replacementLength, 0); 1581 expect(request.replacementLength, 0);
1555 assertSuggestParameter('e', 'E'); 1582 assertSuggestParameter('e', 'E');
1556 assertSuggestLocalMethod('a', 'A', null); 1583 assertSuggestLocalMethod('a', 'A', null);
1557 assertSuggestImportedClass('Object'); 1584 assertSuggestImportedClass('Object');
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3709 assertNotSuggested('bar2'); 3736 assertNotSuggested('bar2');
3710 assertNotSuggested('_B'); 3737 assertNotSuggested('_B');
3711 assertSuggestLocalClass('Y'); 3738 assertSuggestLocalClass('Y');
3712 assertSuggestLocalClass('C'); 3739 assertSuggestLocalClass('C');
3713 assertSuggestLocalVariable('f', null); 3740 assertSuggestLocalVariable('f', null);
3714 assertNotSuggested('x'); 3741 assertNotSuggested('x');
3715 assertNotSuggested('e'); 3742 assertNotSuggested('e');
3716 }); 3743 });
3717 } 3744 }
3718 } 3745 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | pkg/analysis_server/test/services/completion/optype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698