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

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

Issue 1319753002: exclude instance suggestions in static context - fixes #22932 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 3 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
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/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/protocol.dart' as protocol 10 import 'package:analysis_server/src/protocol.dart' as protocol
(...skipping 3463 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 expect(getterF.element.isPrivate, isFalse); 3474 expect(getterF.element.isPrivate, isFalse);
3475 } 3475 }
3476 CompletionSuggestion getterG = assertSuggestLocalGetter('_g', null); 3476 CompletionSuggestion getterG = assertSuggestLocalGetter('_g', null);
3477 if (getterG != null) { 3477 if (getterG != null) {
3478 expect(getterG.element.isDeprecated, isFalse); 3478 expect(getterG.element.isDeprecated, isFalse);
3479 expect(getterG.element.isPrivate, isTrue); 3479 expect(getterG.element.isPrivate, isTrue);
3480 } 3480 }
3481 }); 3481 });
3482 } 3482 }
3483 3483
3484 test_MethodDeclaration_body_static() {
3485 // Block BlockFunctionBody MethodDeclaration
3486 addSource(
3487 '/testC.dart',
3488 '''
3489 class C {
3490 c1() {}
3491 var c2;
3492 static c3() {}
3493 static var c4;}''');
3494 addTestSource('''
3495 import "/testC.dart";
3496 class B extends C {
3497 b1() {}
3498 var b2;
3499 static b3() {}
3500 static var b4;}
3501 class A extends B {
3502 a1() {}
3503 var a2;
3504 static a3() {}
3505 static var a4;
3506 static a() {^}}''');
3507 computeFast();
3508 return computeFull((bool result) {
3509 assertNotSuggested('a1');
3510 assertNotSuggested('a2');
3511 assertSuggestLocalMethod('a3', 'A', null);
3512 assertSuggestLocalField('a4', null);
3513 assertNotSuggested('b1');
3514 assertNotSuggested('b2');
3515 assertNotSuggested('b3');
3516 assertNotSuggested('b4');
3517 assertNotSuggested('c1');
3518 assertNotSuggested('c2');
3519 assertNotSuggested('c3');
3520 assertNotSuggested('c4');
3521 });
3522 }
3523
3484 test_MethodDeclaration_members() { 3524 test_MethodDeclaration_members() {
3485 // Block BlockFunctionBody MethodDeclaration 3525 // Block BlockFunctionBody MethodDeclaration
3486 addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}'); 3526 addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}');
3487 computeFast(); 3527 computeFast();
3488 return computeFull((bool result) { 3528 return computeFull((bool result) {
3489 expect(request.replacementOffset, completionOffset); 3529 expect(request.replacementOffset, completionOffset);
3490 expect(request.replacementLength, 0); 3530 expect(request.replacementLength, 0);
3491 CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z'); 3531 CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z');
3492 if (methodA != null) { 3532 if (methodA != null) {
3493 expect(methodA.element.isDeprecated, isFalse); 3533 expect(methodA.element.isDeprecated, isFalse);
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4658 assertNotSuggested('bar2'); 4698 assertNotSuggested('bar2');
4659 assertNotSuggested('_B'); 4699 assertNotSuggested('_B');
4660 assertSuggestLocalClass('Y'); 4700 assertSuggestLocalClass('Y');
4661 assertSuggestLocalClass('C'); 4701 assertSuggestLocalClass('C');
4662 assertSuggestLocalVariable('f', null); 4702 assertSuggestLocalVariable('f', null);
4663 assertNotSuggested('x'); 4703 assertNotSuggested('x');
4664 assertNotSuggested('e'); 4704 assertNotSuggested('e');
4665 }); 4705 });
4666 } 4706 }
4667 } 4707 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698