Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
index ce09e5a6d0e8137c4735bcc72ce2e1896103f0e9..5dc5c2df0601534fdccdf9239b89356d1e03ebd7 100644 |
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
@@ -1979,6 +1979,7 @@ class FixProcessor { |
// append parameters |
sb.append('('); |
List<Expression> arguments = argumentList.arguments; |
+ bool hasNamedParameters = false; |
for (int i = 0; i < arguments.length; i++) { |
Expression argument = arguments[i]; |
// append separator |
@@ -1986,8 +1987,15 @@ class FixProcessor { |
sb.append(', '); |
} |
// append parameter |
+ if (argument is NamedExpression && !hasNamedParameters) { |
+ hasNamedParameters = true; |
+ sb.append('{'); |
+ } |
_appendParameterForArgument(sb, i, argument); |
} |
+ if (hasNamedParameters) { |
+ sb.append('}'); |
+ } |
} |
void _addFix_undefinedMethod_useSimilar() { |
@@ -2281,7 +2289,9 @@ class FixProcessor { |
sb.append(' '); |
} |
// append parameter name |
- { |
+ if (argument is NamedExpression) { |
+ sb.append(argument.name.label.name); |
+ } else { |
Set<String> excluded = new Set<String>(); |
List<String> suggestions = |
_getArgumentNameSuggestions(excluded, type, argument, index); |