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

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

Issue 635043002: show only type names in is expression RHS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 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.invocation; 5 library test.services.completion.invocation;
6 6
7 7
8 import 'package:analysis_server/src/protocol.dart'; 8 import 'package:analysis_server/src/protocol.dart';
9 import 'package:analysis_server/src/services/completion/invocation_computer.dart '; 9 import 'package:analysis_server/src/services/completion/invocation_computer.dart ';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 class X {X.c(); X._d(); z() {}} 52 class X {X.c(); X._d(); z() {}}
53 main() {new X.^}'''); 53 main() {new X.^}''');
54 return computeFull().then((_) { 54 return computeFull().then((_) {
55 assertSuggest(CompletionSuggestionKind.CONSTRUCTOR, 'c'); 55 assertSuggest(CompletionSuggestionKind.CONSTRUCTOR, 'c');
56 assertSuggest(CompletionSuggestionKind.CONSTRUCTOR, '_d'); 56 assertSuggest(CompletionSuggestionKind.CONSTRUCTOR, '_d');
57 assertNotSuggested('z'); 57 assertNotSuggested('z');
58 assertNotSuggested('m'); 58 assertNotSuggested('m');
59 }); 59 });
60 } 60 }
61 61
62 test_IsExpression() {
63 // SimpleIdentifier TypeName IsExpression IfStatement
64 addSource('/testB.dart', '''
65 lib B;
66 class X {X.c(); X._d(); z() {}}''');
67 addTestSource('''
68 import "/testB.dart";
69 main() {var x; if (x is ^) { }}''');
70 return computeFull().then((_) {
71 assertNoSuggestions();
72 });
73 }
74
75 test_PrefixedIdentifier_field() { 62 test_PrefixedIdentifier_field() {
76 // SimpleIdentifier PrefixedIdentifier ExpressionStatement 63 // SimpleIdentifier PrefixedIdentifier ExpressionStatement
77 addTestSource(''' 64 addTestSource('''
78 class A {var b; X _c;} 65 class A {var b; X _c;}
79 class X{} 66 class X{}
80 main() {A a; a.^}'''); 67 main() {A a; a.^}''');
81 return computeFull().then((_) { 68 return computeFull().then((_) {
82 assertSuggestGetter('b', null); 69 assertSuggestGetter('b', null);
83 assertSuggestGetter('_c', 'X'); 70 assertSuggestGetter('_c', 'X');
84 }); 71 });
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 class X {set y(X x) {} set _z(X x) {}}'''); 231 class X {set y(X x) {} set _z(X x) {}}''');
245 addTestSource(''' 232 addTestSource('''
246 import "/testB.dart"; 233 import "/testB.dart";
247 main() {X x; x.^}'''); 234 main() {X x; x.^}''');
248 return computeFull().then((_) { 235 return computeFull().then((_) {
249 assertSuggestSetter('y'); 236 assertSuggestSetter('y');
250 assertNotSuggested('_z'); 237 assertNotSuggested('_z');
251 }); 238 });
252 } 239 }
253 } 240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698