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

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

Issue 1008973003: include library prefix completions given trailing local method invocation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/invocation_computer.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.invocation; 5 library test.services.completion.invocation;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 '''); 130 ''');
131 return computeFull((bool result) { 131 return computeFull((bool result) {
132 // TODO(paulberry): modify assertSuggestSetter so that we can pass 'int' 132 // TODO(paulberry): modify assertSuggestSetter so that we can pass 'int'
133 // as a parmeter to it, and it will check the appropriate field in 133 // as a parmeter to it, and it will check the appropriate field in
134 // the suggestion object. 134 // the suggestion object.
135 CompletionSuggestion suggestion = assertSuggestSetter('t'); 135 CompletionSuggestion suggestion = assertSuggestSetter('t');
136 expect(suggestion.element.parameters, '(int value)'); 136 expect(suggestion.element.parameters, '(int value)');
137 }); 137 });
138 } 138 }
139 139
140 test_libraryPrefix() {
141 // SimpleIdentifier PrefixedIdentifier ExpressionStatement
142 addTestSource('import "dart:async" as bar; foo() {bar.^}');
143 return computeFull((bool result) {
144 assertSuggestClass('Future');
145 });
146 }
147
148 test_libraryPrefix2() {
149 // SimpleIdentifier MethodInvocation ExpressionStatement
150 addTestSource('import "dart:async" as bar; foo() {bar.^ print("f")}');
151 return computeFull((bool result) {
152 assertSuggestClass('Future');
153 });
154 }
155
140 test_local() { 156 test_local() {
141 addTestSource('foo() {String x = "bar"; x.^}'); 157 addTestSource('foo() {String x = "bar"; x.^}');
142 return computeFull((bool result) { 158 return computeFull((bool result) {
143 assertSuggestGetter('length', 'int'); 159 assertSuggestGetter('length', 'int');
144 }); 160 });
145 } 161 }
146 162
147 test_local_is() { 163 test_local_is() {
148 addTestSource('foo() {var x; if (x is String) x.^}'); 164 addTestSource('foo() {var x; if (x is String) x.^}');
149 return computeFull((bool result) { 165 return computeFull((bool result) {
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 507 }
492 void test(Derived d) { 508 void test(Derived d) {
493 d.^ 509 d.^
494 } 510 }
495 '''); 511 ''');
496 return computeFull((bool result) { 512 return computeFull((bool result) {
497 assertSuggestMethod('f', 'Base', 'void'); 513 assertSuggestMethod('f', 'Base', 'void');
498 }); 514 });
499 } 515 }
500 } 516 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/invocation_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698