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

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

Issue 1273773005: fix completion after dot-keyword - fixes #23882 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 4 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.target; 5 library test.services.completion.target;
6 6
7 import 'package:analysis_server/src/services/completion/completion_target.dart'; 7 import 'package:analysis_server/src/services/completion/completion_target.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 addTestSource('class A {var b; X _c; foo() {var a; (a as ^String).foo();}'); 132 addTestSource('class A {var b; X _c; foo() {var a; (a as ^String).foo();}');
133 assertTarget('String', 'a as String'); 133 assertTarget('String', 'a as String');
134 } 134 }
135 135
136 test_Block() { 136 test_Block() {
137 // Block 137 // Block
138 addTestSource('main() {^}'); 138 addTestSource('main() {^}');
139 assertTarget('}', '{}'); 139 assertTarget('}', '{}');
140 } 140 }
141 141
142 test_Block_keyword() {
143 addTestSource('class C { static C get instance => null; } main() {C.in^}');
144 assertTarget('in', 'C.in');
145 }
146
147 test_Block_keyword2() {
148 addTestSource('class C { static C get instance => null; } main() {C.i^n}');
149 assertTarget('in', 'C.in');
150 }
151
142 test_FormalParameter_partialType() { 152 test_FormalParameter_partialType() {
143 // SimpleIdentifier PrefixedIdentifier TypeName 153 // SimpleIdentifier PrefixedIdentifier TypeName
144 addTestSource('foo(b.^ f) { }'); 154 addTestSource('foo(b.^ f) { }');
145 assertTarget('f', 'b.f'); 155 assertTarget('f', 'b.f');
146 } 156 }
147 157
148 test_FormalParameter_partialType2() { 158 test_FormalParameter_partialType2() {
149 // SimpleIdentifier PrefixedIdentifier TypeName 159 // SimpleIdentifier PrefixedIdentifier TypeName
150 addTestSource('foo(b.z^ f) { }'); 160 addTestSource('foo(b.z^ f) { }');
151 assertTarget('z', 'b.z'); 161 assertTarget('z', 'b.z');
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 addTestSource('main() {int b^ = 1;}'); 550 addTestSource('main() {int b^ = 1;}');
541 assertTarget('b = 1', 'int b = 1'); 551 assertTarget('b = 1', 'int b = 1');
542 } 552 }
543 553
544 test_VariableDeclaration_lhs_identifier_before() { 554 test_VariableDeclaration_lhs_identifier_before() {
545 // VariableDeclaration VariableDeclarationList 555 // VariableDeclaration VariableDeclarationList
546 addTestSource('main() {int ^b = 1;}'); 556 addTestSource('main() {int ^b = 1;}');
547 assertTarget('b = 1', 'int b = 1'); 557 assertTarget('b = 1', 'int b = 1');
548 } 558 }
549 } 559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698