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

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

Issue 1056163002: do not suggest completions for empty dot target (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 3480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3491 expect(request.replacementOffset, completionOffset - 2); 3491 expect(request.replacementOffset, completionOffset - 2);
3492 expect(request.replacementLength, 8); 3492 expect(request.replacementLength, 8);
3493 assertSuggestInvocationGetter('length', 'int'); 3493 assertSuggestInvocationGetter('length', 'int');
3494 assertNotSuggested('A'); 3494 assertNotSuggested('A');
3495 assertNotSuggested('a'); 3495 assertNotSuggested('a');
3496 assertNotSuggested('Object'); 3496 assertNotSuggested('Object');
3497 assertNotSuggested('=='); 3497 assertNotSuggested('==');
3498 }); 3498 });
3499 } 3499 }
3500 3500
3501 test_PropertyAccess_noTarget() {
3502 // SimpleIdentifier PropertyAccess ExpressionStatement
3503 addSource('/testAB.dart', 'class Foo { }');
3504 addTestSource('class C {foo(){.^}}');
3505 computeFast();
3506 return computeFull((bool result) {
3507 assertNoSuggestions();
3508 });
3509 }
3510
3511 test_PropertyAccess_noTarget2() {
3512 // SimpleIdentifier PropertyAccess ExpressionStatement
3513 addSource('/testAB.dart', 'class Foo { }');
3514 addTestSource('main() {.^}');
3515 computeFast();
3516 return computeFull((bool result) {
3517 assertNoSuggestions();
3518 });
3519 }
3520
3501 test_PropertyAccess_selector() { 3521 test_PropertyAccess_selector() {
3502 // SimpleIdentifier PropertyAccess ExpressionStatement Block 3522 // SimpleIdentifier PropertyAccess ExpressionStatement Block
3503 addTestSource('class A {a() {"hello".length.^}}'); 3523 addTestSource('class A {a() {"hello".length.^}}');
3504 computeFast(); 3524 computeFast();
3505 return computeFull((bool result) { 3525 return computeFull((bool result) {
3506 expect(request.replacementOffset, completionOffset); 3526 expect(request.replacementOffset, completionOffset);
3507 expect(request.replacementLength, 0); 3527 expect(request.replacementLength, 0);
3508 assertSuggestInvocationGetter('isEven', 'bool'); 3528 assertSuggestInvocationGetter('isEven', 'bool');
3509 assertNotSuggested('A'); 3529 assertNotSuggested('A');
3510 assertNotSuggested('a'); 3530 assertNotSuggested('a');
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
3737 assertNotSuggested('bar2'); 3757 assertNotSuggested('bar2');
3738 assertNotSuggested('_B'); 3758 assertNotSuggested('_B');
3739 assertSuggestLocalClass('Y'); 3759 assertSuggestLocalClass('Y');
3740 assertSuggestLocalClass('C'); 3760 assertSuggestLocalClass('C');
3741 assertSuggestLocalVariable('f', null); 3761 assertSuggestLocalVariable('f', null);
3742 assertNotSuggested('x'); 3762 assertNotSuggested('x');
3743 assertNotSuggested('e'); 3763 assertNotSuggested('e');
3744 }); 3764 });
3745 } 3765 }
3746 } 3766 }
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