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

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

Issue 1398333002: Extract protocol_dart.dart APIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add new files. Created 5 years, 2 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
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' 10 import 'package:analysis_server/src/protocol_server.dart'
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 suggestion = new CompletionSuggestion( 264 suggestion = new CompletionSuggestion(
265 CompletionSuggestionKind.INVOCATION, 265 CompletionSuggestionKind.INVOCATION,
266 DART_RELEVANCE_DEFAULT, 266 DART_RELEVANCE_DEFAULT,
267 completion, 267 completion,
268 completion.length, 268 completion.length,
269 0, 269 0,
270 importElem.isDeprecated, 270 importElem.isDeprecated,
271 false); 271 false);
272 LibraryElement lib = importElem.importedLibrary; 272 LibraryElement lib = importElem.importedLibrary;
273 if (lib != null) { 273 if (lib != null) {
274 suggestion.element = newElement_fromEngine(lib); 274 suggestion.element = convertElement(lib);
275 } 275 }
276 libraryPrefixSuggestions.add(suggestion); 276 libraryPrefixSuggestions.add(suggestion);
277 _importedCompletions.add(suggestion.completion); 277 _importedCompletions.add(suggestion.completion);
278 } 278 }
279 } 279 }
280 280
281 /** 281 /**
282 * Add suggestions for all top level elements in the context 282 * Add suggestions for all top level elements in the context
283 * excluding those elemnents for which suggestions have already been added. 283 * excluding those elemnents for which suggestions have already been added.
284 */ 284 */
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 @override 413 @override
414 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { 414 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
415 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); 415 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT);
416 } 416 }
417 417
418 @override 418 @override
419 void visitTopLevelVariableElement(TopLevelVariableElement element) { 419 void visitTopLevelVariableElement(TopLevelVariableElement element) {
420 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); 420 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT);
421 } 421 }
422 } 422 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698