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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart

Issue 812233003: update completion cache key to include part directives (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 | « no previous file | pkg/analysis_server/test/services/completion/imported_computer_test.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 services.completion.dart.cache; 5 library services.completion.dart.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/protocol_server.dart' hide Element, 10 import 'package:analysis_server/src/protocol_server.dart' hide Element,
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 _importedCompletions.add(suggestion.completion); 279 _importedCompletions.add(suggestion.completion);
280 } 280 }
281 281
282 /** 282 /**
283 * Compute the hash of the imports for the given compilation unit. 283 * Compute the hash of the imports for the given compilation unit.
284 */ 284 */
285 String _computeImportKey(CompilationUnit unit) { 285 String _computeImportKey(CompilationUnit unit) {
286 StringBuffer sb = new StringBuffer(); 286 StringBuffer sb = new StringBuffer();
287 unit.directives.forEach((Directive directive) { 287 unit.directives.forEach((Directive directive) {
288 if (directive is ImportDirective) { 288 sb.write(directive.toSource());
289 sb.write(directive.toSource());
290 }
291 }); 289 });
292 return sb.toString(); 290 return sb.toString();
293 } 291 }
294 } 292 }
295 293
296 /** 294 /**
297 * A visitor for building suggestions based upon the elements defined by 295 * A visitor for building suggestions based upon the elements defined by
298 * a source file contained in the same library but not the same as 296 * a source file contained in the same library but not the same as
299 * the source in which the completions are being requested. 297 * the source in which the completions are being requested.
300 */ 298 */
(...skipping 25 matching lines...) Expand all
326 @override 324 @override
327 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { 325 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
328 cache.addSuggestion(element, CompletionRelevance.DEFAULT); 326 cache.addSuggestion(element, CompletionRelevance.DEFAULT);
329 } 327 }
330 328
331 @override 329 @override
332 void visitTopLevelVariableElement(TopLevelVariableElement element) { 330 void visitTopLevelVariableElement(TopLevelVariableElement element) {
333 cache.addSuggestion(element, CompletionRelevance.DEFAULT); 331 cache.addSuggestion(element, CompletionRelevance.DEFAULT);
334 } 332 }
335 } 333 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/imported_computer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698