Index: pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart |
index 0ea173da5ff2c3b4ca50b3af674c242c5f8e8107..86640d99ddda9c67ed879ce9645aa35a4d6614cd 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart |
@@ -37,17 +37,15 @@ class NamedConstructorContributor extends DartCompletionContributor { |
return EMPTY_LIST; |
} |
- // Resolve the containing library element |
- LibraryElement libElem = await request.libraryElement; |
- if (libElem == null) { |
- return EMPTY_LIST; |
- } |
- |
// Resolve the target to determine the type |
await request.resolveExpression(targetId); |
// Recompute the target since resolution may have changed it |
AstNode node = request.target.containingNode; |
+ LibraryElement libElem = request.libraryElement; |
+ if (libElem == null) { |
+ return EMPTY_LIST; |
+ } |
// Build the list of suggestions |
if (node is ConstructorName) { |