| Index: pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| index d31d3d19922dcd69ef223b6e6d365168403a7452..10c69c19643fd8ceef79cc2241f950ef6c125e05 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| @@ -13,7 +13,9 @@ import 'package:analysis_server/src/services/completion/suggestion_builder.dart'
|
| import 'package:analyzer/src/generated/ast.dart';
|
| import 'package:analyzer/src/generated/element.dart';
|
|
|
| -import '../../protocol_server.dart' show CompletionSuggestionKind;
|
| +import '../../protocol_server.dart' as protocol;
|
| +import '../../protocol_server.dart'
|
| + show CompletionSuggestion, CompletionSuggestionKind;
|
|
|
| /**
|
| * A contributor for calculating invocation / access suggestions
|
| @@ -303,8 +305,6 @@ class _PrefixedIdentifierSuggestionBuilder
|
|
|
| @override
|
| Future<bool> visitPrefixElement(PrefixElement element) {
|
| - //TODO (danrubel) reimplement to use prefixElement.importedLibraries
|
| - // once that accessor is implemented and available in Dart
|
| bool modified = false;
|
| // Find the import directive with the given prefix
|
| for (Directive directive in request.unit.directives) {
|
| @@ -317,6 +317,22 @@ class _PrefixedIdentifierSuggestionBuilder
|
| CompletionSuggestionKind.INVOCATION, library,
|
| request.target.containingNode.parent is TypeName);
|
| modified = true;
|
| + if (directive.deferredKeyword != null) {
|
| + String completion = 'loadLibrary';
|
| + CompletionSuggestion suggestion = new CompletionSuggestion(
|
| + CompletionSuggestionKind.INVOCATION, DART_RELEVANCE_DEFAULT,
|
| + completion, completion.length, 0, false, false,
|
| + parameterNames: [],
|
| + parameterTypes: [],
|
| + requiredParameterCount: 0,
|
| + hasNamedParameters: false,
|
| + returnType: 'void');
|
| + suggestion.element = new protocol.Element(
|
| + protocol.ElementKind.FUNCTION, completion,
|
| + protocol.Element.makeFlags(),
|
| + parameters: '()', returnType: 'void');
|
| + request.addSuggestion(suggestion);
|
| + }
|
| }
|
| }
|
| }
|
|
|