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

Side by Side Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 471143002: first incomplete cut at invocation/accessor suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_services/lib/src/completion/dart_completion_manager.dart » ('j') | 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.domain.completion; 5 library test.domain.completion;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/domain_completion.dart'; 10 import 'package:analysis_server/src/domain_completion.dart';
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return getSuggestions().then((_) { 170 return getSuggestions().then((_) {
171 expect(replacementOffset, equals(completionOffset)); 171 expect(replacementOffset, equals(completionOffset));
172 expect(replacementLength, equals(0)); 172 expect(replacementLength, equals(0));
173 assertHasResult(CompletionSuggestionKind.CLASS, 'A'); 173 assertHasResult(CompletionSuggestionKind.CLASS, 'A');
174 assertHasResult(CompletionSuggestionKind.FIELD, 'a'); 174 assertHasResult(CompletionSuggestionKind.FIELD, 'a');
175 assertHasResult(CompletionSuggestionKind.LOCAL_VARIABLE, 'b'); 175 assertHasResult(CompletionSuggestionKind.LOCAL_VARIABLE, 'b');
176 assertHasResult(CompletionSuggestionKind.METHOD_NAME, 'x'); 176 assertHasResult(CompletionSuggestionKind.METHOD_NAME, 'x');
177 }); 177 });
178 } 178 }
179 179
180 test_invocation() {
181 addTestFile('class A {b() {}} main() {A a; a.^}');
182 return getSuggestions().then((_) {
183 expect(replacementOffset, equals(completionOffset));
184 expect(replacementLength, equals(0));
185 assertHasResult(CompletionSuggestionKind.METHOD, 'b');
186 });
187 }
188
180 test_topLevel() { 189 test_topLevel() {
181 addTestFile(''' 190 addTestFile('''
182 typedef foo(); 191 typedef foo();
183 var test = ''; 192 var test = '';
184 main() {tes^t} 193 main() {tes^t}
185 '''); 194 ''');
186 return getSuggestions().then((_) { 195 return getSuggestions().then((_) {
187 // expect(replacementOffset, equals(completionOffset - 3)); 196 // expect(replacementOffset, equals(completionOffset - 3));
188 // expect(replacementLength, equals(4)); 197 // expect(replacementLength, equals(4));
189 assertHasResult(CompletionSuggestionKind.CLASS, 'Object'); 198 assertHasResult(CompletionSuggestionKind.CLASS, 'Object');
190 assertHasResult(CompletionSuggestionKind.TOP_LEVEL_VARIABLE, 'test'); 199 assertHasResult(CompletionSuggestionKind.TOP_LEVEL_VARIABLE, 'test');
191 assertNoResult('HtmlElement'); 200 assertNoResult('HtmlElement');
192 }); 201 });
193 } 202 }
194 } 203 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_services/lib/src/completion/dart_completion_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698