You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Computes the string of Dart code that should be used as the new value
168
191
/// for this argument.
169
192
///
@@ -188,7 +211,7 @@ class EditArgumentHandler extends SharedMessageHandler<EditArgumentParams, Null>
188
211
} else {
189
212
returnerror(
190
213
ServerErrorCodes.EditArgumentInvalidValue,
191
-
"The value for the parameter '${edit.name}' cannot be null",
214
+
"The value for the parameter '${edit.name}' can't be null",
192
215
);
193
216
}
194
217
}
@@ -211,14 +234,20 @@ class EditArgumentHandler extends SharedMessageHandler<EditArgumentParams, Null>
211
234
);
212
235
} elseif (parameter.type caseInterfaceType(
213
236
:EnumElement element,
214
-
) when value isString?) {
215
-
var allowedValues =getQualifiedEnumConstantNames(element);
216
-
if (allowedValues.contains(value)) {
217
-
returnsuccess(value.toString());
237
+
) when value isString) {
238
+
var enumConstant =getEnumConstantMatching(element, matching: value);
239
+
if (enumConstant !=null) {
240
+
returnsuccess(
241
+
_computeEnumValue(
242
+
requestValue: value,
243
+
enumConstant: enumConstant,
244
+
currentArgument: argument,
245
+
),
246
+
);
218
247
} else {
219
248
returnerror(
220
249
ServerErrorCodes.EditArgumentInvalidValue,
221
-
"The value for the parameter '${edit.name}' should be one of ${allowedValues.map((v) => "'$v'").join(', ')} but was '$value'",
250
+
"The value for the parameter '${edit.name}' should be one of ${getQualifiedEnumConstantNames(element).map((v) => "'$v'").join(', ')} but was '$value'",
0 commit comments