diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index 02bba4472ee..f7a7af31f57 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -44,14 +44,14 @@ class AddContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'add') { - throw jsonDecoder.mismatch(jsonPath, 'equal add', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'add'", json); } String content; if (json.containsKey('content')) { content = jsonDecoder.decodeString('$jsonPath.content', json['content']); } else { - throw jsonDecoder.mismatch(jsonPath, 'content', json); + throw jsonDecoder.mismatch(jsonPath, "'content'", json); } int? version; if (json.containsKey('version')) { @@ -59,7 +59,7 @@ class AddContentOverlay implements HasToJson { } return AddContentOverlay(content, version: version); } else { - throw jsonDecoder.mismatch(jsonPath, 'AddContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'AddContentOverlay'", json); } } @@ -162,28 +162,28 @@ class AnalysisError implements HasToJson { severity = AnalysisErrorSeverity.fromJson( jsonDecoder, '$jsonPath.severity', json['severity']); } else { - throw jsonDecoder.mismatch(jsonPath, 'severity', json); + throw jsonDecoder.mismatch(jsonPath, "'severity'", json); } AnalysisErrorType type; if (json.containsKey('type')) { type = AnalysisErrorType.fromJson( jsonDecoder, '$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } Location location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, '$jsonPath.location', json['location']); } else { - throw jsonDecoder.mismatch(jsonPath, 'location', json); + throw jsonDecoder.mismatch(jsonPath, "'location'", json); } String message; if (json.containsKey('message')) { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } String? correction; if (json.containsKey('correction')) { @@ -194,7 +194,7 @@ class AnalysisError implements HasToJson { if (json.containsKey('code')) { code = jsonDecoder.decodeString('$jsonPath.code', json['code']); } else { - throw jsonDecoder.mismatch(jsonPath, 'code', json); + throw jsonDecoder.mismatch(jsonPath, "'code'", json); } String? url; if (json.containsKey('url')) { @@ -218,7 +218,7 @@ class AnalysisError implements HasToJson { contextMessages: contextMessages, hasFix: hasFix); } else { - throw jsonDecoder.mismatch(jsonPath, 'AnalysisError', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisError'", json); } } @@ -310,7 +310,7 @@ enum AnalysisErrorSeverity { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorSeverity', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisErrorSeverity'", json); } @override @@ -359,7 +359,7 @@ enum AnalysisErrorType { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorType', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisErrorType'", json); } @override @@ -393,18 +393,18 @@ class AssistDescription implements HasToJson { if (json.containsKey('id')) { id = jsonDecoder.decodeString('$jsonPath.id', json['id']); } else { - throw jsonDecoder.mismatch(jsonPath, 'id', json); + throw jsonDecoder.mismatch(jsonPath, "'id'", json); } String message; if (json.containsKey('message')) { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } return AssistDescription(id, message); } else { - throw jsonDecoder.mismatch(jsonPath, 'AssistDescription', json); + throw jsonDecoder.mismatch(jsonPath, "'AssistDescription'", json); } } @@ -464,7 +464,7 @@ class ChangeContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'change') { - throw jsonDecoder.mismatch(jsonPath, 'equal change', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'change'", json); } List edits; if (json.containsKey('edits')) { @@ -474,7 +474,7 @@ class ChangeContentOverlay implements HasToJson { (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } int? version; if (json.containsKey('version')) { @@ -482,7 +482,7 @@ class ChangeContentOverlay implements HasToJson { } return ChangeContentOverlay(edits, version: version); } else { - throw jsonDecoder.mismatch(jsonPath, 'ChangeContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'ChangeContentOverlay'", json); } } @@ -714,21 +714,21 @@ class CompletionSuggestion implements HasToJson { kind = CompletionSuggestionKind.fromJson( jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int relevance; if (json.containsKey('relevance')) { relevance = jsonDecoder.decodeInt('$jsonPath.relevance', json['relevance']); } else { - throw jsonDecoder.mismatch(jsonPath, 'relevance', json); + throw jsonDecoder.mismatch(jsonPath, "'relevance'", json); } String completion; if (json.containsKey('completion')) { completion = jsonDecoder.decodeString( '$jsonPath.completion', json['completion']); } else { - throw jsonDecoder.mismatch(jsonPath, 'completion', json); + throw jsonDecoder.mismatch(jsonPath, "'completion'", json); } String? displayText; if (json.containsKey('displayText')) { @@ -750,28 +750,28 @@ class CompletionSuggestion implements HasToJson { selectionOffset = jsonDecoder.decodeInt( '$jsonPath.selectionOffset', json['selectionOffset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'selectionOffset', json); + throw jsonDecoder.mismatch(jsonPath, "'selectionOffset'", json); } int selectionLength; if (json.containsKey('selectionLength')) { selectionLength = jsonDecoder.decodeInt( '$jsonPath.selectionLength', json['selectionLength']); } else { - throw jsonDecoder.mismatch(jsonPath, 'selectionLength', json); + throw jsonDecoder.mismatch(jsonPath, "'selectionLength'", json); } bool isDeprecated; if (json.containsKey('isDeprecated')) { isDeprecated = jsonDecoder.decodeBool( '$jsonPath.isDeprecated', json['isDeprecated']); } else { - throw jsonDecoder.mismatch(jsonPath, 'isDeprecated', json); + throw jsonDecoder.mismatch(jsonPath, "'isDeprecated'", json); } bool isPotential; if (json.containsKey('isPotential')) { isPotential = jsonDecoder.decodeBool( '$jsonPath.isPotential', json['isPotential']); } else { - throw jsonDecoder.mismatch(jsonPath, 'isPotential', json); + throw jsonDecoder.mismatch(jsonPath, "'isPotential'", json); } String? docSummary; if (json.containsKey('docSummary')) { @@ -872,7 +872,7 @@ class CompletionSuggestion implements HasToJson { libraryUri: libraryUri, isNotImported: isNotImported); } else { - throw jsonDecoder.mismatch(jsonPath, 'CompletionSuggestion', json); + throw jsonDecoder.mismatch(jsonPath, "'CompletionSuggestion'", json); } } @@ -1094,7 +1094,7 @@ enum CompletionSuggestionKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'CompletionSuggestionKind', json); + throw jsonDecoder.mismatch(jsonPath, "'CompletionSuggestionKind'", json); } @override @@ -1130,18 +1130,18 @@ class DiagnosticMessage implements HasToJson { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } Location location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, '$jsonPath.location', json['location']); } else { - throw jsonDecoder.mismatch(jsonPath, 'location', json); + throw jsonDecoder.mismatch(jsonPath, "'location'", json); } return DiagnosticMessage(message, location); } else { - throw jsonDecoder.mismatch(jsonPath, 'DiagnosticMessage', json); + throw jsonDecoder.mismatch(jsonPath, "'DiagnosticMessage'", json); } } @@ -1266,13 +1266,13 @@ class Element implements HasToJson { kind = ElementKind.fromJson(jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } Location? location; if (json.containsKey('location')) { @@ -1283,7 +1283,7 @@ class Element implements HasToJson { if (json.containsKey('flags')) { flags = jsonDecoder.decodeInt('$jsonPath.flags', json['flags']); } else { - throw jsonDecoder.mismatch(jsonPath, 'flags', json); + throw jsonDecoder.mismatch(jsonPath, "'flags'", json); } String? parameters; if (json.containsKey('parameters')) { @@ -1312,7 +1312,7 @@ class Element implements HasToJson { typeParameters: typeParameters, aliasedType: aliasedType); } else { - throw jsonDecoder.mismatch(jsonPath, 'Element', json); + throw jsonDecoder.mismatch(jsonPath, "'Element'", json); } } @@ -1486,7 +1486,7 @@ enum ElementKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'ElementKind', json); + throw jsonDecoder.mismatch(jsonPath, "'ElementKind'", json); } @override @@ -1524,25 +1524,25 @@ class FixDescription implements HasToJson { if (json.containsKey('id')) { id = jsonDecoder.decodeString('$jsonPath.id', json['id']); } else { - throw jsonDecoder.mismatch(jsonPath, 'id', json); + throw jsonDecoder.mismatch(jsonPath, "'id'", json); } String message; if (json.containsKey('message')) { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } List codes; if (json.containsKey('codes')) { codes = jsonDecoder.decodeList( '$jsonPath.codes', json['codes'], jsonDecoder.decodeString); } else { - throw jsonDecoder.mismatch(jsonPath, 'codes', json); + throw jsonDecoder.mismatch(jsonPath, "'codes'", json); } return FixDescription(id, message, codes); } else { - throw jsonDecoder.mismatch(jsonPath, 'FixDescription', json); + throw jsonDecoder.mismatch(jsonPath, "'FixDescription'", json); } } @@ -1625,7 +1625,7 @@ enum FoldingKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'FoldingKind', json); + throw jsonDecoder.mismatch(jsonPath, "'FoldingKind'", json); } @override @@ -1664,23 +1664,23 @@ class FoldingRegion implements HasToJson { kind = FoldingKind.fromJson(jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return FoldingRegion(kind, offset, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'FoldingRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'FoldingRegion'", json); } } @@ -1744,23 +1744,23 @@ class HighlightRegion implements HasToJson { type = HighlightRegionType.fromJson( jsonDecoder, '$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return HighlightRegion(type, offset, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'HighlightRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'HighlightRegion'", json); } } @@ -2073,7 +2073,7 @@ enum HighlightRegionType { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'HighlightRegionType', json); + throw jsonDecoder.mismatch(jsonPath, "'HighlightRegionType'", json); } @override @@ -2117,13 +2117,13 @@ class LinkedEditGroup implements HasToJson { (String jsonPath, Object? json) => Position.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'positions', json); + throw jsonDecoder.mismatch(jsonPath, "'positions'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } List suggestions; if (json.containsKey('suggestions')) { @@ -2133,11 +2133,11 @@ class LinkedEditGroup implements HasToJson { (String jsonPath, Object? json) => LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'suggestions', json); + throw jsonDecoder.mismatch(jsonPath, "'suggestions'", json); } return LinkedEditGroup(positions, length, suggestions); } else { - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditGroup', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditGroup'", json); } } @@ -2215,18 +2215,18 @@ class LinkedEditSuggestion implements HasToJson { if (json.containsKey('value')) { value = jsonDecoder.decodeString('$jsonPath.value', json['value']); } else { - throw jsonDecoder.mismatch(jsonPath, 'value', json); + throw jsonDecoder.mismatch(jsonPath, "'value'", json); } LinkedEditSuggestionKind kind; if (json.containsKey('kind')) { kind = LinkedEditSuggestionKind.fromJson( jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } return LinkedEditSuggestion(value, kind); } else { - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditSuggestion', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditSuggestion'", json); } } @@ -2284,7 +2284,7 @@ enum LinkedEditSuggestionKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditSuggestionKind', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditSuggestionKind'", json); } @override @@ -2344,33 +2344,33 @@ class Location implements HasToJson { if (json.containsKey('file')) { file = jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int startLine; if (json.containsKey('startLine')) { startLine = jsonDecoder.decodeInt('$jsonPath.startLine', json['startLine']); } else { - throw jsonDecoder.mismatch(jsonPath, 'startLine', json); + throw jsonDecoder.mismatch(jsonPath, "'startLine'", json); } int startColumn; if (json.containsKey('startColumn')) { startColumn = jsonDecoder.decodeInt('$jsonPath.startColumn', json['startColumn']); } else { - throw jsonDecoder.mismatch(jsonPath, 'startColumn', json); + throw jsonDecoder.mismatch(jsonPath, "'startColumn'", json); } int? endLine; if (json.containsKey('endLine')) { @@ -2384,7 +2384,7 @@ class Location implements HasToJson { return Location(file, offset, length, startLine, startColumn, endLine: endLine, endColumn: endColumn); } else { - throw jsonDecoder.mismatch(jsonPath, 'Location', json); + throw jsonDecoder.mismatch(jsonPath, "'Location'", json); } } @@ -2467,24 +2467,24 @@ class NavigationRegion implements HasToJson { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } List targets; if (json.containsKey('targets')) { targets = jsonDecoder.decodeList( '$jsonPath.targets', json['targets'], jsonDecoder.decodeInt); } else { - throw jsonDecoder.mismatch(jsonPath, 'targets', json); + throw jsonDecoder.mismatch(jsonPath, "'targets'", json); } return NavigationRegion(offset, length, targets); } else { - throw jsonDecoder.mismatch(jsonPath, 'NavigationRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'NavigationRegion'", json); } } @@ -2573,40 +2573,40 @@ class NavigationTarget implements HasToJson { kind = ElementKind.fromJson(jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int fileIndex; if (json.containsKey('fileIndex')) { fileIndex = jsonDecoder.decodeInt('$jsonPath.fileIndex', json['fileIndex']); } else { - throw jsonDecoder.mismatch(jsonPath, 'fileIndex', json); + throw jsonDecoder.mismatch(jsonPath, "'fileIndex'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int startLine; if (json.containsKey('startLine')) { startLine = jsonDecoder.decodeInt('$jsonPath.startLine', json['startLine']); } else { - throw jsonDecoder.mismatch(jsonPath, 'startLine', json); + throw jsonDecoder.mismatch(jsonPath, "'startLine'", json); } int startColumn; if (json.containsKey('startColumn')) { startColumn = jsonDecoder.decodeInt('$jsonPath.startColumn', json['startColumn']); } else { - throw jsonDecoder.mismatch(jsonPath, 'startColumn', json); + throw jsonDecoder.mismatch(jsonPath, "'startColumn'", json); } int? codeOffset; if (json.containsKey('codeOffset')) { @@ -2622,7 +2622,7 @@ class NavigationTarget implements HasToJson { kind, fileIndex, offset, length, startLine, startColumn, codeOffset: codeOffset, codeLength: codeLength); } else { - throw jsonDecoder.mismatch(jsonPath, 'NavigationTarget', json); + throw jsonDecoder.mismatch(jsonPath, "'NavigationTarget'", json); } } @@ -2707,24 +2707,24 @@ class Occurrences implements HasToJson { element = Element.fromJson(jsonDecoder, '$jsonPath.element', json['element']); } else { - throw jsonDecoder.mismatch(jsonPath, 'element', json); + throw jsonDecoder.mismatch(jsonPath, "'element'", json); } List offsets; if (json.containsKey('offsets')) { offsets = jsonDecoder.decodeList( '$jsonPath.offsets', json['offsets'], jsonDecoder.decodeInt); } else { - throw jsonDecoder.mismatch(jsonPath, 'offsets', json); + throw jsonDecoder.mismatch(jsonPath, "'offsets'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return Occurrences(element, offsets, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'Occurrences', json); + throw jsonDecoder.mismatch(jsonPath, "'Occurrences'", json); } } @@ -2807,33 +2807,33 @@ class Outline implements HasToJson { element = Element.fromJson(jsonDecoder, '$jsonPath.element', json['element']); } else { - throw jsonDecoder.mismatch(jsonPath, 'element', json); + throw jsonDecoder.mismatch(jsonPath, "'element'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int codeOffset; if (json.containsKey('codeOffset')) { codeOffset = jsonDecoder.decodeInt('$jsonPath.codeOffset', json['codeOffset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'codeOffset', json); + throw jsonDecoder.mismatch(jsonPath, "'codeOffset'", json); } int codeLength; if (json.containsKey('codeLength')) { codeLength = jsonDecoder.decodeInt('$jsonPath.codeLength', json['codeLength']); } else { - throw jsonDecoder.mismatch(jsonPath, 'codeLength', json); + throw jsonDecoder.mismatch(jsonPath, "'codeLength'", json); } List? children; if (json.containsKey('children')) { @@ -2846,7 +2846,7 @@ class Outline implements HasToJson { return Outline(element, offset, length, codeOffset, codeLength, children: children); } else { - throw jsonDecoder.mismatch(jsonPath, 'Outline', json); + throw jsonDecoder.mismatch(jsonPath, "'Outline'", json); } } @@ -2928,19 +2928,19 @@ class ParameterInfo implements HasToJson { kind = ParameterKind.fromJson(jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } String type; if (json.containsKey('type')) { type = jsonDecoder.decodeString('$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } String? defaultValue; if (json.containsKey('defaultValue')) { @@ -2949,7 +2949,7 @@ class ParameterInfo implements HasToJson { } return ParameterInfo(kind, name, type, defaultValue: defaultValue); } else { - throw jsonDecoder.mismatch(jsonPath, 'ParameterInfo', json); + throw jsonDecoder.mismatch(jsonPath, "'ParameterInfo'", json); } } @@ -3021,7 +3021,7 @@ enum ParameterKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'ParameterKind', json); + throw jsonDecoder.mismatch(jsonPath, "'ParameterKind'", json); } @override @@ -3070,21 +3070,21 @@ class PluginDetails implements HasToJson { if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } List lintRules; if (json.containsKey('lintRules')) { lintRules = jsonDecoder.decodeList( '$jsonPath.lintRules', json['lintRules'], jsonDecoder.decodeString); } else { - throw jsonDecoder.mismatch(jsonPath, 'lintRules', json); + throw jsonDecoder.mismatch(jsonPath, "'lintRules'", json); } List warningRules; if (json.containsKey('warningRules')) { warningRules = jsonDecoder.decodeList('$jsonPath.warningRules', json['warningRules'], jsonDecoder.decodeString); } else { - throw jsonDecoder.mismatch(jsonPath, 'warningRules', json); + throw jsonDecoder.mismatch(jsonPath, "'warningRules'", json); } List assists; if (json.containsKey('assists')) { @@ -3094,7 +3094,7 @@ class PluginDetails implements HasToJson { (String jsonPath, Object? json) => AssistDescription.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'assists', json); + throw jsonDecoder.mismatch(jsonPath, "'assists'", json); } List fixes; if (json.containsKey('fixes')) { @@ -3104,11 +3104,11 @@ class PluginDetails implements HasToJson { (String jsonPath, Object? json) => FixDescription.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'fixes', json); + throw jsonDecoder.mismatch(jsonPath, "'fixes'", json); } return PluginDetails(name, lintRules, warningRules, assists, fixes); } else { - throw jsonDecoder.mismatch(jsonPath, 'PluginDetails', json); + throw jsonDecoder.mismatch(jsonPath, "'PluginDetails'", json); } } @@ -3179,17 +3179,17 @@ class Position implements HasToJson { if (json.containsKey('file')) { file = jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } return Position(file, offset); } else { - throw jsonDecoder.mismatch(jsonPath, 'Position', json); + throw jsonDecoder.mismatch(jsonPath, "'Position'", json); } } @@ -3262,7 +3262,7 @@ enum RefactoringKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'RefactoringKind', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringKind'", json); } @override @@ -3318,19 +3318,19 @@ class RefactoringMethodParameter implements HasToJson { kind = RefactoringMethodParameterKind.fromJson( jsonDecoder, '$jsonPath.kind', json['kind']); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String type; if (json.containsKey('type')) { type = jsonDecoder.decodeString('$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } String? parameters; if (json.containsKey('parameters')) { @@ -3340,7 +3340,8 @@ class RefactoringMethodParameter implements HasToJson { return RefactoringMethodParameter(kind, type, name, id: id, parameters: parameters); } else { - throw jsonDecoder.mismatch(jsonPath, 'RefactoringMethodParameter', json); + throw jsonDecoder.mismatch( + jsonPath, "'RefactoringMethodParameter'", json); } } @@ -3412,7 +3413,7 @@ enum RefactoringMethodParameterKind { } } throw jsonDecoder.mismatch( - jsonPath, 'RefactoringMethodParameterKind', json); + jsonPath, "'RefactoringMethodParameterKind'", json); } @override @@ -3453,14 +3454,14 @@ class RefactoringProblem implements HasToJson { severity = RefactoringProblemSeverity.fromJson( jsonDecoder, '$jsonPath.severity', json['severity']); } else { - throw jsonDecoder.mismatch(jsonPath, 'severity', json); + throw jsonDecoder.mismatch(jsonPath, "'severity'", json); } String message; if (json.containsKey('message')) { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } Location? location; if (json.containsKey('location')) { @@ -3469,7 +3470,7 @@ class RefactoringProblem implements HasToJson { } return RefactoringProblem(severity, message, location: location); } else { - throw jsonDecoder.mismatch(jsonPath, 'RefactoringProblem', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringProblem'", json); } } @@ -3551,7 +3552,7 @@ enum RefactoringProblemSeverity { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'RefactoringProblemSeverity', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringProblemSeverity'", json); } /// Returns the [RefactoringProblemSeverity] with the maximal severity. @@ -3580,11 +3581,11 @@ class RemoveContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'remove') { - throw jsonDecoder.mismatch(jsonPath, 'equal remove', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'remove'", json); } return RemoveContentOverlay(); } else { - throw jsonDecoder.mismatch(jsonPath, 'RemoveContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'RemoveContentOverlay'", json); } } @@ -3666,7 +3667,7 @@ class SourceChange implements HasToJson { message = jsonDecoder.decodeString('$jsonPath.message', json['message']); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } List edits; if (json.containsKey('edits')) { @@ -3676,7 +3677,7 @@ class SourceChange implements HasToJson { (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } List linkedEditGroups; if (json.containsKey('linkedEditGroups')) { @@ -3686,7 +3687,7 @@ class SourceChange implements HasToJson { (String jsonPath, Object? json) => LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'linkedEditGroups', json); + throw jsonDecoder.mismatch(jsonPath, "'linkedEditGroups'", json); } Position? selection; if (json.containsKey('selection')) { @@ -3709,7 +3710,7 @@ class SourceChange implements HasToJson { selectionLength: selectionLength, id: id); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceChange', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceChange'", json); } } @@ -3848,20 +3849,20 @@ class SourceEdit implements HasToJson { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } String replacement; if (json.containsKey('replacement')) { replacement = jsonDecoder.decodeString( '$jsonPath.replacement', json['replacement']); } else { - throw jsonDecoder.mismatch(jsonPath, 'replacement', json); + throw jsonDecoder.mismatch(jsonPath, "'replacement'", json); } String? id; if (json.containsKey('id')) { @@ -3875,7 +3876,7 @@ class SourceEdit implements HasToJson { return SourceEdit(offset, length, replacement, id: id, description: description); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceEdit', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceEdit'", json); } } @@ -3961,14 +3962,14 @@ class SourceFileEdit implements HasToJson { if (json.containsKey('file')) { file = jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int fileStamp; if (json.containsKey('fileStamp')) { fileStamp = jsonDecoder.decodeInt('$jsonPath.fileStamp', json['fileStamp']); } else { - throw jsonDecoder.mismatch(jsonPath, 'fileStamp', json); + throw jsonDecoder.mismatch(jsonPath, "'fileStamp'", json); } List edits; if (json.containsKey('edits')) { @@ -3978,11 +3979,11 @@ class SourceFileEdit implements HasToJson { (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } return SourceFileEdit(file, fileStamp, edits: edits); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceFileEdit', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceFileEdit'", json); } } diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart index 31ec5f74dda..5e6bf9ba685 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart @@ -49,7 +49,7 @@ class AddContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'add') { - throw jsonDecoder.mismatch(jsonPath, 'equal add', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'add'", json); } String content; if (json.containsKey('content')) { @@ -58,7 +58,7 @@ class AddContentOverlay implements HasToJson { json['content'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'content', json); + throw jsonDecoder.mismatch(jsonPath, "'content'", json); } int? version; if (json.containsKey('version')) { @@ -66,7 +66,7 @@ class AddContentOverlay implements HasToJson { } return AddContentOverlay(content, version: version); } else { - throw jsonDecoder.mismatch(jsonPath, 'AddContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'AddContentOverlay'", json); } } @@ -181,7 +181,7 @@ class AnalysisError implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'severity', json); + throw jsonDecoder.mismatch(jsonPath, "'severity'", json); } AnalysisErrorType type; if (json.containsKey('type')) { @@ -192,7 +192,7 @@ class AnalysisError implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } Location location; if (json.containsKey('location')) { @@ -203,7 +203,7 @@ class AnalysisError implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'location', json); + throw jsonDecoder.mismatch(jsonPath, "'location'", json); } String message; if (json.containsKey('message')) { @@ -212,7 +212,7 @@ class AnalysisError implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } String? correction; if (json.containsKey('correction')) { @@ -225,7 +225,7 @@ class AnalysisError implements HasToJson { if (json.containsKey('code')) { code = jsonDecoder.decodeString('$jsonPath.code', json['code']); } else { - throw jsonDecoder.mismatch(jsonPath, 'code', json); + throw jsonDecoder.mismatch(jsonPath, "'code'", json); } String? url; if (json.containsKey('url')) { @@ -260,7 +260,7 @@ class AnalysisError implements HasToJson { hasFix: hasFix, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'AnalysisError', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisError'", json); } } @@ -366,7 +366,7 @@ enum AnalysisErrorSeverity { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorSeverity', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisErrorSeverity'", json); } @override @@ -419,7 +419,7 @@ enum AnalysisErrorType { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorType', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisErrorType'", json); } @override @@ -457,7 +457,7 @@ class AssistDescription implements HasToJson { if (json.containsKey('id')) { id = jsonDecoder.decodeString('$jsonPath.id', json['id']); } else { - throw jsonDecoder.mismatch(jsonPath, 'id', json); + throw jsonDecoder.mismatch(jsonPath, "'id'", json); } String message; if (json.containsKey('message')) { @@ -466,11 +466,11 @@ class AssistDescription implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } return AssistDescription(id, message); } else { - throw jsonDecoder.mismatch(jsonPath, 'AssistDescription', json); + throw jsonDecoder.mismatch(jsonPath, "'AssistDescription'", json); } } @@ -531,7 +531,7 @@ class ChangeContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'change') { - throw jsonDecoder.mismatch(jsonPath, 'equal change', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'change'", json); } List edits; if (json.containsKey('edits')) { @@ -546,7 +546,7 @@ class ChangeContentOverlay implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } int? version; if (json.containsKey('version')) { @@ -554,7 +554,7 @@ class ChangeContentOverlay implements HasToJson { } return ChangeContentOverlay(edits, version: version); } else { - throw jsonDecoder.mismatch(jsonPath, 'ChangeContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'ChangeContentOverlay'", json); } } @@ -799,7 +799,7 @@ class CompletionSuggestion implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int relevance; if (json.containsKey('relevance')) { @@ -808,7 +808,7 @@ class CompletionSuggestion implements HasToJson { json['relevance'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'relevance', json); + throw jsonDecoder.mismatch(jsonPath, "'relevance'", json); } String completion; if (json.containsKey('completion')) { @@ -817,7 +817,7 @@ class CompletionSuggestion implements HasToJson { json['completion'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'completion', json); + throw jsonDecoder.mismatch(jsonPath, "'completion'", json); } String? displayText; if (json.containsKey('displayText')) { @@ -847,7 +847,7 @@ class CompletionSuggestion implements HasToJson { json['selectionOffset'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'selectionOffset', json); + throw jsonDecoder.mismatch(jsonPath, "'selectionOffset'", json); } int selectionLength; if (json.containsKey('selectionLength')) { @@ -856,7 +856,7 @@ class CompletionSuggestion implements HasToJson { json['selectionLength'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'selectionLength', json); + throw jsonDecoder.mismatch(jsonPath, "'selectionLength'", json); } bool isDeprecated; if (json.containsKey('isDeprecated')) { @@ -865,7 +865,7 @@ class CompletionSuggestion implements HasToJson { json['isDeprecated'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'isDeprecated', json); + throw jsonDecoder.mismatch(jsonPath, "'isDeprecated'", json); } bool isPotential; if (json.containsKey('isPotential')) { @@ -874,7 +874,7 @@ class CompletionSuggestion implements HasToJson { json['isPotential'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'isPotential', json); + throw jsonDecoder.mismatch(jsonPath, "'isPotential'", json); } String? docSummary; if (json.containsKey('docSummary')) { @@ -1014,7 +1014,7 @@ class CompletionSuggestion implements HasToJson { isNotImported: isNotImported, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'CompletionSuggestion', json); + throw jsonDecoder.mismatch(jsonPath, "'CompletionSuggestion'", json); } } @@ -1251,7 +1251,7 @@ enum CompletionSuggestionKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'CompletionSuggestionKind', json); + throw jsonDecoder.mismatch(jsonPath, "'CompletionSuggestionKind'", json); } @override @@ -1293,7 +1293,7 @@ class DiagnosticMessage implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } Location location; if (json.containsKey('location')) { @@ -1304,11 +1304,11 @@ class DiagnosticMessage implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'location', json); + throw jsonDecoder.mismatch(jsonPath, "'location'", json); } return DiagnosticMessage(message, location); } else { - throw jsonDecoder.mismatch(jsonPath, 'DiagnosticMessage', json); + throw jsonDecoder.mismatch(jsonPath, "'DiagnosticMessage'", json); } } @@ -1445,13 +1445,13 @@ class Element implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } Location? location; if (json.containsKey('location')) { @@ -1466,7 +1466,7 @@ class Element implements HasToJson { if (json.containsKey('flags')) { flags = jsonDecoder.decodeInt('$jsonPath.flags', json['flags']); } else { - throw jsonDecoder.mismatch(jsonPath, 'flags', json); + throw jsonDecoder.mismatch(jsonPath, "'flags'", json); } String? parameters; if (json.containsKey('parameters')) { @@ -1507,7 +1507,7 @@ class Element implements HasToJson { aliasedType: aliasedType, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'Element', json); + throw jsonDecoder.mismatch(jsonPath, "'Element'", json); } } @@ -1687,7 +1687,7 @@ enum ElementKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'ElementKind', json); + throw jsonDecoder.mismatch(jsonPath, "'ElementKind'", json); } @override @@ -1729,7 +1729,7 @@ class FixDescription implements HasToJson { if (json.containsKey('id')) { id = jsonDecoder.decodeString('$jsonPath.id', json['id']); } else { - throw jsonDecoder.mismatch(jsonPath, 'id', json); + throw jsonDecoder.mismatch(jsonPath, "'id'", json); } String message; if (json.containsKey('message')) { @@ -1738,7 +1738,7 @@ class FixDescription implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } List codes; if (json.containsKey('codes')) { @@ -1748,11 +1748,11 @@ class FixDescription implements HasToJson { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'codes', json); + throw jsonDecoder.mismatch(jsonPath, "'codes'", json); } return FixDescription(id, message, codes); } else { - throw jsonDecoder.mismatch(jsonPath, 'FixDescription', json); + throw jsonDecoder.mismatch(jsonPath, "'FixDescription'", json); } } @@ -1835,7 +1835,7 @@ enum FoldingKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'FoldingKind', json); + throw jsonDecoder.mismatch(jsonPath, "'FoldingKind'", json); } @override @@ -1882,23 +1882,23 @@ class FoldingRegion implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return FoldingRegion(kind, offset, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'FoldingRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'FoldingRegion'", json); } } @@ -1966,23 +1966,23 @@ class HighlightRegion implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return HighlightRegion(type, offset, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'HighlightRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'HighlightRegion'", json); } } @@ -2295,7 +2295,7 @@ enum HighlightRegionType { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'HighlightRegionType', json); + throw jsonDecoder.mismatch(jsonPath, "'HighlightRegionType'", json); } @override @@ -2348,13 +2348,13 @@ class LinkedEditGroup implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'positions', json); + throw jsonDecoder.mismatch(jsonPath, "'positions'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } List suggestions; if (json.containsKey('suggestions')) { @@ -2369,11 +2369,11 @@ class LinkedEditGroup implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'suggestions', json); + throw jsonDecoder.mismatch(jsonPath, "'suggestions'", json); } return LinkedEditGroup(positions, length, suggestions); } else { - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditGroup', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditGroup'", json); } } @@ -2468,7 +2468,7 @@ class LinkedEditSuggestion implements HasToJson { if (json.containsKey('value')) { value = jsonDecoder.decodeString('$jsonPath.value', json['value']); } else { - throw jsonDecoder.mismatch(jsonPath, 'value', json); + throw jsonDecoder.mismatch(jsonPath, "'value'", json); } LinkedEditSuggestionKind kind; if (json.containsKey('kind')) { @@ -2479,11 +2479,11 @@ class LinkedEditSuggestion implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } return LinkedEditSuggestion(value, kind); } else { - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditSuggestion', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditSuggestion'", json); } } @@ -2542,7 +2542,7 @@ enum LinkedEditSuggestionKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'LinkedEditSuggestionKind', json); + throw jsonDecoder.mismatch(jsonPath, "'LinkedEditSuggestionKind'", json); } @override @@ -2616,19 +2616,19 @@ class Location implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int startLine; if (json.containsKey('startLine')) { @@ -2637,7 +2637,7 @@ class Location implements HasToJson { json['startLine'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'startLine', json); + throw jsonDecoder.mismatch(jsonPath, "'startLine'", json); } int startColumn; if (json.containsKey('startColumn')) { @@ -2646,7 +2646,7 @@ class Location implements HasToJson { json['startColumn'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'startColumn', json); + throw jsonDecoder.mismatch(jsonPath, "'startColumn'", json); } int? endLine; if (json.containsKey('endLine')) { @@ -2669,7 +2669,7 @@ class Location implements HasToJson { endColumn: endColumn, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'Location', json); + throw jsonDecoder.mismatch(jsonPath, "'Location'", json); } } @@ -2756,13 +2756,13 @@ class NavigationRegion implements HasToJson { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } List targets; if (json.containsKey('targets')) { @@ -2772,11 +2772,11 @@ class NavigationRegion implements HasToJson { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'targets', json); + throw jsonDecoder.mismatch(jsonPath, "'targets'", json); } return NavigationRegion(offset, length, targets); } else { - throw jsonDecoder.mismatch(jsonPath, 'NavigationRegion', json); + throw jsonDecoder.mismatch(jsonPath, "'NavigationRegion'", json); } } @@ -2876,7 +2876,7 @@ class NavigationTarget implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } int fileIndex; if (json.containsKey('fileIndex')) { @@ -2885,19 +2885,19 @@ class NavigationTarget implements HasToJson { json['fileIndex'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'fileIndex', json); + throw jsonDecoder.mismatch(jsonPath, "'fileIndex'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int startLine; if (json.containsKey('startLine')) { @@ -2906,7 +2906,7 @@ class NavigationTarget implements HasToJson { json['startLine'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'startLine', json); + throw jsonDecoder.mismatch(jsonPath, "'startLine'", json); } int startColumn; if (json.containsKey('startColumn')) { @@ -2915,7 +2915,7 @@ class NavigationTarget implements HasToJson { json['startColumn'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'startColumn', json); + throw jsonDecoder.mismatch(jsonPath, "'startColumn'", json); } int? codeOffset; if (json.containsKey('codeOffset')) { @@ -2942,7 +2942,7 @@ class NavigationTarget implements HasToJson { codeLength: codeLength, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'NavigationTarget', json); + throw jsonDecoder.mismatch(jsonPath, "'NavigationTarget'", json); } } @@ -3035,7 +3035,7 @@ class Occurrences implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'element', json); + throw jsonDecoder.mismatch(jsonPath, "'element'", json); } List offsets; if (json.containsKey('offsets')) { @@ -3045,17 +3045,17 @@ class Occurrences implements HasToJson { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'offsets', json); + throw jsonDecoder.mismatch(jsonPath, "'offsets'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return Occurrences(element, offsets, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'Occurrences', json); + throw jsonDecoder.mismatch(jsonPath, "'Occurrences'", json); } } @@ -3147,19 +3147,19 @@ class Outline implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'element', json); + throw jsonDecoder.mismatch(jsonPath, "'element'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } int codeOffset; if (json.containsKey('codeOffset')) { @@ -3168,7 +3168,7 @@ class Outline implements HasToJson { json['codeOffset'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'codeOffset', json); + throw jsonDecoder.mismatch(jsonPath, "'codeOffset'", json); } int codeLength; if (json.containsKey('codeLength')) { @@ -3177,7 +3177,7 @@ class Outline implements HasToJson { json['codeLength'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'codeLength', json); + throw jsonDecoder.mismatch(jsonPath, "'codeLength'", json); } List? children; if (json.containsKey('children')) { @@ -3201,7 +3201,7 @@ class Outline implements HasToJson { children: children, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'Outline', json); + throw jsonDecoder.mismatch(jsonPath, "'Outline'", json); } } @@ -3295,19 +3295,19 @@ class ParameterInfo implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } String type; if (json.containsKey('type')) { type = jsonDecoder.decodeString('$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } String? defaultValue; if (json.containsKey('defaultValue')) { @@ -3318,7 +3318,7 @@ class ParameterInfo implements HasToJson { } return ParameterInfo(kind, name, type, defaultValue: defaultValue); } else { - throw jsonDecoder.mismatch(jsonPath, 'ParameterInfo', json); + throw jsonDecoder.mismatch(jsonPath, "'ParameterInfo'", json); } } @@ -3389,7 +3389,7 @@ enum ParameterKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'ParameterKind', json); + throw jsonDecoder.mismatch(jsonPath, "'ParameterKind'", json); } @override @@ -3447,7 +3447,7 @@ class PluginDetails implements HasToJson { if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } List lintRules; if (json.containsKey('lintRules')) { @@ -3457,7 +3457,7 @@ class PluginDetails implements HasToJson { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'lintRules', json); + throw jsonDecoder.mismatch(jsonPath, "'lintRules'", json); } List warningRules; if (json.containsKey('warningRules')) { @@ -3467,7 +3467,7 @@ class PluginDetails implements HasToJson { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'warningRules', json); + throw jsonDecoder.mismatch(jsonPath, "'warningRules'", json); } List assists; if (json.containsKey('assists')) { @@ -3482,7 +3482,7 @@ class PluginDetails implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'assists', json); + throw jsonDecoder.mismatch(jsonPath, "'assists'", json); } List fixes; if (json.containsKey('fixes')) { @@ -3497,11 +3497,11 @@ class PluginDetails implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'fixes', json); + throw jsonDecoder.mismatch(jsonPath, "'fixes'", json); } return PluginDetails(name, lintRules, warningRules, assists, fixes); } else { - throw jsonDecoder.mismatch(jsonPath, 'PluginDetails', json); + throw jsonDecoder.mismatch(jsonPath, "'PluginDetails'", json); } } @@ -3600,17 +3600,17 @@ class Position implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } return Position(file, offset); } else { - throw jsonDecoder.mismatch(jsonPath, 'Position', json); + throw jsonDecoder.mismatch(jsonPath, "'Position'", json); } } @@ -3684,7 +3684,7 @@ enum RefactoringKind { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'RefactoringKind', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringKind'", json); } @override @@ -3753,19 +3753,19 @@ class RefactoringMethodParameter implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String type; if (json.containsKey('type')) { type = jsonDecoder.decodeString('$jsonPath.type', json['type']); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } String? parameters; if (json.containsKey('parameters')) { @@ -3782,7 +3782,11 @@ class RefactoringMethodParameter implements HasToJson { parameters: parameters, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'RefactoringMethodParameter', json); + throw jsonDecoder.mismatch( + jsonPath, + "'RefactoringMethodParameter'", + json, + ); } } @@ -3853,7 +3857,7 @@ enum RefactoringMethodParameterKind { } throw jsonDecoder.mismatch( jsonPath, - 'RefactoringMethodParameterKind', + "'RefactoringMethodParameterKind'", json, ); } @@ -3904,7 +3908,7 @@ class RefactoringProblem implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'severity', json); + throw jsonDecoder.mismatch(jsonPath, "'severity'", json); } String message; if (json.containsKey('message')) { @@ -3913,7 +3917,7 @@ class RefactoringProblem implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } Location? location; if (json.containsKey('location')) { @@ -3926,7 +3930,7 @@ class RefactoringProblem implements HasToJson { } return RefactoringProblem(severity, message, location: location); } else { - throw jsonDecoder.mismatch(jsonPath, 'RefactoringProblem', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringProblem'", json); } } @@ -4012,7 +4016,7 @@ enum RefactoringProblemSeverity { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'RefactoringProblemSeverity', json); + throw jsonDecoder.mismatch(jsonPath, "'RefactoringProblemSeverity'", json); } /// Returns the [RefactoringProblemSeverity] with the maximal severity. @@ -4046,11 +4050,11 @@ class RemoveContentOverlay implements HasToJson { json ??= {}; if (json is Map) { if (json['type'] != 'remove') { - throw jsonDecoder.mismatch(jsonPath, 'equal remove', json); + throw jsonDecoder.mismatch(jsonPath, "equal to 'remove'", json); } return RemoveContentOverlay(); } else { - throw jsonDecoder.mismatch(jsonPath, 'RemoveContentOverlay', json); + throw jsonDecoder.mismatch(jsonPath, "'RemoveContentOverlay'", json); } } @@ -4139,7 +4143,7 @@ class SourceChange implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } List edits; if (json.containsKey('edits')) { @@ -4154,7 +4158,7 @@ class SourceChange implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } List linkedEditGroups; if (json.containsKey('linkedEditGroups')) { @@ -4169,7 +4173,7 @@ class SourceChange implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'linkedEditGroups', json); + throw jsonDecoder.mismatch(jsonPath, "'linkedEditGroups'", json); } Position? selection; if (json.containsKey('selection')) { @@ -4200,7 +4204,7 @@ class SourceChange implements HasToJson { id: id, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceChange', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceChange'", json); } } @@ -4371,13 +4375,13 @@ class SourceEdit implements HasToJson { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } String replacement; if (json.containsKey('replacement')) { @@ -4386,7 +4390,7 @@ class SourceEdit implements HasToJson { json['replacement'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'replacement', json); + throw jsonDecoder.mismatch(jsonPath, "'replacement'", json); } String? id; if (json.containsKey('id')) { @@ -4407,7 +4411,7 @@ class SourceEdit implements HasToJson { description: description, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceEdit', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceEdit'", json); } } @@ -4495,7 +4499,7 @@ class SourceFileEdit implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int fileStamp; if (json.containsKey('fileStamp')) { @@ -4504,7 +4508,7 @@ class SourceFileEdit implements HasToJson { json['fileStamp'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'fileStamp', json); + throw jsonDecoder.mismatch(jsonPath, "'fileStamp'", json); } List edits; if (json.containsKey('edits')) { @@ -4519,11 +4523,11 @@ class SourceFileEdit implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'edits', json); + throw jsonDecoder.mismatch(jsonPath, "'edits'", json); } return SourceFileEdit(file, fileStamp, edits: edits); } else { - throw jsonDecoder.mismatch(jsonPath, 'SourceFileEdit', json); + throw jsonDecoder.mismatch(jsonPath, "'SourceFileEdit'", json); } } diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart index 673711ed79d..93b5f84a7e1 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart @@ -48,7 +48,7 @@ class AnalysisErrorFixes implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'error', json); + throw jsonDecoder.mismatch(jsonPath, "'error'", json); } List fixes; if (json.containsKey('fixes')) { @@ -63,11 +63,11 @@ class AnalysisErrorFixes implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'fixes', json); + throw jsonDecoder.mismatch(jsonPath, "'fixes'", json); } return AnalysisErrorFixes(error, fixes: fixes); } else { - throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorFixes', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisErrorFixes'", json); } } @@ -137,7 +137,7 @@ class AnalysisErrorsParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List errors; if (json.containsKey('errors')) { @@ -152,11 +152,11 @@ class AnalysisErrorsParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'errors', json); + throw jsonDecoder.mismatch(jsonPath, "'errors'", json); } return AnalysisErrorsParams(file, errors); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.errors params', json); + throw jsonDecoder.mismatch(jsonPath, "'analysis.errors params'", json); } } @@ -245,7 +245,7 @@ class AnalysisFoldingParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List regions; if (json.containsKey('regions')) { @@ -260,11 +260,11 @@ class AnalysisFoldingParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'regions', json); + throw jsonDecoder.mismatch(jsonPath, "'regions'", json); } return AnalysisFoldingParams(file, regions); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.folding params', json); + throw jsonDecoder.mismatch(jsonPath, "'analysis.folding params'", json); } } @@ -359,25 +359,25 @@ class AnalysisGetNavigationParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return AnalysisGetNavigationParams(file, offset, length); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.getNavigation params', + "'analysis.getNavigation params'", json, ); } @@ -473,7 +473,7 @@ class AnalysisGetNavigationResult implements ResponseResult { jsonDecoder.decodeString(jsonPath, json), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'files', json); + throw jsonDecoder.mismatch(jsonPath, "'files'", json); } List targets; if (json.containsKey('targets')) { @@ -488,7 +488,7 @@ class AnalysisGetNavigationResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'targets', json); + throw jsonDecoder.mismatch(jsonPath, "'targets'", json); } List regions; if (json.containsKey('regions')) { @@ -503,13 +503,13 @@ class AnalysisGetNavigationResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'regions', json); + throw jsonDecoder.mismatch(jsonPath, "'regions'", json); } return AnalysisGetNavigationResult(files, targets, regions); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.getNavigation result', + "'analysis.getNavigation result'", json, ); } @@ -627,13 +627,13 @@ class AnalysisHandleWatchEventsParams implements RequestParams { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'events', json); + throw jsonDecoder.mismatch(jsonPath, "'events'", json); } return AnalysisHandleWatchEventsParams(events); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.handleWatchEvents params', + "'analysis.handleWatchEvents params'", json, ); } @@ -747,7 +747,7 @@ class AnalysisHighlightsParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List regions; if (json.containsKey('regions')) { @@ -762,11 +762,15 @@ class AnalysisHighlightsParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'regions', json); + throw jsonDecoder.mismatch(jsonPath, "'regions'", json); } return AnalysisHighlightsParams(file, regions); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.highlights params', json); + throw jsonDecoder.mismatch( + jsonPath, + "'analysis.highlights params'", + json, + ); } } @@ -865,7 +869,7 @@ class AnalysisNavigationParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List regions; if (json.containsKey('regions')) { @@ -880,7 +884,7 @@ class AnalysisNavigationParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'regions', json); + throw jsonDecoder.mismatch(jsonPath, "'regions'", json); } List targets; if (json.containsKey('targets')) { @@ -895,7 +899,7 @@ class AnalysisNavigationParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'targets', json); + throw jsonDecoder.mismatch(jsonPath, "'targets'", json); } List files; if (json.containsKey('files')) { @@ -909,11 +913,15 @@ class AnalysisNavigationParams implements HasToJson { jsonDecoder.decodeString(jsonPath, json), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'files', json); + throw jsonDecoder.mismatch(jsonPath, "'files'", json); } return AnalysisNavigationParams(file, regions, targets, files); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.navigation params', json); + throw jsonDecoder.mismatch( + jsonPath, + "'analysis.navigation params'", + json, + ); } } @@ -1025,7 +1033,7 @@ class AnalysisOccurrencesParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List occurrences; if (json.containsKey('occurrences')) { @@ -1040,11 +1048,15 @@ class AnalysisOccurrencesParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'occurrences', json); + throw jsonDecoder.mismatch(jsonPath, "'occurrences'", json); } return AnalysisOccurrencesParams(file, occurrences); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.occurrences params', json); + throw jsonDecoder.mismatch( + jsonPath, + "'analysis.occurrences params'", + json, + ); } } @@ -1133,7 +1145,7 @@ class AnalysisOutlineParams implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } List outline; if (json.containsKey('outline')) { @@ -1148,11 +1160,11 @@ class AnalysisOutlineParams implements HasToJson { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'outline', json); + throw jsonDecoder.mismatch(jsonPath, "'outline'", json); } return AnalysisOutlineParams(file, outline); } else { - throw jsonDecoder.mismatch(jsonPath, 'analysis.outline params', json); + throw jsonDecoder.mismatch(jsonPath, "'analysis.outline params'", json); } } @@ -1239,7 +1251,7 @@ enum AnalysisService { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'AnalysisService', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisService'", json); } @override @@ -1282,13 +1294,13 @@ class AnalysisSetContextRootsParams implements RequestParams { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'roots', json); + throw jsonDecoder.mismatch(jsonPath, "'roots'", json); } return AnalysisSetContextRootsParams(roots); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.setContextRoots params', + "'analysis.setContextRoots params'", json, ); } @@ -1402,13 +1414,13 @@ class AnalysisSetPriorityFilesParams implements RequestParams { jsonDecoder.decodeString(jsonPath, json), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'files', json); + throw jsonDecoder.mismatch(jsonPath, "'files'", json); } return AnalysisSetPriorityFilesParams(files); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.setPriorityFiles params', + "'analysis.setPriorityFiles params'", json, ); } @@ -1531,13 +1543,13 @@ class AnalysisSetSubscriptionsParams implements RequestParams { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'subscriptions', json); + throw jsonDecoder.mismatch(jsonPath, "'subscriptions'", json); } return AnalysisSetSubscriptionsParams(subscriptions); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.setSubscriptions params', + "'analysis.setSubscriptions params'", json, ); } @@ -1653,11 +1665,11 @@ class AnalysisStatus implements HasToJson { json['isAnalyzing'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'isAnalyzing', json); + throw jsonDecoder.mismatch(jsonPath, "'isAnalyzing'", json); } return AnalysisStatus(isAnalyzing); } else { - throw jsonDecoder.mismatch(jsonPath, 'AnalysisStatus', json); + throw jsonDecoder.mismatch(jsonPath, "'AnalysisStatus'", json); } } @@ -1741,13 +1753,13 @@ class AnalysisUpdateContentParams implements RequestParams { }), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'files', json); + throw jsonDecoder.mismatch(jsonPath, "'files'", json); } return AnalysisUpdateContentParams(files); } else { throw jsonDecoder.mismatch( jsonPath, - 'analysis.updateContent params', + "'analysis.updateContent params'", json, ); } @@ -1857,19 +1869,19 @@ class CompletionGetSuggestionsParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } return CompletionGetSuggestionsParams(file, offset); } else { throw jsonDecoder.mismatch( jsonPath, - 'completion.getSuggestions params', + "'completion.getSuggestions params'", json, ); } @@ -1969,7 +1981,7 @@ class CompletionGetSuggestionsResult implements ResponseResult { json['replacementOffset'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'replacementOffset', json); + throw jsonDecoder.mismatch(jsonPath, "'replacementOffset'", json); } int replacementLength; if (json.containsKey('replacementLength')) { @@ -1978,7 +1990,7 @@ class CompletionGetSuggestionsResult implements ResponseResult { json['replacementLength'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'replacementLength', json); + throw jsonDecoder.mismatch(jsonPath, "'replacementLength'", json); } List results; if (json.containsKey('results')) { @@ -1993,7 +2005,7 @@ class CompletionGetSuggestionsResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'results', json); + throw jsonDecoder.mismatch(jsonPath, "'results'", json); } return CompletionGetSuggestionsResult( replacementOffset, @@ -2003,7 +2015,7 @@ class CompletionGetSuggestionsResult implements ResponseResult { } else { throw jsonDecoder.mismatch( jsonPath, - 'completion.getSuggestions result', + "'completion.getSuggestions result'", json, ); } @@ -2113,7 +2125,7 @@ class ContextRoot implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.root', json['root']); } else { - throw jsonDecoder.mismatch(jsonPath, 'root', json); + throw jsonDecoder.mismatch(jsonPath, "'root'", json); } List exclude; if (json.containsKey('exclude')) { @@ -2127,7 +2139,7 @@ class ContextRoot implements HasToJson { jsonDecoder.decodeString(jsonPath, json), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'exclude', json); + throw jsonDecoder.mismatch(jsonPath, "'exclude'", json); } String? optionsFile; if (json.containsKey('optionsFile')) { @@ -2145,7 +2157,7 @@ class ContextRoot implements HasToJson { } return ContextRoot(root, exclude, optionsFile: optionsFile); } else { - throw jsonDecoder.mismatch(jsonPath, 'ContextRoot', json); + throw jsonDecoder.mismatch(jsonPath, "'ContextRoot'", json); } } @@ -2269,23 +2281,23 @@ class EditGetAssistsParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return EditGetAssistsParams(file, offset, length); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getAssists params', json); + throw jsonDecoder.mismatch(jsonPath, "'edit.getAssists params'", json); } } @@ -2370,11 +2382,11 @@ class EditGetAssistsResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'assists', json); + throw jsonDecoder.mismatch(jsonPath, "'assists'", json); } return EditGetAssistsResult(assists); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getAssists result', json); + throw jsonDecoder.mismatch(jsonPath, "'edit.getAssists result'", json); } } @@ -2471,25 +2483,25 @@ class EditGetAvailableRefactoringsParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } return EditGetAvailableRefactoringsParams(file, offset, length); } else { throw jsonDecoder.mismatch( jsonPath, - 'edit.getAvailableRefactorings params', + "'edit.getAvailableRefactorings params'", json, ); } @@ -2581,13 +2593,13 @@ class EditGetAvailableRefactoringsResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kinds', json); + throw jsonDecoder.mismatch(jsonPath, "'kinds'", json); } return EditGetAvailableRefactoringsResult(kinds); } else { throw jsonDecoder.mismatch( jsonPath, - 'edit.getAvailableRefactorings result', + "'edit.getAvailableRefactorings result'", json, ); } @@ -2682,17 +2694,17 @@ class EditGetFixesParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } return EditGetFixesParams(file, offset); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getFixes params', json); + throw jsonDecoder.mismatch(jsonPath, "'edit.getFixes params'", json); } } @@ -2774,11 +2786,11 @@ class EditGetFixesResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'fixes', json); + throw jsonDecoder.mismatch(jsonPath, "'fixes'", json); } return EditGetFixesResult(fixes); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getFixes result', json); + throw jsonDecoder.mismatch(jsonPath, "'edit.getFixes result'", json); } } @@ -2900,7 +2912,7 @@ class EditGetRefactoringParams implements RequestParams { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'kind', json); + throw jsonDecoder.mismatch(jsonPath, "'kind'", json); } String file; if (json.containsKey('file')) { @@ -2910,19 +2922,19 @@ class EditGetRefactoringParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.file', json['file']); } else { - throw jsonDecoder.mismatch(jsonPath, 'file', json); + throw jsonDecoder.mismatch(jsonPath, "'file'", json); } int offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } bool validateOnly; if (json.containsKey('validateOnly')) { @@ -2931,7 +2943,7 @@ class EditGetRefactoringParams implements RequestParams { json['validateOnly'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'validateOnly', json); + throw jsonDecoder.mismatch(jsonPath, "'validateOnly'", json); } RefactoringOptions? options; if (json.containsKey('options')) { @@ -2952,7 +2964,11 @@ class EditGetRefactoringParams implements RequestParams { options: options, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getRefactoring params', json); + throw jsonDecoder.mismatch( + jsonPath, + "'edit.getRefactoring params'", + json, + ); } } @@ -3095,7 +3111,7 @@ class EditGetRefactoringResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'initialProblems', json); + throw jsonDecoder.mismatch(jsonPath, "'initialProblems'", json); } List optionsProblems; if (json.containsKey('optionsProblems')) { @@ -3110,7 +3126,7 @@ class EditGetRefactoringResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'optionsProblems', json); + throw jsonDecoder.mismatch(jsonPath, "'optionsProblems'", json); } List finalProblems; if (json.containsKey('finalProblems')) { @@ -3125,7 +3141,7 @@ class EditGetRefactoringResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'finalProblems', json); + throw jsonDecoder.mismatch(jsonPath, "'finalProblems'", json); } RefactoringFeedback? feedback; if (json.containsKey('feedback')) { @@ -3163,7 +3179,11 @@ class EditGetRefactoringResult implements ResponseResult { potentialEdits: potentialEdits, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'edit.getRefactoring result', json); + throw jsonDecoder.mismatch( + jsonPath, + "'edit.getRefactoring result'", + json, + ); } } @@ -3346,7 +3366,7 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'names', json); + throw jsonDecoder.mismatch(jsonPath, "'names'", json); } List offsets; if (json.containsKey('offsets')) { @@ -3356,7 +3376,7 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'offsets', json); + throw jsonDecoder.mismatch(jsonPath, "'offsets'", json); } List lengths; if (json.containsKey('lengths')) { @@ -3366,7 +3386,7 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'lengths', json); + throw jsonDecoder.mismatch(jsonPath, "'lengths'", json); } return ExtractLocalVariableFeedback( names, @@ -3378,7 +3398,7 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { } else { throw jsonDecoder.mismatch( jsonPath, - 'extractLocalVariable feedback', + "'extractLocalVariable feedback'", json, ); } @@ -3466,7 +3486,7 @@ class ExtractLocalVariableOptions extends RefactoringOptions { if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } bool extractAll; if (json.containsKey('extractAll')) { @@ -3475,13 +3495,13 @@ class ExtractLocalVariableOptions extends RefactoringOptions { json['extractAll'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'extractAll', json); + throw jsonDecoder.mismatch(jsonPath, "'extractAll'", json); } return ExtractLocalVariableOptions(name, extractAll); } else { throw jsonDecoder.mismatch( jsonPath, - 'extractLocalVariable options', + "'extractLocalVariable options'", json, ); } @@ -3592,13 +3612,13 @@ class ExtractMethodFeedback extends RefactoringFeedback { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } String returnType; if (json.containsKey('returnType')) { @@ -3607,7 +3627,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { json['returnType'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'returnType', json); + throw jsonDecoder.mismatch(jsonPath, "'returnType'", json); } List names; if (json.containsKey('names')) { @@ -3617,7 +3637,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'names', json); + throw jsonDecoder.mismatch(jsonPath, "'names'", json); } bool canCreateGetter; if (json.containsKey('canCreateGetter')) { @@ -3626,7 +3646,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { json['canCreateGetter'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'canCreateGetter', json); + throw jsonDecoder.mismatch(jsonPath, "'canCreateGetter'", json); } List parameters; if (json.containsKey('parameters')) { @@ -3642,7 +3662,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'parameters', json); + throw jsonDecoder.mismatch(jsonPath, "'parameters'", json); } List offsets; if (json.containsKey('offsets')) { @@ -3652,7 +3672,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'offsets', json); + throw jsonDecoder.mismatch(jsonPath, "'offsets'", json); } List lengths; if (json.containsKey('lengths')) { @@ -3662,7 +3682,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { jsonDecoder.decodeInt, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'lengths', json); + throw jsonDecoder.mismatch(jsonPath, "'lengths'", json); } return ExtractMethodFeedback( offset, @@ -3675,7 +3695,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { lengths, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'extractMethod feedback', json); + throw jsonDecoder.mismatch(jsonPath, "'extractMethod feedback'", json); } } @@ -3796,7 +3816,7 @@ class ExtractMethodOptions extends RefactoringOptions { json['returnType'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'returnType', json); + throw jsonDecoder.mismatch(jsonPath, "'returnType'", json); } bool createGetter; if (json.containsKey('createGetter')) { @@ -3805,13 +3825,13 @@ class ExtractMethodOptions extends RefactoringOptions { json['createGetter'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'createGetter', json); + throw jsonDecoder.mismatch(jsonPath, "'createGetter'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } List parameters; if (json.containsKey('parameters')) { @@ -3827,7 +3847,7 @@ class ExtractMethodOptions extends RefactoringOptions { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'parameters', json); + throw jsonDecoder.mismatch(jsonPath, "'parameters'", json); } bool extractAll; if (json.containsKey('extractAll')) { @@ -3836,7 +3856,7 @@ class ExtractMethodOptions extends RefactoringOptions { json['extractAll'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'extractAll', json); + throw jsonDecoder.mismatch(jsonPath, "'extractAll'", json); } return ExtractMethodOptions( returnType, @@ -3846,7 +3866,7 @@ class ExtractMethodOptions extends RefactoringOptions { extractAll, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'extractMethod options', json); + throw jsonDecoder.mismatch(jsonPath, "'extractMethod options'", json); } } @@ -3938,7 +3958,7 @@ class InlineLocalVariableFeedback extends RefactoringFeedback { if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } int occurrences; if (json.containsKey('occurrences')) { @@ -3947,13 +3967,13 @@ class InlineLocalVariableFeedback extends RefactoringFeedback { json['occurrences'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'occurrences', json); + throw jsonDecoder.mismatch(jsonPath, "'occurrences'", json); } return InlineLocalVariableFeedback(name, occurrences); } else { throw jsonDecoder.mismatch( jsonPath, - 'inlineLocalVariable feedback', + "'inlineLocalVariable feedback'", json, ); } @@ -4039,7 +4059,7 @@ class InlineMethodFeedback extends RefactoringFeedback { json['methodName'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'methodName', json); + throw jsonDecoder.mismatch(jsonPath, "'methodName'", json); } bool isDeclaration; if (json.containsKey('isDeclaration')) { @@ -4048,7 +4068,7 @@ class InlineMethodFeedback extends RefactoringFeedback { json['isDeclaration'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'isDeclaration', json); + throw jsonDecoder.mismatch(jsonPath, "'isDeclaration'", json); } return InlineMethodFeedback( methodName, @@ -4056,7 +4076,7 @@ class InlineMethodFeedback extends RefactoringFeedback { className: className, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'inlineMethod feedback', json); + throw jsonDecoder.mismatch(jsonPath, "'inlineMethod feedback'", json); } } @@ -4123,7 +4143,7 @@ class InlineMethodOptions extends RefactoringOptions { json['deleteSource'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'deleteSource', json); + throw jsonDecoder.mismatch(jsonPath, "'deleteSource'", json); } bool inlineAll; if (json.containsKey('inlineAll')) { @@ -4132,11 +4152,11 @@ class InlineMethodOptions extends RefactoringOptions { json['inlineAll'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'inlineAll', json); + throw jsonDecoder.mismatch(jsonPath, "'inlineAll'", json); } return InlineMethodOptions(deleteSource, inlineAll); } else { - throw jsonDecoder.mismatch(jsonPath, 'inlineMethod options', json); + throw jsonDecoder.mismatch(jsonPath, "'inlineMethod options'", json); } } @@ -4216,11 +4236,11 @@ class MoveFileOptions extends RefactoringOptions { ) ?? jsonDecoder.decodeString('$jsonPath.newFile', json['newFile']); } else { - throw jsonDecoder.mismatch(jsonPath, 'newFile', json); + throw jsonDecoder.mismatch(jsonPath, "'newFile'", json); } return MoveFileOptions(newFile); } else { - throw jsonDecoder.mismatch(jsonPath, 'moveFile options', json); + throw jsonDecoder.mismatch(jsonPath, "'moveFile options'", json); } } @@ -4313,11 +4333,11 @@ class PluginDetailsResult implements ResponseResult { ), ); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugins', json); + throw jsonDecoder.mismatch(jsonPath, "'plugins'", json); } return PluginDetailsResult(plugins); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugin.details result', json); + throw jsonDecoder.mismatch(jsonPath, "'plugin.details result'", json); } } @@ -4414,7 +4434,7 @@ class PluginErrorParams implements HasToJson { if (json.containsKey('isFatal')) { isFatal = jsonDecoder.decodeBool('$jsonPath.isFatal', json['isFatal']); } else { - throw jsonDecoder.mismatch(jsonPath, 'isFatal', json); + throw jsonDecoder.mismatch(jsonPath, "'isFatal'", json); } String message; if (json.containsKey('message')) { @@ -4423,7 +4443,7 @@ class PluginErrorParams implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } String stackTrace; if (json.containsKey('stackTrace')) { @@ -4432,11 +4452,11 @@ class PluginErrorParams implements HasToJson { json['stackTrace'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'stackTrace', json); + throw jsonDecoder.mismatch(jsonPath, "'stackTrace'", json); } return PluginErrorParams(isFatal, message, stackTrace); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugin.error params', json); + throw jsonDecoder.mismatch(jsonPath, "'plugin.error params'", json); } } @@ -4559,7 +4579,7 @@ class PluginStatusParams implements HasToJson { } return PluginStatusParams(analysis: analysis); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugin.status params', json); + throw jsonDecoder.mismatch(jsonPath, "'plugin.status params'", json); } } @@ -4655,7 +4675,7 @@ class PluginVersionCheckParams implements RequestParams { json['byteStorePath'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'byteStorePath', json); + throw jsonDecoder.mismatch(jsonPath, "'byteStorePath'", json); } String sdkPath; if (json.containsKey('sdkPath')) { @@ -4665,7 +4685,7 @@ class PluginVersionCheckParams implements RequestParams { ) ?? jsonDecoder.decodeString('$jsonPath.sdkPath', json['sdkPath']); } else { - throw jsonDecoder.mismatch(jsonPath, 'sdkPath', json); + throw jsonDecoder.mismatch(jsonPath, "'sdkPath'", json); } String version; if (json.containsKey('version')) { @@ -4674,11 +4694,15 @@ class PluginVersionCheckParams implements RequestParams { json['version'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'version', json); + throw jsonDecoder.mismatch(jsonPath, "'version'", json); } return PluginVersionCheckParams(byteStorePath, sdkPath, version); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugin.versionCheck params', json); + throw jsonDecoder.mismatch( + jsonPath, + "'plugin.versionCheck params'", + json, + ); } } @@ -4789,13 +4813,13 @@ class PluginVersionCheckResult implements ResponseResult { json['isCompatible'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'isCompatible', json); + throw jsonDecoder.mismatch(jsonPath, "'isCompatible'", json); } String name; if (json.containsKey('name')) { name = jsonDecoder.decodeString('$jsonPath.name', json['name']); } else { - throw jsonDecoder.mismatch(jsonPath, 'name', json); + throw jsonDecoder.mismatch(jsonPath, "'name'", json); } String version; if (json.containsKey('version')) { @@ -4804,7 +4828,7 @@ class PluginVersionCheckResult implements ResponseResult { json['version'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'version', json); + throw jsonDecoder.mismatch(jsonPath, "'version'", json); } String? contactInfo; if (json.containsKey('contactInfo')) { @@ -4821,7 +4845,7 @@ class PluginVersionCheckResult implements ResponseResult { jsonDecoder.decodeString, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'interestingFiles', json); + throw jsonDecoder.mismatch(jsonPath, "'interestingFiles'", json); } return PluginVersionCheckResult( isCompatible, @@ -4831,7 +4855,11 @@ class PluginVersionCheckResult implements ResponseResult { contactInfo: contactInfo, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'plugin.versionCheck result', json); + throw jsonDecoder.mismatch( + jsonPath, + "'plugin.versionCheck result'", + json, + ); } } @@ -4936,7 +4964,7 @@ class PrioritizedSourceChange implements HasToJson { json['priority'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'priority', json); + throw jsonDecoder.mismatch(jsonPath, "'priority'", json); } SourceChange change; if (json.containsKey('change')) { @@ -4947,11 +4975,11 @@ class PrioritizedSourceChange implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'change', json); + throw jsonDecoder.mismatch(jsonPath, "'change'", json); } return PrioritizedSourceChange(priority, change); } else { - throw jsonDecoder.mismatch(jsonPath, 'PrioritizedSourceChange', json); + throw jsonDecoder.mismatch(jsonPath, "'PrioritizedSourceChange'", json); } } @@ -5108,13 +5136,13 @@ class RenameFeedback extends RefactoringFeedback { if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']); } else { - throw jsonDecoder.mismatch(jsonPath, 'offset', json); + throw jsonDecoder.mismatch(jsonPath, "'offset'", json); } int length; if (json.containsKey('length')) { length = jsonDecoder.decodeInt('$jsonPath.length', json['length']); } else { - throw jsonDecoder.mismatch(jsonPath, 'length', json); + throw jsonDecoder.mismatch(jsonPath, "'length'", json); } String elementKindName; if (json.containsKey('elementKindName')) { @@ -5123,7 +5151,7 @@ class RenameFeedback extends RefactoringFeedback { json['elementKindName'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'elementKindName', json); + throw jsonDecoder.mismatch(jsonPath, "'elementKindName'", json); } String oldName; if (json.containsKey('oldName')) { @@ -5132,11 +5160,11 @@ class RenameFeedback extends RefactoringFeedback { json['oldName'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'oldName', json); + throw jsonDecoder.mismatch(jsonPath, "'oldName'", json); } return RenameFeedback(offset, length, elementKindName, oldName); } else { - throw jsonDecoder.mismatch(jsonPath, 'rename feedback', json); + throw jsonDecoder.mismatch(jsonPath, "'rename feedback'", json); } } @@ -5196,11 +5224,11 @@ class RenameOptions extends RefactoringOptions { json['newName'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'newName', json); + throw jsonDecoder.mismatch(jsonPath, "'newName'", json); } return RenameOptions(newName); } else { - throw jsonDecoder.mismatch(jsonPath, 'rename options', json); + throw jsonDecoder.mismatch(jsonPath, "'rename options'", json); } } @@ -5278,7 +5306,7 @@ class RequestError implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'code', json); + throw jsonDecoder.mismatch(jsonPath, "'code'", json); } String message; if (json.containsKey('message')) { @@ -5287,7 +5315,7 @@ class RequestError implements HasToJson { json['message'], ); } else { - throw jsonDecoder.mismatch(jsonPath, 'message', json); + throw jsonDecoder.mismatch(jsonPath, "'message'", json); } String? stackTrace; if (json.containsKey('stackTrace')) { @@ -5298,7 +5326,7 @@ class RequestError implements HasToJson { } return RequestError(code, message, stackTrace: stackTrace); } else { - throw jsonDecoder.mismatch(jsonPath, 'RequestError', json); + throw jsonDecoder.mismatch(jsonPath, "'RequestError'", json); } } @@ -5376,7 +5404,7 @@ enum RequestErrorCode { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'RequestErrorCode', json); + throw jsonDecoder.mismatch(jsonPath, "'RequestErrorCode'", json); } @override @@ -5419,7 +5447,7 @@ class WatchEvent implements HasToJson { clientUriConverter: clientUriConverter, ); } else { - throw jsonDecoder.mismatch(jsonPath, 'type', json); + throw jsonDecoder.mismatch(jsonPath, "'type'", json); } String path; if (json.containsKey('path')) { @@ -5429,11 +5457,11 @@ class WatchEvent implements HasToJson { ) ?? jsonDecoder.decodeString('$jsonPath.path', json['path']); } else { - throw jsonDecoder.mismatch(jsonPath, 'path', json); + throw jsonDecoder.mismatch(jsonPath, "'path'", json); } return WatchEvent(type, path); } else { - throw jsonDecoder.mismatch(jsonPath, 'WatchEvent', json); + throw jsonDecoder.mismatch(jsonPath, "'WatchEvent'", json); } } @@ -5492,7 +5520,7 @@ enum WatchEventType { // Fall through } } - throw jsonDecoder.mismatch(jsonPath, 'WatchEventType', json); + throw jsonDecoder.mismatch(jsonPath, "'WatchEventType'", json); } @override diff --git a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart index 2b5172c7533..c8b1451e52a 100644 --- a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart +++ b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart @@ -372,7 +372,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { impliedType.humanReadableName, ); writeln( - 'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString, json);', + 'throw jsonDecoder.mismatch(jsonPath, "$humanReadableNameString", json);', ); }); writeln('}'); @@ -627,7 +627,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { writeln('if ($fieldAccessor != $valueString) {'); indent(() { writeln( - "throw jsonDecoder.mismatch(jsonPath, 'equal ${field.value}', json);", + "throw jsonDecoder.mismatch(jsonPath, \"equal to '${field.value}'\", json);", ); }); writeln('}'); @@ -653,7 +653,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { writeln(' else {'); indent(() { writeln( - 'throw jsonDecoder.mismatch(jsonPath, $fieldNameString, json);', + 'throw jsonDecoder.mismatch(jsonPath, "$fieldNameString", json);', ); }); writeln('}'); @@ -667,7 +667,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { writeln('} else {'); indent(() { writeln( - 'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString, json);', + 'throw jsonDecoder.mismatch(jsonPath, "$humanReadableNameString", json);', ); }); writeln('}');