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

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

Issue 1507513002: extract field formal contributor from prefixed element contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years 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/plugin/protocol/protocol.dart' as protocol 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 4400 matching lines...) Expand 10 before | Expand all | Expand 10 after
4411 var b; X _c; static sb; 4411 var b; X _c; static sb;
4412 X get d => new A();get _e => new A(); 4412 X get d => new A();get _e => new A();
4413 // no semicolon between completion point and next statement 4413 // no semicolon between completion point and next statement
4414 set s1(I x) {} set _s2(I x) {m(null);} 4414 set s1(I x) {} set _s2(I x) {m(null);}
4415 m(X x) {} I _n(X x) {}} 4415 m(X x) {} I _n(X x) {}}
4416 class X{}'''); 4416 class X{}''');
4417 computeFast(); 4417 computeFast();
4418 return computeFull((bool result) { 4418 return computeFull((bool result) {
4419 expect(request.replacementOffset, completionOffset); 4419 expect(request.replacementOffset, completionOffset);
4420 expect(request.replacementLength, 0); 4420 expect(request.replacementLength, 0);
4421 assertSuggestInvocationField('b', null, 4421 // Contributed by FieldFormalConstructorContributor
4422 relevance: DART_RELEVANCE_LOCAL_FIELD); 4422 assertNotSuggested('b');
4423 assertSuggestInvocationField('_c', 'X', 4423 assertNotSuggested('_c');
4424 relevance: DART_RELEVANCE_LOCAL_FIELD);
4425 assertNotSuggested('sb'); 4424 assertNotSuggested('sb');
4426 assertNotSuggested('d'); 4425 assertNotSuggested('d');
4427 assertNotSuggested('_e'); 4426 assertNotSuggested('_e');
4428 assertNotSuggested('f'); 4427 assertNotSuggested('f');
4429 assertNotSuggested('_g'); 4428 assertNotSuggested('_g');
4430 assertNotSuggested('m'); 4429 assertNotSuggested('m');
4431 assertNotSuggested('_n'); 4430 assertNotSuggested('_n');
4432 assertNotSuggested('s1'); 4431 assertNotSuggested('s1');
4433 assertNotSuggested('_s2'); 4432 assertNotSuggested('_s2');
4434 assertNotSuggested('z'); 4433 assertNotSuggested('z');
(...skipping 16 matching lines...) Expand all
4451 var b; X _c; 4450 var b; X _c;
4452 X get d => new A();get _e => new A(); 4451 X get d => new A();get _e => new A();
4453 // no semicolon between completion point and next statement 4452 // no semicolon between completion point and next statement
4454 set s1(I x) {} set _s2(I x) {m(null);} 4453 set s1(I x) {} set _s2(I x) {m(null);}
4455 m(X x) {} I _n(X x) {}} 4454 m(X x) {} I _n(X x) {}}
4456 class X{}'''); 4455 class X{}''');
4457 computeFast(); 4456 computeFast();
4458 return computeFull((bool result) { 4457 return computeFull((bool result) {
4459 expect(request.replacementOffset, completionOffset - 1); 4458 expect(request.replacementOffset, completionOffset - 1);
4460 expect(request.replacementLength, 1); 4459 expect(request.replacementLength, 1);
4461 assertSuggestInvocationField('b', null, 4460 // Contributed by FieldFormalConstructorContributor
4462 relevance: DART_RELEVANCE_LOCAL_FIELD); 4461 assertNotSuggested('b');
4463 assertSuggestInvocationField('_c', 'X', 4462 assertNotSuggested('_c');
4464 relevance: DART_RELEVANCE_LOCAL_FIELD);
4465 assertNotSuggested('d'); 4463 assertNotSuggested('d');
4466 assertNotSuggested('_e'); 4464 assertNotSuggested('_e');
4467 assertNotSuggested('f'); 4465 assertNotSuggested('f');
4468 assertNotSuggested('_g'); 4466 assertNotSuggested('_g');
4469 assertNotSuggested('m'); 4467 assertNotSuggested('m');
4470 assertNotSuggested('_n'); 4468 assertNotSuggested('_n');
4471 assertNotSuggested('s1'); 4469 assertNotSuggested('s1');
4472 assertNotSuggested('_s2'); 4470 assertNotSuggested('_s2');
4473 assertNotSuggested('z'); 4471 assertNotSuggested('z');
4474 assertNotSuggested('I'); 4472 assertNotSuggested('I');
(...skipping 15 matching lines...) Expand all
4490 var b; X _c; 4488 var b; X _c;
4491 X get d => new A();get _e => new A(); 4489 X get d => new A();get _e => new A();
4492 // no semicolon between completion point and next statement 4490 // no semicolon between completion point and next statement
4493 set s1(I x) {} set _s2(I x) {m(null);} 4491 set s1(I x) {} set _s2(I x) {m(null);}
4494 m(X x) {} I _n(X x) {}} 4492 m(X x) {} I _n(X x) {}}
4495 class X{}'''); 4493 class X{}''');
4496 computeFast(); 4494 computeFast();
4497 return computeFull((bool result) { 4495 return computeFull((bool result) {
4498 expect(request.replacementOffset, completionOffset); 4496 expect(request.replacementOffset, completionOffset);
4499 expect(request.replacementLength, 1); 4497 expect(request.replacementLength, 1);
4500 assertSuggestInvocationField('b', null, 4498 // Contributed by FieldFormalConstructorContributor
4501 relevance: DART_RELEVANCE_LOCAL_FIELD); 4499 assertNotSuggested('b');
4502 assertSuggestInvocationField('_c', 'X', 4500 assertNotSuggested('_c');
4503 relevance: DART_RELEVANCE_LOCAL_FIELD);
4504 assertNotSuggested('d'); 4501 assertNotSuggested('d');
4505 assertNotSuggested('_e'); 4502 assertNotSuggested('_e');
4506 assertNotSuggested('f'); 4503 assertNotSuggested('f');
4507 assertNotSuggested('_g'); 4504 assertNotSuggested('_g');
4508 assertNotSuggested('m'); 4505 assertNotSuggested('m');
4509 assertNotSuggested('_n'); 4506 assertNotSuggested('_n');
4510 assertNotSuggested('s1'); 4507 assertNotSuggested('s1');
4511 assertNotSuggested('_s2'); 4508 assertNotSuggested('_s2');
4512 assertNotSuggested('z'); 4509 assertNotSuggested('z');
4513 assertNotSuggested('I'); 4510 assertNotSuggested('I');
(...skipping 16 matching lines...) Expand all
4530 X get d => new A();get _e => new A(); 4527 X get d => new A();get _e => new A();
4531 // no semicolon between completion point and next statement 4528 // no semicolon between completion point and next statement
4532 set s1(I x) {} set _s2(I x) {m(null);} 4529 set s1(I x) {} set _s2(I x) {m(null);}
4533 m(X x) {} I _n(X x) {}} 4530 m(X x) {} I _n(X x) {}}
4534 class X{}'''); 4531 class X{}''');
4535 computeFast(); 4532 computeFast();
4536 return computeFull((bool result) { 4533 return computeFull((bool result) {
4537 expect(request.replacementOffset, completionOffset); 4534 expect(request.replacementOffset, completionOffset);
4538 expect(request.replacementLength, 0); 4535 expect(request.replacementLength, 0);
4539 assertNotSuggested('b'); 4536 assertNotSuggested('b');
4540 assertSuggestInvocationField('_c', 'X', 4537 // Contributed by FieldFormalConstructorContributor
4541 relevance: DART_RELEVANCE_LOCAL_FIELD); 4538 assertNotSuggested('_c');
4542 assertNotSuggested('d'); 4539 assertNotSuggested('d');
4543 assertNotSuggested('_e'); 4540 assertNotSuggested('_e');
4544 assertNotSuggested('f'); 4541 assertNotSuggested('f');
4545 assertNotSuggested('_g'); 4542 assertNotSuggested('_g');
4546 assertNotSuggested('m'); 4543 assertNotSuggested('m');
4547 assertNotSuggested('_n'); 4544 assertNotSuggested('_n');
4548 assertNotSuggested('s1'); 4545 assertNotSuggested('s1');
4549 assertNotSuggested('_s2'); 4546 assertNotSuggested('_s2');
4550 assertNotSuggested('z'); 4547 assertNotSuggested('z');
4551 assertNotSuggested('I'); 4548 assertNotSuggested('I');
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4716 assertNotSuggested('bar2'); 4713 assertNotSuggested('bar2');
4717 assertNotSuggested('_B'); 4714 assertNotSuggested('_B');
4718 assertSuggestLocalClass('Y'); 4715 assertSuggestLocalClass('Y');
4719 assertSuggestLocalClass('C'); 4716 assertSuggestLocalClass('C');
4720 assertSuggestLocalVariable('f', null); 4717 assertSuggestLocalVariable('f', null);
4721 assertNotSuggested('x'); 4718 assertNotSuggested('x');
4722 assertNotSuggested('e'); 4719 assertNotSuggested('e');
4723 }); 4720 });
4724 } 4721 }
4725 } 4722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698