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

Unified Diff: pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart

Issue 1507303002: extract LibraryMemberContributor from prefixed element contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
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 da6c15d6dbc7336e2d29168739aa953eb9fb3fb9..feaa33e9533190d517e608e71ae4936419c19db4 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
@@ -317,32 +317,35 @@ class _PrefixedIdentifierSuggestionBuilder
@override
Future<bool> visitPrefixElement(PrefixElement element) {
bool modified = false;
+
+ // Suggested by LibraryMemberContributor
+
// Find the import directive with the given prefix
- for (Directive directive in request.unit.directives) {
- if (directive is ImportDirective) {
- if (directive.prefix != null) {
- if (directive.prefix.name == element.name) {
- // Suggest elements from the imported library
- LibraryElement library = directive.uriElement;
- AstNode node = request.target.containingNode;
- bool typesOnly = node.parent is TypeName;
- bool instCreation =
- typesOnly && node.parent.parent is ConstructorName;
- LibraryElementSuggestionBuilder.suggestionsFor(
- request,
- CompletionSuggestionKind.INVOCATION,
- library,
- typesOnly,
- instCreation);
- modified = true;
- if (directive.deferredKeyword != null) {
- FunctionElement loadLibFunct = library.loadLibraryFunction;
- request.addSuggestion(createSuggestion(loadLibFunct));
- }
- }
- }
- }
- }
+ // for (Directive directive in request.unit.directives) {
+ // if (directive is ImportDirective) {
+ // if (directive.prefix != null) {
+ // if (directive.prefix.name == element.name) {
+ // // Suggest elements from the imported library
+ // LibraryElement library = directive.uriElement;
+ // AstNode node = request.target.containingNode;
+ // bool typesOnly = node.parent is TypeName;
+ // bool instCreation =
+ // typesOnly && node.parent.parent is ConstructorName;
+ // LibraryElementSuggestionBuilder.suggestionsFor(
+ // request,
+ // CompletionSuggestionKind.INVOCATION,
+ // library,
+ // typesOnly,
+ // instCreation);
+ // modified = true;
+ // if (directive.deferredKeyword != null) {
+ // FunctionElement loadLibFunct = library.loadLibraryFunction;
+ // request.addSuggestion(createSuggestion(loadLibFunct));
+ // }
+ // }
+ // }
+ // }
+ // }
return new Future.value(modified);
}

Powered by Google App Engine
This is Rietveld 408576698