| Index: pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
|
| diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
|
| index 7762e9e9a69306d25fc772aaffe2ce310b43e74f..088ff77e977e347323cc1ae6d362e2338aee101c 100644
|
| --- a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
|
| +++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
|
| @@ -266,14 +266,10 @@ class CompletionTarget {
|
| * The target [AstNode] hierarchy *must* be resolved for this to work.
|
| */
|
| bool isFunctionalArgument() {
|
| - if (argIndex == null) {
|
| - return false;
|
| - }
|
| - AstNode argList = containingNode;
|
| - if (argList is! ArgumentList) {
|
| + if (!maybeFunctionalArgument()) {
|
| return false;
|
| }
|
| - AstNode parent = argList.parent;
|
| + AstNode parent = containingNode.parent;
|
| if (parent is InstanceCreationExpression) {
|
| DartType instType = parent.bestType;
|
| if (instType != null) {
|
| @@ -302,6 +298,21 @@ class CompletionTarget {
|
| }
|
|
|
| /**
|
| + * Return `true` if the target is a functional argument in an argument list.
|
| + * The target [AstNode] hierarchy *must* be resolved for this to work.
|
| + */
|
| + bool maybeFunctionalArgument() {
|
| + if (argIndex == null) {
|
| + return false;
|
| + }
|
| + AstNode argList = containingNode;
|
| + if (argList is! ArgumentList) {
|
| + return false;
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + /**
|
| * Determine if the offset is contained in a preceding comment token
|
| * and return that token, otherwise return `null`.
|
| */
|
|
|