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

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

Issue 1001143002: remove duplicate completion suggestions (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
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/protocol.dart' as protocol 9 import 'package:analysis_server/src/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 assertSuggestLibraryPrefix('g'); 1273 assertSuggestLibraryPrefix('g');
1274 assertNotSuggested('G'); 1274 assertNotSuggested('G');
1275 //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW); 1275 //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
1276 assertSuggestImportedClass('Object'); 1276 assertSuggestImportedClass('Object');
1277 assertSuggestImportedFunction('min', 'num'); 1277 assertSuggestImportedFunction('min', 'num');
1278 //assertSuggestImportedFunction( 1278 //assertSuggestImportedFunction(
1279 // 'max', 1279 // 'max',
1280 // 'num', 1280 // 'num',
1281 // false, 1281 // false,
1282 // COMPLETION_RELEVANCE_LOW); 1282 // COMPLETION_RELEVANCE_LOW);
1283 assertSuggestTopLevelVarGetterSetter('T1', 'String'); 1283 if (computer is ImportedComputer) {
1284 // TODO(danrubel) should be top level var suggestion
1285 assertSuggestGetter('T1', 'String');
1286 }
1284 assertNotSuggested('_T2'); 1287 assertNotSuggested('_T2');
1285 //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW); 1288 //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
1286 assertNotSuggested('_T4'); 1289 assertNotSuggested('_T4');
1287 assertSuggestLocalTopLevelVar('T5', 'int'); 1290 assertSuggestLocalTopLevelVar('T5', 'int');
1288 assertSuggestLocalTopLevelVar('_T6', null); 1291 assertSuggestLocalTopLevelVar('_T6', null);
1289 assertNotSuggested('=='); 1292 assertNotSuggested('==');
1290 assertSuggestLocalGetter('T7', 'String'); 1293 assertSuggestLocalGetter('T7', 'String');
1291 assertSuggestLocalSetter('T8'); 1294 assertSuggestLocalSetter('T8');
1292 assertSuggestLocalGetter('clog', 'int'); 1295 assertSuggestLocalGetter('clog', 'int');
1293 assertSuggestLocalSetter('blog'); 1296 assertSuggestLocalSetter('blog');
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 computeFast(); 2585 computeFast();
2583 return computeFull((bool result) { 2586 return computeFull((bool result) {
2584 expect(request.replacementOffset, completionOffset - 3); 2587 expect(request.replacementOffset, completionOffset - 3);
2585 expect(request.replacementLength, 3); 2588 expect(request.replacementLength, 3);
2586 assertNotSuggested('c'); 2589 assertNotSuggested('c');
2587 assertNotSuggested('_d'); 2590 assertNotSuggested('_d');
2588 // Imported suggestion are filtered by 1st character 2591 // Imported suggestion are filtered by 1st character
2589 assertSuggestImportedFunction('nowIsIt', null); 2592 assertSuggestImportedFunction('nowIsIt', null);
2590 assertNotSuggested('T1'); 2593 assertNotSuggested('T1');
2591 // TODO (danrubel) this really should be TopLevelVar not getter/setter 2594 // TODO (danrubel) this really should be TopLevelVar not getter/setter
2592 assertSuggestTopLevelVarGetterSetter('newT1', 'int'); 2595 if (computer is ImportedComputer) {
2596 assertSuggestGetter('newT1', 'int');
2597 }
2593 assertNotSuggested('z'); 2598 assertNotSuggested('z');
2594 assertSuggestLocalTopLevelVar('m', 'dynamic'); 2599 assertSuggestLocalTopLevelVar('m', 'dynamic');
2595 assertSuggestLocalFunction('newer', 'String'); 2600 assertSuggestLocalFunction('newer', 'String');
2596 }); 2601 });
2597 } 2602 }
2598 2603
2599 test_Literal_list() { 2604 test_Literal_list() {
2600 // ']' ListLiteral ArgumentList MethodInvocation 2605 // ']' ListLiteral ArgumentList MethodInvocation
2601 addTestSource('main() {var Some; print([^]);}'); 2606 addTestSource('main() {var Some; print([^]);}');
2602 computeFast(); 2607 computeFast();
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 assertNotSuggested('bar2'); 3623 assertNotSuggested('bar2');
3619 assertNotSuggested('_B'); 3624 assertNotSuggested('_B');
3620 assertSuggestLocalClass('Y'); 3625 assertSuggestLocalClass('Y');
3621 assertSuggestLocalClass('C'); 3626 assertSuggestLocalClass('C');
3622 assertSuggestLocalVariable('f', null); 3627 assertSuggestLocalVariable('f', null);
3623 assertNotSuggested('x'); 3628 assertNotSuggested('x');
3624 assertNotSuggested('e'); 3629 assertNotSuggested('e');
3625 }); 3630 });
3626 } 3631 }
3627 } 3632 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698