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

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

Issue 784853003: include lower relevance suggestions only if they are already cached (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/imported_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.toplevel; 5 library test.services.completion.toplevel;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analysis_server/src/services/completion/completion_manager.dart' ; 8 import 'package:analysis_server/src/services/completion/completion_manager.dart' ;
9 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt'; 9 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt';
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 isCached(cache.otherImportedSuggestions, completion)) { 92 isCached(cache.otherImportedSuggestions, completion)) {
93 fail('expected $completion NOT to be cached'); 93 fail('expected $completion NOT to be cached');
94 } 94 }
95 } 95 }
96 96
97 bool isCached(List<CompletionSuggestion> suggestions, String completion) => 97 bool isCached(List<CompletionSuggestion> suggestions, String completion) =>
98 suggestions.any((CompletionSuggestion s) => s.completion == completion); 98 suggestions.any((CompletionSuggestion s) => s.completion == completion);
99 99
100 @override 100 @override
101 void setUpComputer() { 101 void setUpComputer() {
102 computer = new ImportedComputer(); 102 computer = new ImportedComputer(shouldWaitForLowPrioritySuggestions: true);
103 } 103 }
104 104
105 @override 105 @override
106 test_ArgumentList() { 106 test_ArgumentList() {
107 return super.test_ArgumentList().then((_) { 107 return super.test_ArgumentList().then((_) {
108 expect(request.cache.importKey, "import '/libA.dart';"); 108 expect(request.cache.importKey, "import '/libA.dart';");
109 }); 109 });
110 } 110 }
111 111
112 @override 112 @override
(...skipping 25 matching lines...) Expand all
138 test_Block_inherited_imported() { 138 test_Block_inherited_imported() {
139 return super.test_Block_inherited_imported().then((_) { 139 return super.test_Block_inherited_imported().then((_) {
140 assertCached('E'); 140 assertCached('E');
141 assertCached('F'); 141 assertCached('F');
142 assertNotCached('e1'); 142 assertNotCached('e1');
143 assertNotCached('i2'); 143 assertNotCached('i2');
144 assertNotCached('m1'); 144 assertNotCached('m1');
145 }); 145 });
146 } 146 }
147 } 147 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/imported_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698