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

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

Issue 1516963002: simplify library element accessor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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/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) {

Powered by Google App Engine
This is Rietveld 408576698