| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |