EditGetAvailableRefactoringsParams.fromJson constructor
EditGetAvailableRefactoringsParams.fromJson()
Implementation
factory EditGetAvailableRefactoringsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString('$jsonPath.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt('$jsonPath.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'length');
}
return EditGetAvailableRefactoringsParams(file, offset, length);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'edit.getAvailableRefactorings params', json);
}
}