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

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_test_util.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.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 show Element, 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element,
10 ElementKind; 10 ElementKind;
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 CompletionSuggestion assertSuggestImportedClass(String name, 372 CompletionSuggestion assertSuggestImportedClass(String name,
373 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) { 373 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
374 if (computer is ImportedComputer) { 374 if (computer is ImportedComputer) {
375 return assertSuggestClass(name, relevance); 375 return assertSuggestClass(name, relevance);
376 } else { 376 } else {
377 return assertNotSuggested(name); 377 return assertNotSuggested(name);
378 } 378 }
379 } 379 }
380 380
381 CompletionSuggestion assertSuggestInvocationGetter(String name, String returnT ype, 381 CompletionSuggestion assertSuggestInvocationGetter(String name,
382 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) { 382 String returnType, [CompletionRelevance relevance =
383 CompletionRelevance.DEFAULT]) {
383 if (computer is InvocationComputer) { 384 if (computer is InvocationComputer) {
384 return assertSuggestGetter(name, returnType, relevance); 385 return assertSuggestGetter(name, returnType, relevance);
385 } else { 386 } else {
386 return null; 387 return null;
387 } 388 }
388 } 389 }
389 390
390 CompletionSuggestion assertSuggestLocalClass(String name, 391 CompletionSuggestion assertSuggestLocalClass(String name,
391 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) { 392 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
392 if (computer is LocalComputer) { 393 if (computer is LocalComputer) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 computeFast(); 499 computeFast();
499 return computeFull(true).then((_) { 500 return computeFull(true).then((_) {
500 assertNotSuggested('b'); 501 assertNotSuggested('b');
501 assertNotSuggested('_c'); 502 assertNotSuggested('_c');
502 assertSuggestLocalVariable('a', 'A'); 503 assertSuggestLocalVariable('a', 'A');
503 assertSuggestLocalClass('A'); 504 assertSuggestLocalClass('A');
504 assertSuggestLocalClass('X'); 505 assertSuggestLocalClass('X');
505 assertSuggestImportedClass('Object'); 506 assertSuggestImportedClass('Object');
506 }); 507 });
507 } 508 }
509
510 test_IsExpression_type() {
511 // SimpleIdentifier TypeName IsExpression IfStatement
512 addSource('/testB.dart', '''
513 lib B;
514 foo() { }
515 class X {X.c(); X._d(); z() {}}''');
516 addTestSource('''
517 import "/testB.dart";
518 class Y {Y.c(); Y._d(); z() {}}
519 main() {var x; if (x is ^) { }}''');
520 computeFast();
521 return computeFull(true).then((_) {
522 assertSuggestImportedClass('X');
523 assertSuggestLocalClass('Y');
524 assertNotSuggested('x');
525 assertNotSuggested('main');
526 assertNotSuggested('foo');
527 });
528 }
508 } 529 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698