| Index: pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
|
| index f51aa26cc097825d0cd052f221f4721e1bfb38a4..9344e15d44de11e2c426d49c20ecc484334fdb82 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
|
| @@ -166,20 +166,13 @@ class LocalConstructorContributor extends DartCompletionContributor {
|
| if (!optype.isPrefixed) {
|
| if (optype.includeConstructorSuggestions) {
|
| AstNode node = request.target.containingNode;
|
| - // TODO (jwren) not quite right, see the test
|
| - // test_InstanceCreationExpression_variable_declaration_filter,
|
| - // the node at this point is an InstanceCreationExpression, but we want
|
| - // the containing variable declaration resolved,
|
| - if (node is Expression) {
|
| - while (node.parent is Expression) {
|
| - node = node.parent;
|
| - }
|
| - await request.resolveExpression(node);
|
| -
|
| - // Discard any cached target information
|
| - // because it may have changed as a result of the resolution
|
| - node = request.target.containingNode;
|
| - }
|
| +
|
| + await request.resolveContainingStatement(node);
|
| +
|
| + // Discard any cached target information
|
| + // because it may have changed as a result of the resolution
|
| + node = request.target.containingNode;
|
| +
|
| _Visitor visitor = new _Visitor(request, suggestions, optype);
|
| visitor.visit(node);
|
| }
|
|
|