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

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

Issue 795633004: filter imported element suggestions to reduce number of results sent to client (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge and fix test Created 6 years 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.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/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/channel/channel.dart'; 10 import 'package:analysis_server/src/channel/channel.dart';
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 test_topLevel() { 416 test_topLevel() {
417 addTestFile(''' 417 addTestFile('''
418 typedef foo(); 418 typedef foo();
419 var test = ''; 419 var test = '';
420 main() {tes^t} 420 main() {tes^t}
421 '''); 421 ''');
422 return getSuggestions().then((_) { 422 return getSuggestions().then((_) {
423 expect(replacementOffset, equals(completionOffset - 3)); 423 expect(replacementOffset, equals(completionOffset - 3));
424 expect(replacementLength, equals(4)); 424 expect(replacementLength, equals(4));
425 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); 425 // Suggestions based upon imported results are partially filtered
426 //assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
426 assertHasResult(CompletionSuggestionKind.INVOCATION, 'test'); 427 assertHasResult(CompletionSuggestionKind.INVOCATION, 'test');
427 assertNoResult('HtmlElement'); 428 assertNoResult('HtmlElement');
428 }); 429 });
429 } 430 }
430 } 431 }
431 432
432 class MockCache extends CompletionCache { 433 class MockCache extends CompletionCache {
433 MockCache(AnalysisContext context, Source source) : super(context, source); 434 MockCache(AnalysisContext context, Source source) : super(context, source);
434 } 435 }
435 436
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 558
558 void contextsChangedRaw(ContextsChangedEvent newEvent) { 559 void contextsChangedRaw(ContextsChangedEvent newEvent) {
559 super.contextsChanged(newEvent); 560 super.contextsChanged(newEvent);
560 } 561 }
561 562
562 CompletionManager createCompletionManager(AnalysisContext context, 563 CompletionManager createCompletionManager(AnalysisContext context,
563 Source source, SearchEngine searchEngine) { 564 Source source, SearchEngine searchEngine) {
564 return new MockCompletionManager(mockContext, source, searchEngine); 565 return new MockCompletionManager(mockContext, source, searchEngine);
565 } 566 }
566 } 567 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698