CompletionExistingImportsParams.fromJson constructor
CompletionExistingImportsParams.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory CompletionExistingImportsParams.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');
}
ExistingImports imports;
if (json.containsKey('imports')) {
imports = ExistingImports.fromJson(
jsonDecoder, '$jsonPath.imports', json['imports']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'imports');
}
return CompletionExistingImportsParams(file, imports);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'completion.existingImports params', json);
}
}