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

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

Issue 1365403002: Do not suggest static fields in constructor initializer - fixes #24256 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after
4385 } 4385 }
4386 4386
4387 test_ThisExpression_constructor_param() { 4387 test_ThisExpression_constructor_param() {
4388 // SimpleIdentifier FieldFormalParameter FormalParameterList 4388 // SimpleIdentifier FieldFormalParameter FormalParameterList
4389 addTestSource(''' 4389 addTestSource('''
4390 main() { } 4390 main() { }
4391 class I {X get f => new A();get _g => new A();} 4391 class I {X get f => new A();get _g => new A();}
4392 class A implements I { 4392 class A implements I {
4393 A(this.^) {} 4393 A(this.^) {}
4394 A.z() {} 4394 A.z() {}
4395 var b; X _c; 4395 var b; X _c; static sb;
4396 X get d => new A();get _e => new A(); 4396 X get d => new A();get _e => new A();
4397 // no semicolon between completion point and next statement 4397 // no semicolon between completion point and next statement
4398 set s1(I x) {} set _s2(I x) {m(null);} 4398 set s1(I x) {} set _s2(I x) {m(null);}
4399 m(X x) {} I _n(X x) {}} 4399 m(X x) {} I _n(X x) {}}
4400 class X{}'''); 4400 class X{}''');
4401 computeFast(); 4401 computeFast();
4402 return computeFull((bool result) { 4402 return computeFull((bool result) {
4403 expect(request.replacementOffset, completionOffset); 4403 expect(request.replacementOffset, completionOffset);
4404 expect(request.replacementLength, 0); 4404 expect(request.replacementLength, 0);
4405 assertSuggestInvocationField('b', null, 4405 assertSuggestInvocationField('b', null,
4406 relevance: DART_RELEVANCE_LOCAL_FIELD); 4406 relevance: DART_RELEVANCE_LOCAL_FIELD);
4407 assertSuggestInvocationField('_c', 'X', 4407 assertSuggestInvocationField('_c', 'X',
4408 relevance: DART_RELEVANCE_LOCAL_FIELD); 4408 relevance: DART_RELEVANCE_LOCAL_FIELD);
4409 assertNotSuggested('sb');
4409 assertNotSuggested('d'); 4410 assertNotSuggested('d');
4410 assertNotSuggested('_e'); 4411 assertNotSuggested('_e');
4411 assertNotSuggested('f'); 4412 assertNotSuggested('f');
4412 assertNotSuggested('_g'); 4413 assertNotSuggested('_g');
4413 assertNotSuggested('m'); 4414 assertNotSuggested('m');
4414 assertNotSuggested('_n'); 4415 assertNotSuggested('_n');
4415 assertNotSuggested('s1'); 4416 assertNotSuggested('s1');
4416 assertNotSuggested('_s2'); 4417 assertNotSuggested('_s2');
4417 assertNotSuggested('z'); 4418 assertNotSuggested('z');
4418 assertNotSuggested('I'); 4419 assertNotSuggested('I');
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
4699 assertNotSuggested('bar2'); 4700 assertNotSuggested('bar2');
4700 assertNotSuggested('_B'); 4701 assertNotSuggested('_B');
4701 assertSuggestLocalClass('Y'); 4702 assertSuggestLocalClass('Y');
4702 assertSuggestLocalClass('C'); 4703 assertSuggestLocalClass('C');
4703 assertSuggestLocalVariable('f', null); 4704 assertSuggestLocalVariable('f', null);
4704 assertNotSuggested('x'); 4705 assertNotSuggested('x');
4705 assertNotSuggested('e'); 4706 assertNotSuggested('e');
4706 }); 4707 });
4707 } 4708 }
4708 } 4709 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698