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

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

Issue 2873943003: cleanup dart code completion contributors (Closed)
Patch Set: rebase Created 3 years, 7 months 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 d473088b8215ef0c65a616c8ce230e6de75404d5..9f6614dcb2f78cff5417fe07b9bc9b2fa9747781 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
@@ -22,27 +22,6 @@ class NamedConstructorContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
DartCompletionRequest request) async {
- // Determine if the target looks like a named constructor.
- AstNode parsedNode = request.target.containingNode;
- SimpleIdentifier targetId;
- if (parsedNode is ConstructorName) {
- TypeName type = parsedNode.type;
- if (type != null) {
- targetId = type.name;
- }
- } else if (parsedNode is PrefixedIdentifier) {
- // Some PrefixedIdentifier nodes are transformed into
- // ConstructorName nodes during the resolution process.
- targetId = parsedNode.prefix;
- }
- if (targetId == null) {
- return EMPTY_LIST;
- }
-
- // Resolve the target to determine the type
- await request.resolveContainingExpression(targetId);
-
- // Recompute the target since resolution may have changed it
AstNode node = request.target.containingNode;
LibraryElement libElem = request.libraryElement;
if (libElem == null) {

Powered by Google App Engine
This is Rietveld 408576698