From b4ed70948202799302f42345fcfa3b36a27e9bbe Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Wed, 11 May 2022 15:36:34 +0000 Subject: [PATCH] [analysis_server] Sort fields in generated LSP types consistently This simplifies an upcoming change switching from parsing LSP TypeScript definitions to using a new JSON definition (where items are not all in the same order). Change-Id: I33672d645a8a96702dbfcbf1c090dfc8f5254960 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244404 Reviewed-by: Brian Wilkerson Commit-Queue: Brian Wilkerson --- .../protocol_custom_generated.dart | 1084 +- .../lib/lsp_protocol/protocol_generated.dart | 15950 ++++++++-------- .../test/lsp/code_actions_assists_test.dart | 3 + .../test/tool/lsp_spec/json_test.dart | 72 +- .../tool/lsp_spec/codegen_dart.dart | 5 +- 5 files changed, 8564 insertions(+), 8550 deletions(-) diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart index 6ba59ff612b..e3c0fe58c1c 100644 --- a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart +++ b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart @@ -96,17 +96,17 @@ class ClosingLabel implements ToJsonable { ); ClosingLabel({ - required this.range, required this.label, + required this.range, }); static ClosingLabel fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final labelJson = json['label']; final label = labelJson as String; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return ClosingLabel( - range: range, label: label, + range: range, ); } @@ -115,31 +115,13 @@ class ClosingLabel implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); __result['label'] = label; + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('label'); try { if (!obj.containsKey('label')) { @@ -158,6 +140,24 @@ class ClosingLabel implements ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ClosingLabel'); @@ -168,15 +168,15 @@ class ClosingLabel implements ToJsonable { @override bool operator ==(Object other) { if (other is ClosingLabel && other.runtimeType == ClosingLabel) { - return range == other.range && label == other.label && true; + return label == other.label && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, label, + range, ); @override @@ -307,38 +307,38 @@ class DartSuggestionSetCompletionItemResolutionInfo ); DartSuggestionSetCompletionItemResolutionInfo({ - required this.file, - required this.offset, - required this.libId, required this.displayUri, - required this.rOffset, + required this.file, required this.iLength, + required this.libId, + required this.offset, required this.rLength, + required this.rOffset, }); static DartSuggestionSetCompletionItemResolutionInfo fromJson( Map json) { - final fileJson = json['file']; - final file = fileJson as String; - final offsetJson = json['offset']; - final offset = offsetJson as int; - final libIdJson = json['libId']; - final libId = libIdJson as int; final displayUriJson = json['displayUri']; final displayUri = displayUriJson as String; - final rOffsetJson = json['rOffset']; - final rOffset = rOffsetJson as int; + final fileJson = json['file']; + final file = fileJson as String; final iLengthJson = json['iLength']; final iLength = iLengthJson as int; + final libIdJson = json['libId']; + final libId = libIdJson as int; + final offsetJson = json['offset']; + final offset = offsetJson as int; final rLengthJson = json['rLength']; final rLength = rLengthJson as int; + final rOffsetJson = json['rOffset']; + final rOffset = rOffsetJson as int; return DartSuggestionSetCompletionItemResolutionInfo( - file: file, - offset: offset, - libId: libId, displayUri: displayUri, - rOffset: rOffset, + file: file, iLength: iLength, + libId: libId, + offset: offset, rLength: rLength, + rOffset: rOffset, ); } @@ -352,18 +352,36 @@ class DartSuggestionSetCompletionItemResolutionInfo Map toJson() { var __result = {}; - __result['file'] = file; - __result['offset'] = offset; - __result['libId'] = libId; __result['displayUri'] = displayUri; - __result['rOffset'] = rOffset; + __result['file'] = file; __result['iLength'] = iLength; + __result['libId'] = libId; + __result['offset'] = offset; __result['rLength'] = rLength; + __result['rOffset'] = rOffset; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('displayUri'); + try { + if (!obj.containsKey('displayUri')) { + reporter.reportError('must not be undefined'); + return false; + } + final displayUri = obj['displayUri']; + if (displayUri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(displayUri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('file'); try { if (!obj.containsKey('file')) { @@ -382,18 +400,18 @@ class DartSuggestionSetCompletionItemResolutionInfo } finally { reporter.pop(); } - reporter.push('offset'); + reporter.push('iLength'); try { - if (!obj.containsKey('offset')) { + if (!obj.containsKey('iLength')) { reporter.reportError('must not be undefined'); return false; } - final offset = obj['offset']; - if (offset == null) { + final iLength = obj['iLength']; + if (iLength == null) { reporter.reportError('must not be null'); return false; } - if (!(offset is int)) { + if (!(iLength is int)) { reporter.reportError('must be of type int'); return false; } @@ -418,54 +436,18 @@ class DartSuggestionSetCompletionItemResolutionInfo } finally { reporter.pop(); } - reporter.push('displayUri'); + reporter.push('offset'); try { - if (!obj.containsKey('displayUri')) { + if (!obj.containsKey('offset')) { reporter.reportError('must not be undefined'); return false; } - final displayUri = obj['displayUri']; - if (displayUri == null) { + final offset = obj['offset']; + if (offset == null) { reporter.reportError('must not be null'); return false; } - if (!(displayUri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('rOffset'); - try { - if (!obj.containsKey('rOffset')) { - reporter.reportError('must not be undefined'); - return false; - } - final rOffset = obj['rOffset']; - if (rOffset == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(rOffset is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('iLength'); - try { - if (!obj.containsKey('iLength')) { - reporter.reportError('must not be undefined'); - return false; - } - final iLength = obj['iLength']; - if (iLength == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(iLength is int)) { + if (!(offset is int)) { reporter.reportError('must be of type int'); return false; } @@ -490,6 +472,24 @@ class DartSuggestionSetCompletionItemResolutionInfo } finally { reporter.pop(); } + reporter.push('rOffset'); + try { + if (!obj.containsKey('rOffset')) { + reporter.reportError('must not be undefined'); + return false; + } + final rOffset = obj['rOffset']; + if (rOffset == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(rOffset is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -502,13 +502,13 @@ class DartSuggestionSetCompletionItemResolutionInfo bool operator ==(Object other) { if (other is DartSuggestionSetCompletionItemResolutionInfo && other.runtimeType == DartSuggestionSetCompletionItemResolutionInfo) { - return file == other.file && - offset == other.offset && - libId == other.libId && - displayUri == other.displayUri && - rOffset == other.rOffset && + return displayUri == other.displayUri && + file == other.file && iLength == other.iLength && + libId == other.libId && + offset == other.offset && rLength == other.rLength && + rOffset == other.rOffset && true; } return false; @@ -516,13 +516,13 @@ class DartSuggestionSetCompletionItemResolutionInfo @override int get hashCode => Object.hash( - file, - offset, - libId, displayUri, - rOffset, + file, iLength, + libId, + offset, rLength, + rOffset, ); @override @@ -536,35 +536,35 @@ class Element implements ToJsonable { ); Element({ - this.range, - required this.name, required this.kind, + required this.name, this.parameters, - this.typeParameters, + this.range, this.returnType, + this.typeParameters, }); static Element fromJson(Map json) { + final kindJson = json['kind']; + final kind = kindJson as String; + final nameJson = json['name']; + final name = nameJson as String; + final parametersJson = json['parameters']; + final parameters = parametersJson as String?; final rangeJson = json['range']; final range = rangeJson != null ? Range.fromJson(rangeJson as Map) : null; - final nameJson = json['name']; - final name = nameJson as String; - final kindJson = json['kind']; - final kind = kindJson as String; - final parametersJson = json['parameters']; - final parameters = parametersJson as String?; - final typeParametersJson = json['typeParameters']; - final typeParameters = typeParametersJson as String?; final returnTypeJson = json['returnType']; final returnType = returnTypeJson as String?; + final typeParametersJson = json['typeParameters']; + final typeParameters = typeParametersJson as String?; return Element( - range: range, - name: name, kind: kind, + name: name, parameters: parameters, - typeParameters: typeParameters, + range: range, returnType: returnType, + typeParameters: typeParameters, ); } @@ -577,30 +577,38 @@ class Element implements ToJsonable { Map toJson() { var __result = {}; - if (range != null) { - __result['range'] = range?.toJson(); - } - __result['name'] = name; __result['kind'] = kind; + __result['name'] = name; if (parameters != null) { __result['parameters'] = parameters; } - if (typeParameters != null) { - __result['typeParameters'] = typeParameters; + if (range != null) { + __result['range'] = range?.toJson(); } if (returnType != null) { __result['returnType'] = returnType; } + if (typeParameters != null) { + __result['typeParameters'] = typeParameters; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); + reporter.push('kind'); try { - final range = obj['range']; - if (range != null && !(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); + if (!obj.containsKey('kind')) { + reporter.reportError('must not be undefined'); + return false; + } + final kind = obj['kind']; + if (kind == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(kind is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -624,28 +632,30 @@ class Element implements ToJsonable { } finally { reporter.pop(); } - reporter.push('kind'); + reporter.push('parameters'); try { - if (!obj.containsKey('kind')) { - reporter.reportError('must not be undefined'); - return false; - } - final kind = obj['kind']; - if (kind == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(kind is String)) { + final parameters = obj['parameters']; + if (parameters != null && !(parameters is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } - reporter.push('parameters'); + reporter.push('range'); try { - final parameters = obj['parameters']; - if (parameters != null && !(parameters is String)) { + final range = obj['range']; + if (range != null && !(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('returnType'); + try { + final returnType = obj['returnType']; + if (returnType != null && !(returnType is String)) { reporter.reportError('must be of type String'); return false; } @@ -662,16 +672,6 @@ class Element implements ToJsonable { } finally { reporter.pop(); } - reporter.push('returnType'); - try { - final returnType = obj['returnType']; - if (returnType != null && !(returnType is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type Element'); @@ -682,12 +682,12 @@ class Element implements ToJsonable { @override bool operator ==(Object other) { if (other is Element && other.runtimeType == Element) { - return range == other.range && + return kind == other.kind && name == other.name && - kind == other.kind && parameters == other.parameters && - typeParameters == other.typeParameters && + range == other.range && returnType == other.returnType && + typeParameters == other.typeParameters && true; } return false; @@ -695,12 +695,12 @@ class Element implements ToJsonable { @override int get hashCode => Object.hash( - range, - name, kind, + name, parameters, - typeParameters, + range, returnType, + typeParameters, ); @override @@ -714,52 +714,52 @@ class FlutterOutline implements ToJsonable { ); FlutterOutline({ + this.attributes, + this.children, + this.className, + required this.codeRange, + this.dartElement, required this.kind, this.label, - this.className, - this.variableName, - this.attributes, - this.dartElement, required this.range, - required this.codeRange, - this.children, + this.variableName, }); static FlutterOutline fromJson(Map json) { - final kindJson = json['kind']; - final kind = kindJson as String; - final labelJson = json['label']; - final label = labelJson as String?; - final classNameJson = json['className']; - final className = classNameJson as String?; - final variableNameJson = json['variableName']; - final variableName = variableNameJson as String?; final attributesJson = json['attributes']; final attributes = (attributesJson as List?) ?.map((item) => FlutterOutlineAttribute.fromJson(item as Map)) .toList(); - final dartElementJson = json['dartElement']; - final dartElement = dartElementJson != null - ? Element.fromJson(dartElementJson as Map) - : null; - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); - final codeRangeJson = json['codeRange']; - final codeRange = Range.fromJson(codeRangeJson as Map); final childrenJson = json['children']; final children = (childrenJson as List?) ?.map((item) => FlutterOutline.fromJson(item as Map)) .toList(); + final classNameJson = json['className']; + final className = classNameJson as String?; + final codeRangeJson = json['codeRange']; + final codeRange = Range.fromJson(codeRangeJson as Map); + final dartElementJson = json['dartElement']; + final dartElement = dartElementJson != null + ? Element.fromJson(dartElementJson as Map) + : null; + final kindJson = json['kind']; + final kind = kindJson as String; + final labelJson = json['label']; + final label = labelJson as String?; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final variableNameJson = json['variableName']; + final variableName = variableNameJson as String?; return FlutterOutline( + attributes: attributes, + children: children, + className: className, + codeRange: codeRange, + dartElement: dartElement, kind: kind, label: label, - className: className, - variableName: variableName, - attributes: attributes, - dartElement: dartElement, range: range, - codeRange: codeRange, - children: children, + variableName: variableName, ); } @@ -775,33 +775,97 @@ class FlutterOutline implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; - if (label != null) { - __result['label'] = label; - } - if (className != null) { - __result['className'] = className; - } - if (variableName != null) { - __result['variableName'] = variableName; - } if (attributes != null) { __result['attributes'] = attributes?.map((item) => item.toJson()).toList(); } + if (children != null) { + __result['children'] = children?.map((item) => item.toJson()).toList(); + } + if (className != null) { + __result['className'] = className; + } + __result['codeRange'] = codeRange.toJson(); if (dartElement != null) { __result['dartElement'] = dartElement?.toJson(); } + __result['kind'] = kind; + if (label != null) { + __result['label'] = label; + } __result['range'] = range.toJson(); - __result['codeRange'] = codeRange.toJson(); - if (children != null) { - __result['children'] = children?.map((item) => item.toJson()).toList(); + if (variableName != null) { + __result['variableName'] = variableName; } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('attributes'); + try { + final attributes = obj['attributes']; + if (attributes != null && + !((attributes is List && + (attributes.every((item) => + FlutterOutlineAttribute.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('children'); + try { + final children = obj['children']; + if (children != null && + !((children is List && + (children.every( + (item) => FlutterOutline.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('className'); + try { + final className = obj['className']; + if (className != null && !(className is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('codeRange'); + try { + if (!obj.containsKey('codeRange')) { + reporter.reportError('must not be undefined'); + return false; + } + final codeRange = obj['codeRange']; + if (codeRange == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(codeRange, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('dartElement'); + try { + final dartElement = obj['dartElement']; + if (dartElement != null && !(Element.canParse(dartElement, reporter))) { + reporter.reportError('must be of type Element'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -830,49 +894,6 @@ class FlutterOutline implements ToJsonable { } finally { reporter.pop(); } - reporter.push('className'); - try { - final className = obj['className']; - if (className != null && !(className is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('variableName'); - try { - final variableName = obj['variableName']; - if (variableName != null && !(variableName is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('attributes'); - try { - final attributes = obj['attributes']; - if (attributes != null && - !((attributes is List && - (attributes.every((item) => - FlutterOutlineAttribute.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('dartElement'); - try { - final dartElement = obj['dartElement']; - if (dartElement != null && !(Element.canParse(dartElement, reporter))) { - reporter.reportError('must be of type Element'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -891,32 +912,11 @@ class FlutterOutline implements ToJsonable { } finally { reporter.pop(); } - reporter.push('codeRange'); + reporter.push('variableName'); try { - if (!obj.containsKey('codeRange')) { - reporter.reportError('must not be undefined'); - return false; - } - final codeRange = obj['codeRange']; - if (codeRange == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(codeRange, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('children'); - try { - final children = obj['children']; - if (children != null && - !((children is List && - (children.every( - (item) => FlutterOutline.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + final variableName = obj['variableName']; + if (variableName != null && !(variableName is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -932,20 +932,20 @@ class FlutterOutline implements ToJsonable { @override bool operator ==(Object other) { if (other is FlutterOutline && other.runtimeType == FlutterOutline) { - return kind == other.kind && - label == other.label && - className == other.className && - variableName == other.variableName && - listEqual( + return listEqual( attributes, other.attributes, (FlutterOutlineAttribute a, FlutterOutlineAttribute b) => a == b) && - dartElement == other.dartElement && - range == other.range && - codeRange == other.codeRange && listEqual(children, other.children, (FlutterOutline a, FlutterOutline b) => a == b) && + className == other.className && + codeRange == other.codeRange && + dartElement == other.dartElement && + kind == other.kind && + label == other.label && + range == other.range && + variableName == other.variableName && true; } return false; @@ -953,15 +953,15 @@ class FlutterOutline implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(attributes), + lspHashCode(children), + className, + codeRange, + dartElement, kind, label, - className, - variableName, - lspHashCode(attributes), - dartElement, range, - codeRange, - lspHashCode(children), + variableName, ); @override @@ -975,22 +975,22 @@ class FlutterOutlineAttribute implements ToJsonable { ); FlutterOutlineAttribute({ - required this.name, required this.label, + required this.name, this.valueRange, }); static FlutterOutlineAttribute fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; final labelJson = json['label']; final label = labelJson as String; + final nameJson = json['name']; + final name = nameJson as String; final valueRangeJson = json['valueRange']; final valueRange = valueRangeJson != null ? Range.fromJson(valueRangeJson as Map) : null; return FlutterOutlineAttribute( - name: name, label: label, + name: name, valueRange: valueRange, ); } @@ -1001,8 +1001,8 @@ class FlutterOutlineAttribute implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; __result['label'] = label; + __result['name'] = name; if (valueRange != null) { __result['valueRange'] = valueRange?.toJson(); } @@ -1011,24 +1011,6 @@ class FlutterOutlineAttribute implements ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); - try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); - return false; - } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('label'); try { if (!obj.containsKey('label')) { @@ -1047,6 +1029,24 @@ class FlutterOutlineAttribute implements ToJsonable { } finally { reporter.pop(); } + reporter.push('name'); + try { + if (!obj.containsKey('name')) { + reporter.reportError('must not be undefined'); + return false; + } + final name = obj['name']; + if (name == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(name is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('valueRange'); try { final valueRange = obj['valueRange']; @@ -1068,8 +1068,8 @@ class FlutterOutlineAttribute implements ToJsonable { bool operator ==(Object other) { if (other is FlutterOutlineAttribute && other.runtimeType == FlutterOutlineAttribute) { - return name == other.name && - label == other.label && + return label == other.label && + name == other.name && valueRange == other.valueRange && true; } @@ -1078,8 +1078,8 @@ class FlutterOutlineAttribute implements ToJsonable { @override int get hashCode => Object.hash( - name, label, + name, valueRange, ); @@ -1094,27 +1094,27 @@ class Outline implements ToJsonable { ); Outline({ + this.children, + required this.codeRange, required this.element, required this.range, - required this.codeRange, - this.children, }); static Outline fromJson(Map json) { - final elementJson = json['element']; - final element = Element.fromJson(elementJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); - final codeRangeJson = json['codeRange']; - final codeRange = Range.fromJson(codeRangeJson as Map); final childrenJson = json['children']; final children = (childrenJson as List?) ?.map((item) => Outline.fromJson(item as Map)) .toList(); + final codeRangeJson = json['codeRange']; + final codeRange = Range.fromJson(codeRangeJson as Map); + final elementJson = json['element']; + final element = Element.fromJson(elementJson as Map); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return Outline( + children: children, + codeRange: codeRange, element: element, range: range, - codeRange: codeRange, - children: children, ); } @@ -1125,17 +1125,48 @@ class Outline implements ToJsonable { Map toJson() { var __result = {}; - __result['element'] = element.toJson(); - __result['range'] = range.toJson(); - __result['codeRange'] = codeRange.toJson(); if (children != null) { __result['children'] = children?.map((item) => item.toJson()).toList(); } + __result['codeRange'] = codeRange.toJson(); + __result['element'] = element.toJson(); + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('children'); + try { + final children = obj['children']; + if (children != null && + !((children is List && + (children + .every((item) => Outline.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('codeRange'); + try { + if (!obj.containsKey('codeRange')) { + reporter.reportError('must not be undefined'); + return false; + } + final codeRange = obj['codeRange']; + if (codeRange == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(codeRange, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('element'); try { if (!obj.containsKey('element')) { @@ -1172,37 +1203,6 @@ class Outline implements ToJsonable { } finally { reporter.pop(); } - reporter.push('codeRange'); - try { - if (!obj.containsKey('codeRange')) { - reporter.reportError('must not be undefined'); - return false; - } - final codeRange = obj['codeRange']; - if (codeRange == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(codeRange, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('children'); - try { - final children = obj['children']; - if (children != null && - !((children is List && - (children - .every((item) => Outline.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type Outline'); @@ -1213,11 +1213,11 @@ class Outline implements ToJsonable { @override bool operator ==(Object other) { if (other is Outline && other.runtimeType == Outline) { - return element == other.element && - range == other.range && - codeRange == other.codeRange && - listEqual( + return listEqual( children, other.children, (Outline a, Outline b) => a == b) && + codeRange == other.codeRange && + element == other.element && + range == other.range && true; } return false; @@ -1225,10 +1225,10 @@ class Outline implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(children), + codeRange, element, range, - codeRange, - lspHashCode(children), ); @override @@ -1313,19 +1313,19 @@ class PublishClosingLabelsParams implements ToJsonable { ); PublishClosingLabelsParams({ - required this.uri, required this.labels, + required this.uri, }); static PublishClosingLabelsParams fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final labelsJson = json['labels']; final labels = (labelsJson as List) .map((item) => ClosingLabel.fromJson(item as Map)) .toList(); + final uriJson = json['uri']; + final uri = uriJson as String; return PublishClosingLabelsParams( - uri: uri, labels: labels, + uri: uri, ); } @@ -1334,31 +1334,13 @@ class PublishClosingLabelsParams implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; __result['labels'] = labels.map((item) => item.toJson()).toList(); + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('labels'); try { if (!obj.containsKey('labels')) { @@ -1378,69 +1360,6 @@ class PublishClosingLabelsParams implements ToJsonable { } finally { reporter.pop(); } - return true; - } else { - reporter.reportError('must be of type PublishClosingLabelsParams'); - return false; - } - } - - @override - bool operator ==(Object other) { - if (other is PublishClosingLabelsParams && - other.runtimeType == PublishClosingLabelsParams) { - return uri == other.uri && - listEqual(labels, other.labels, - (ClosingLabel a, ClosingLabel b) => a == b) && - true; - } - return false; - } - - @override - int get hashCode => Object.hash( - uri, - lspHashCode(labels), - ); - - @override - String toString() => jsonEncoder.convert(toJson()); -} - -class PublishFlutterOutlineParams implements ToJsonable { - static const jsonHandler = LspJsonHandler( - PublishFlutterOutlineParams.canParse, - PublishFlutterOutlineParams.fromJson, - ); - - PublishFlutterOutlineParams({ - required this.uri, - required this.outline, - }); - static PublishFlutterOutlineParams fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final outlineJson = json['outline']; - final outline = - FlutterOutline.fromJson(outlineJson as Map); - return PublishFlutterOutlineParams( - uri: uri, - outline: outline, - ); - } - - final FlutterOutline outline; - final String uri; - - Map toJson() { - var __result = {}; - __result['uri'] = uri; - __result['outline'] = outline.toJson(); - return __result; - } - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map) { reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -1459,6 +1378,69 @@ class PublishFlutterOutlineParams implements ToJsonable { } finally { reporter.pop(); } + return true; + } else { + reporter.reportError('must be of type PublishClosingLabelsParams'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is PublishClosingLabelsParams && + other.runtimeType == PublishClosingLabelsParams) { + return listEqual(labels, other.labels, + (ClosingLabel a, ClosingLabel b) => a == b) && + uri == other.uri && + true; + } + return false; + } + + @override + int get hashCode => Object.hash( + lspHashCode(labels), + uri, + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + +class PublishFlutterOutlineParams implements ToJsonable { + static const jsonHandler = LspJsonHandler( + PublishFlutterOutlineParams.canParse, + PublishFlutterOutlineParams.fromJson, + ); + + PublishFlutterOutlineParams({ + required this.outline, + required this.uri, + }); + static PublishFlutterOutlineParams fromJson(Map json) { + final outlineJson = json['outline']; + final outline = + FlutterOutline.fromJson(outlineJson as Map); + final uriJson = json['uri']; + final uri = uriJson as String; + return PublishFlutterOutlineParams( + outline: outline, + uri: uri, + ); + } + + final FlutterOutline outline; + final String uri; + + Map toJson() { + var __result = {}; + __result['outline'] = outline.toJson(); + __result['uri'] = uri; + return __result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { reporter.push('outline'); try { if (!obj.containsKey('outline')) { @@ -1477,65 +1459,6 @@ class PublishFlutterOutlineParams implements ToJsonable { } finally { reporter.pop(); } - return true; - } else { - reporter.reportError('must be of type PublishFlutterOutlineParams'); - return false; - } - } - - @override - bool operator ==(Object other) { - if (other is PublishFlutterOutlineParams && - other.runtimeType == PublishFlutterOutlineParams) { - return uri == other.uri && outline == other.outline && true; - } - return false; - } - - @override - int get hashCode => Object.hash( - uri, - outline, - ); - - @override - String toString() => jsonEncoder.convert(toJson()); -} - -class PublishOutlineParams implements ToJsonable { - static const jsonHandler = LspJsonHandler( - PublishOutlineParams.canParse, - PublishOutlineParams.fromJson, - ); - - PublishOutlineParams({ - required this.uri, - required this.outline, - }); - static PublishOutlineParams fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final outlineJson = json['outline']; - final outline = Outline.fromJson(outlineJson as Map); - return PublishOutlineParams( - uri: uri, - outline: outline, - ); - } - - final Outline outline; - final String uri; - - Map toJson() { - var __result = {}; - __result['uri'] = uri; - __result['outline'] = outline.toJson(); - return __result; - } - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map) { reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -1554,6 +1477,65 @@ class PublishOutlineParams implements ToJsonable { } finally { reporter.pop(); } + return true; + } else { + reporter.reportError('must be of type PublishFlutterOutlineParams'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is PublishFlutterOutlineParams && + other.runtimeType == PublishFlutterOutlineParams) { + return outline == other.outline && uri == other.uri && true; + } + return false; + } + + @override + int get hashCode => Object.hash( + outline, + uri, + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + +class PublishOutlineParams implements ToJsonable { + static const jsonHandler = LspJsonHandler( + PublishOutlineParams.canParse, + PublishOutlineParams.fromJson, + ); + + PublishOutlineParams({ + required this.outline, + required this.uri, + }); + static PublishOutlineParams fromJson(Map json) { + final outlineJson = json['outline']; + final outline = Outline.fromJson(outlineJson as Map); + final uriJson = json['uri']; + final uri = uriJson as String; + return PublishOutlineParams( + outline: outline, + uri: uri, + ); + } + + final Outline outline; + final String uri; + + Map toJson() { + var __result = {}; + __result['outline'] = outline.toJson(); + __result['uri'] = uri; + return __result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { reporter.push('outline'); try { if (!obj.containsKey('outline')) { @@ -1572,6 +1554,24 @@ class PublishOutlineParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type PublishOutlineParams'); @@ -1583,15 +1583,15 @@ class PublishOutlineParams implements ToJsonable { bool operator ==(Object other) { if (other is PublishOutlineParams && other.runtimeType == PublishOutlineParams) { - return uri == other.uri && outline == other.outline && true; + return outline == other.outline && uri == other.uri && true; } return false; } @override int get hashCode => Object.hash( - uri, outline, + uri, ); @override @@ -1606,21 +1606,21 @@ class SnippetTextEdit implements TextEdit, ToJsonable { SnippetTextEdit({ required this.insertTextFormat, - required this.range, required this.newText, + required this.range, }); static SnippetTextEdit fromJson(Map json) { final insertTextFormatJson = json['insertTextFormat']; final insertTextFormat = InsertTextFormat.fromJson(insertTextFormatJson as int); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final newTextJson = json['newText']; final newText = newTextJson as String; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return SnippetTextEdit( insertTextFormat: insertTextFormat, - range: range, newText: newText, + range: range, ); } @@ -1636,8 +1636,8 @@ class SnippetTextEdit implements TextEdit, ToJsonable { Map toJson() { var __result = {}; __result['insertTextFormat'] = insertTextFormat.toJson(); - __result['range'] = range.toJson(); __result['newText'] = newText; + __result['range'] = range.toJson(); return __result; } @@ -1661,24 +1661,6 @@ class SnippetTextEdit implements TextEdit, ToJsonable { } finally { reporter.pop(); } - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('newText'); try { if (!obj.containsKey('newText')) { @@ -1697,6 +1679,24 @@ class SnippetTextEdit implements TextEdit, ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SnippetTextEdit'); @@ -1708,8 +1708,8 @@ class SnippetTextEdit implements TextEdit, ToJsonable { bool operator ==(Object other) { if (other is SnippetTextEdit && other.runtimeType == SnippetTextEdit) { return insertTextFormat == other.insertTextFormat && - range == other.range && newText == other.newText && + range == other.range && true; } return false; @@ -1718,8 +1718,8 @@ class SnippetTextEdit implements TextEdit, ToJsonable { @override int get hashCode => Object.hash( insertTextFormat, - range, newText, + range, ); @override @@ -1733,17 +1733,17 @@ class ValidateRefactorResult implements ToJsonable { ); ValidateRefactorResult({ - required this.valid, this.message, + required this.valid, }); static ValidateRefactorResult fromJson(Map json) { - final validJson = json['valid']; - final valid = validJson as bool; final messageJson = json['message']; final message = messageJson as String?; + final validJson = json['valid']; + final valid = validJson as bool; return ValidateRefactorResult( - valid: valid, message: message, + valid: valid, ); } @@ -1752,15 +1752,25 @@ class ValidateRefactorResult implements ToJsonable { Map toJson() { var __result = {}; - __result['valid'] = valid; if (message != null) { __result['message'] = message; } + __result['valid'] = valid; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('message'); + try { + final message = obj['message']; + if (message != null && !(message is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('valid'); try { if (!obj.containsKey('valid')) { @@ -1779,16 +1789,6 @@ class ValidateRefactorResult implements ToJsonable { } finally { reporter.pop(); } - reporter.push('message'); - try { - final message = obj['message']; - if (message != null && !(message is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ValidateRefactorResult'); @@ -1800,15 +1800,15 @@ class ValidateRefactorResult implements ToJsonable { bool operator ==(Object other) { if (other is ValidateRefactorResult && other.runtimeType == ValidateRefactorResult) { - return valid == other.valid && message == other.message && true; + return message == other.message && valid == other.valid && true; } return false; } @override int get hashCode => Object.hash( - valid, message, + valid, ); @override diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart index cda14b219f6..99ca5b1c007 100644 --- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart +++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart @@ -31,20 +31,20 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { AnnotatedTextEdit({ required this.annotationId, - required this.range, required this.newText, + required this.range, }); static AnnotatedTextEdit fromJson(Map json) { final annotationIdJson = json['annotationId']; final annotationId = annotationIdJson as String; - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final newTextJson = json['newText']; final newText = newTextJson as String; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return AnnotatedTextEdit( annotationId: annotationId, - range: range, newText: newText, + range: range, ); } @@ -61,8 +61,8 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { Map toJson() { var __result = {}; __result['annotationId'] = annotationId; - __result['range'] = range.toJson(); __result['newText'] = newText; + __result['range'] = range.toJson(); return __result; } @@ -86,6 +86,24 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { } finally { reporter.pop(); } + reporter.push('newText'); + try { + if (!obj.containsKey('newText')) { + reporter.reportError('must not be undefined'); + return false; + } + final newText = obj['newText']; + if (newText == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(newText is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -104,24 +122,6 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { } finally { reporter.pop(); } - reporter.push('newText'); - try { - if (!obj.containsKey('newText')) { - reporter.reportError('must not be undefined'); - return false; - } - final newText = obj['newText']; - if (newText == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(newText is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type AnnotatedTextEdit'); @@ -133,8 +133,8 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { bool operator ==(Object other) { if (other is AnnotatedTextEdit && other.runtimeType == AnnotatedTextEdit) { return annotationId == other.annotationId && - range == other.range && newText == other.newText && + range == other.range && true; } return false; @@ -143,8 +143,8 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { @override int get hashCode => Object.hash( annotationId, - range, newText, + range, ); @override @@ -158,17 +158,17 @@ class ApplyWorkspaceEditParams implements ToJsonable { ); ApplyWorkspaceEditParams({ - this.label, required this.edit, + this.label, }); static ApplyWorkspaceEditParams fromJson(Map json) { - final labelJson = json['label']; - final label = labelJson as String?; final editJson = json['edit']; final edit = WorkspaceEdit.fromJson(editJson as Map); + final labelJson = json['label']; + final label = labelJson as String?; return ApplyWorkspaceEditParams( - label: label, edit: edit, + label: label, ); } @@ -181,25 +181,15 @@ class ApplyWorkspaceEditParams implements ToJsonable { Map toJson() { var __result = {}; + __result['edit'] = edit.toJson(); if (label != null) { __result['label'] = label; } - __result['edit'] = edit.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('label'); - try { - final label = obj['label']; - if (label != null && !(label is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('edit'); try { if (!obj.containsKey('edit')) { @@ -218,6 +208,16 @@ class ApplyWorkspaceEditParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('label'); + try { + final label = obj['label']; + if (label != null && !(label is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ApplyWorkspaceEditParams'); @@ -229,15 +229,15 @@ class ApplyWorkspaceEditParams implements ToJsonable { bool operator ==(Object other) { if (other is ApplyWorkspaceEditParams && other.runtimeType == ApplyWorkspaceEditParams) { - return label == other.label && edit == other.edit && true; + return edit == other.edit && label == other.label && true; } return false; } @override int get hashCode => Object.hash( - label, edit, + label, ); @override @@ -252,20 +252,20 @@ class ApplyWorkspaceEditResult implements ToJsonable { ApplyWorkspaceEditResult({ required this.applied, - this.failureReason, this.failedChange, + this.failureReason, }); static ApplyWorkspaceEditResult fromJson(Map json) { final appliedJson = json['applied']; final applied = appliedJson as bool; - final failureReasonJson = json['failureReason']; - final failureReason = failureReasonJson as String?; final failedChangeJson = json['failedChange']; final failedChange = failedChangeJson as int?; + final failureReasonJson = json['failureReason']; + final failureReason = failureReasonJson as String?; return ApplyWorkspaceEditResult( applied: applied, - failureReason: failureReason, failedChange: failedChange, + failureReason: failureReason, ); } @@ -286,12 +286,12 @@ class ApplyWorkspaceEditResult implements ToJsonable { Map toJson() { var __result = {}; __result['applied'] = applied; - if (failureReason != null) { - __result['failureReason'] = failureReason; - } if (failedChange != null) { __result['failedChange'] = failedChange; } + if (failureReason != null) { + __result['failureReason'] = failureReason; + } return __result; } @@ -315,16 +315,6 @@ class ApplyWorkspaceEditResult implements ToJsonable { } finally { reporter.pop(); } - reporter.push('failureReason'); - try { - final failureReason = obj['failureReason']; - if (failureReason != null && !(failureReason is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('failedChange'); try { final failedChange = obj['failedChange']; @@ -335,6 +325,16 @@ class ApplyWorkspaceEditResult implements ToJsonable { } finally { reporter.pop(); } + reporter.push('failureReason'); + try { + final failureReason = obj['failureReason']; + if (failureReason != null && !(failureReason is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ApplyWorkspaceEditResult'); @@ -347,8 +347,8 @@ class ApplyWorkspaceEditResult implements ToJsonable { if (other is ApplyWorkspaceEditResult && other.runtimeType == ApplyWorkspaceEditResult) { return applied == other.applied && - failureReason == other.failureReason && failedChange == other.failedChange && + failureReason == other.failureReason && true; } return false; @@ -357,8 +357,8 @@ class ApplyWorkspaceEditResult implements ToJsonable { @override int get hashCode => Object.hash( applied, - failureReason, failedChange, + failureReason, ); @override @@ -545,20 +545,12 @@ class CallHierarchyIncomingCallsParams CallHierarchyIncomingCallsParams({ required this.item, - this.workDoneToken, this.partialResultToken, + this.workDoneToken, }); static CallHierarchyIncomingCallsParams fromJson(Map json) { final itemJson = json['item']; final item = CallHierarchyItem.fromJson(itemJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -567,10 +559,18 @@ class CallHierarchyIncomingCallsParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return CallHierarchyIncomingCallsParams( item: item, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + workDoneToken: workDoneToken, ); } @@ -586,12 +586,12 @@ class CallHierarchyIncomingCallsParams Map toJson() { var __result = {}; __result['item'] = item.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -615,22 +615,22 @@ class CallHierarchyIncomingCallsParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('partialResultToken'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { reporter.reportError('must be of type Either2'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -649,8 +649,8 @@ class CallHierarchyIncomingCallsParams if (other is CallHierarchyIncomingCallsParams && other.runtimeType == CallHierarchyIncomingCallsParams) { return item == other.item && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + workDoneToken == other.workDoneToken && true; } return false; @@ -659,8 +659,8 @@ class CallHierarchyIncomingCallsParams @override int get hashCode => Object.hash( item, - workDoneToken, partialResultToken, + workDoneToken, ); @override @@ -674,44 +674,44 @@ class CallHierarchyItem implements ToJsonable { ); CallHierarchyItem({ - required this.name, - required this.kind, - this.tags, + this.data, this.detail, - required this.uri, + required this.kind, + required this.name, required this.range, required this.selectionRange, - this.data, + this.tags, + required this.uri, }); static CallHierarchyItem fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; - final kindJson = json['kind']; - final kind = SymbolKind.fromJson(kindJson as int); - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => SymbolTag.fromJson(item as int)) - .toList(); + final dataJson = json['data']; + final data = dataJson; final detailJson = json['detail']; final detail = detailJson as String?; - final uriJson = json['uri']; - final uri = uriJson as String; + final kindJson = json['kind']; + final kind = SymbolKind.fromJson(kindJson as int); + final nameJson = json['name']; + final name = nameJson as String; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); final selectionRangeJson = json['selectionRange']; final selectionRange = Range.fromJson(selectionRangeJson as Map); - final dataJson = json['data']; - final data = dataJson; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => SymbolTag.fromJson(item as int)) + .toList(); + final uriJson = json['uri']; + final uri = uriJson as String; return CallHierarchyItem( - name: name, - kind: kind, - tags: tags, + data: data, detail: detail, - uri: uri, + kind: kind, + name: name, range: range, selectionRange: selectionRange, - data: data, + tags: tags, + uri: uri, ); } @@ -745,37 +745,29 @@ class CallHierarchyItem implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; - __result['kind'] = kind.toJson(); - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); + if (data != null) { + __result['data'] = data; } if (detail != null) { __result['detail'] = detail; } - __result['uri'] = uri; + __result['kind'] = kind.toJson(); + __result['name'] = name; __result['range'] = range.toJson(); __result['selectionRange'] = selectionRange.toJson(); - if (data != null) { - __result['data'] = data; + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); } + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); + reporter.push('detail'); try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); - return false; - } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { + final detail = obj['detail']; + if (detail != null && !(detail is String)) { reporter.reportError('must be of type String'); return false; } @@ -800,40 +792,18 @@ class CallHierarchyItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); + reporter.push('name'); try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('detail'); - try { - final detail = obj['detail']; - if (detail != null && !(detail is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { + if (!obj.containsKey('name')) { reporter.reportError('must not be undefined'); return false; } - final uri = obj['uri']; - if (uri == null) { + final name = obj['name']; + if (name == null) { reporter.reportError('must not be null'); return false; } - if (!(uri is String)) { + if (!(name is String)) { reporter.reportError('must be of type String'); return false; } @@ -876,6 +846,36 @@ class CallHierarchyItem implements ToJsonable { } finally { reporter.pop(); } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type CallHierarchyItem'); @@ -886,14 +886,14 @@ class CallHierarchyItem implements ToJsonable { @override bool operator ==(Object other) { if (other is CallHierarchyItem && other.runtimeType == CallHierarchyItem) { - return name == other.name && - kind == other.kind && - listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + return data == other.data && detail == other.detail && - uri == other.uri && + kind == other.kind && + name == other.name && range == other.range && selectionRange == other.selectionRange && - data == other.data && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + uri == other.uri && true; } return false; @@ -901,14 +901,14 @@ class CallHierarchyItem implements ToJsonable { @override int get hashCode => Object.hash( - name, - kind, - lspHashCode(tags), + data, detail, - uri, + kind, + name, range, selectionRange, - data, + lspHashCode(tags), + uri, ); @override @@ -987,19 +987,19 @@ class CallHierarchyOutgoingCall implements ToJsonable { ); CallHierarchyOutgoingCall({ - required this.to, required this.fromRanges, + required this.to, }); static CallHierarchyOutgoingCall fromJson(Map json) { - final toJson = json['to']; - final to = CallHierarchyItem.fromJson(toJson as Map); final fromRangesJson = json['fromRanges']; final fromRanges = (fromRangesJson as List) .map((item) => Range.fromJson(item as Map)) .toList(); + final toJson = json['to']; + final to = CallHierarchyItem.fromJson(toJson as Map); return CallHierarchyOutgoingCall( - to: to, fromRanges: fromRanges, + to: to, ); } @@ -1012,31 +1012,13 @@ class CallHierarchyOutgoingCall implements ToJsonable { Map toJson() { var __result = {}; - __result['to'] = to.toJson(); __result['fromRanges'] = fromRanges.map((item) => item.toJson()).toList(); + __result['to'] = to.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('to'); - try { - if (!obj.containsKey('to')) { - reporter.reportError('must not be undefined'); - return false; - } - final to = obj['to']; - if (to == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(CallHierarchyItem.canParse(to, reporter))) { - reporter.reportError('must be of type CallHierarchyItem'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('fromRanges'); try { if (!obj.containsKey('fromRanges')) { @@ -1056,6 +1038,24 @@ class CallHierarchyOutgoingCall implements ToJsonable { } finally { reporter.pop(); } + reporter.push('to'); + try { + if (!obj.containsKey('to')) { + reporter.reportError('must not be undefined'); + return false; + } + final to = obj['to']; + if (to == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(CallHierarchyItem.canParse(to, reporter))) { + reporter.reportError('must be of type CallHierarchyItem'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type CallHierarchyOutgoingCall'); @@ -1067,9 +1067,9 @@ class CallHierarchyOutgoingCall implements ToJsonable { bool operator ==(Object other) { if (other is CallHierarchyOutgoingCall && other.runtimeType == CallHierarchyOutgoingCall) { - return to == other.to && - listEqual( + return listEqual( fromRanges, other.fromRanges, (Range a, Range b) => a == b) && + to == other.to && true; } return false; @@ -1077,8 +1077,8 @@ class CallHierarchyOutgoingCall implements ToJsonable { @override int get hashCode => Object.hash( - to, lspHashCode(fromRanges), + to, ); @override @@ -1094,20 +1094,12 @@ class CallHierarchyOutgoingCallsParams CallHierarchyOutgoingCallsParams({ required this.item, - this.workDoneToken, this.partialResultToken, + this.workDoneToken, }); static CallHierarchyOutgoingCallsParams fromJson(Map json) { final itemJson = json['item']; final item = CallHierarchyItem.fromJson(itemJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -1116,10 +1108,18 @@ class CallHierarchyOutgoingCallsParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return CallHierarchyOutgoingCallsParams( item: item, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + workDoneToken: workDoneToken, ); } @@ -1135,12 +1135,12 @@ class CallHierarchyOutgoingCallsParams Map toJson() { var __result = {}; __result['item'] = item.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -1164,22 +1164,22 @@ class CallHierarchyOutgoingCallsParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('partialResultToken'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { reporter.reportError('must be of type Either2'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -1198,8 +1198,8 @@ class CallHierarchyOutgoingCallsParams if (other is CallHierarchyOutgoingCallsParams && other.runtimeType == CallHierarchyOutgoingCallsParams) { return item == other.item && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + workDoneToken == other.workDoneToken && true; } return false; @@ -1208,8 +1208,8 @@ class CallHierarchyOutgoingCallsParams @override int get hashCode => Object.hash( item, - workDoneToken, partialResultToken, + workDoneToken, ); @override @@ -1224,16 +1224,16 @@ class CallHierarchyPrepareParams ); CallHierarchyPrepareParams({ - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static CallHierarchyPrepareParams fromJson(Map json) { + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -1243,8 +1243,8 @@ class CallHierarchyPrepareParams ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return CallHierarchyPrepareParams( - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -1260,8 +1260,8 @@ class CallHierarchyPrepareParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -1270,24 +1270,6 @@ class CallHierarchyPrepareParams static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -1306,6 +1288,24 @@ class CallHierarchyPrepareParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -1328,8 +1328,8 @@ class CallHierarchyPrepareParams bool operator ==(Object other) { if (other is CallHierarchyPrepareParams && other.runtimeType == CallHierarchyPrepareParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -1338,8 +1338,8 @@ class CallHierarchyPrepareParams @override int get hashCode => Object.hash( - textDocument, position, + textDocument, workDoneToken, ); @@ -1360,22 +1360,22 @@ class CallHierarchyRegistrationOptions CallHierarchyRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static CallHierarchyRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return CallHierarchyRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -1391,12 +1391,12 @@ class CallHierarchyRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -1419,16 +1419,6 @@ class CallHierarchyRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -1439,6 +1429,16 @@ class CallHierarchyRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type CallHierarchyRegistrationOptions'); @@ -1452,8 +1452,8 @@ class CallHierarchyRegistrationOptions other.runtimeType == CallHierarchyRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -1462,8 +1462,8 @@ class CallHierarchyRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -1551,21 +1551,21 @@ class ChangeAnnotation implements ToJsonable { ); ChangeAnnotation({ + this.description, required this.label, this.needsConfirmation, - this.description, }); static ChangeAnnotation fromJson(Map json) { + final descriptionJson = json['description']; + final description = descriptionJson as String?; final labelJson = json['label']; final label = labelJson as String; final needsConfirmationJson = json['needsConfirmation']; final needsConfirmation = needsConfirmationJson as bool?; - final descriptionJson = json['description']; - final description = descriptionJson as String?; return ChangeAnnotation( + description: description, label: label, needsConfirmation: needsConfirmation, - description: description, ); } @@ -1583,18 +1583,28 @@ class ChangeAnnotation implements ToJsonable { Map toJson() { var __result = {}; + if (description != null) { + __result['description'] = description; + } __result['label'] = label; if (needsConfirmation != null) { __result['needsConfirmation'] = needsConfirmation; } - if (description != null) { - __result['description'] = description; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('description'); + try { + final description = obj['description']; + if (description != null && !(description is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('label'); try { if (!obj.containsKey('label')) { @@ -1623,16 +1633,6 @@ class ChangeAnnotation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('description'); - try { - final description = obj['description']; - if (description != null && !(description is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ChangeAnnotation'); @@ -1643,9 +1643,9 @@ class ChangeAnnotation implements ToJsonable { @override bool operator ==(Object other) { if (other is ChangeAnnotation && other.runtimeType == ChangeAnnotation) { - return label == other.label && + return description == other.description && + label == other.label && needsConfirmation == other.needsConfirmation && - description == other.description && true; } return false; @@ -1653,9 +1653,9 @@ class ChangeAnnotation implements ToJsonable { @override int get hashCode => Object.hash( + description, label, needsConfirmation, - description, ); @override @@ -1669,47 +1669,47 @@ class ClientCapabilities implements ToJsonable { ); ClientCapabilities({ - this.workspace, - this.textDocument, - this.notebookDocument, - this.window, - this.general, this.experimental, + this.general, + this.notebookDocument, + this.textDocument, + this.window, + this.workspace, }); static ClientCapabilities fromJson(Map json) { - final workspaceJson = json['workspace']; - final workspace = workspaceJson != null - ? ClientCapabilitiesWorkspace.fromJson( - workspaceJson as Map) - : null; - final textDocumentJson = json['textDocument']; - final textDocument = textDocumentJson != null - ? TextDocumentClientCapabilities.fromJson( - textDocumentJson as Map) + final experimentalJson = json['experimental']; + final experimental = experimentalJson; + final generalJson = json['general']; + final general = generalJson != null + ? ClientCapabilitiesGeneral.fromJson( + generalJson as Map) : null; final notebookDocumentJson = json['notebookDocument']; final notebookDocument = notebookDocumentJson != null ? NotebookDocumentClientCapabilities.fromJson( notebookDocumentJson as Map) : null; + final textDocumentJson = json['textDocument']; + final textDocument = textDocumentJson != null + ? TextDocumentClientCapabilities.fromJson( + textDocumentJson as Map) + : null; final windowJson = json['window']; final window = windowJson != null ? ClientCapabilitiesWindow.fromJson(windowJson as Map) : null; - final generalJson = json['general']; - final general = generalJson != null - ? ClientCapabilitiesGeneral.fromJson( - generalJson as Map) + final workspaceJson = json['workspace']; + final workspace = workspaceJson != null + ? ClientCapabilitiesWorkspace.fromJson( + workspaceJson as Map) : null; - final experimentalJson = json['experimental']; - final experimental = experimentalJson; return ClientCapabilities( - workspace: workspace, - textDocument: textDocument, - notebookDocument: notebookDocument, - window: window, - general: general, experimental: experimental, + general: general, + notebookDocument: notebookDocument, + textDocument: textDocument, + window: window, + workspace: workspace, ); } @@ -1735,48 +1735,35 @@ class ClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (workspace != null) { - __result['workspace'] = workspace?.toJson(); - } - if (textDocument != null) { - __result['textDocument'] = textDocument?.toJson(); - } - if (notebookDocument != null) { - __result['notebookDocument'] = notebookDocument?.toJson(); - } - if (window != null) { - __result['window'] = window?.toJson(); + if (experimental != null) { + __result['experimental'] = experimental; } if (general != null) { __result['general'] = general?.toJson(); } - if (experimental != null) { - __result['experimental'] = experimental; + if (notebookDocument != null) { + __result['notebookDocument'] = notebookDocument?.toJson(); + } + if (textDocument != null) { + __result['textDocument'] = textDocument?.toJson(); + } + if (window != null) { + __result['window'] = window?.toJson(); + } + if (workspace != null) { + __result['workspace'] = workspace?.toJson(); } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workspace'); + reporter.push('general'); try { - final workspace = obj['workspace']; - if (workspace != null && - !(ClientCapabilitiesWorkspace.canParse(workspace, reporter))) { - reporter.reportError('must be of type ClientCapabilitiesWorkspace'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('textDocument'); - try { - final textDocument = obj['textDocument']; - if (textDocument != null && - !(TextDocumentClientCapabilities.canParse( - textDocument, reporter))) { - reporter - .reportError('must be of type TextDocumentClientCapabilities'); + final general = obj['general']; + if (general != null && + !(ClientCapabilitiesGeneral.canParse(general, reporter))) { + reporter.reportError('must be of type ClientCapabilitiesGeneral'); return false; } } finally { @@ -1795,6 +1782,19 @@ class ClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + final textDocument = obj['textDocument']; + if (textDocument != null && + !(TextDocumentClientCapabilities.canParse( + textDocument, reporter))) { + reporter + .reportError('must be of type TextDocumentClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('window'); try { final window = obj['window']; @@ -1806,12 +1806,12 @@ class ClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('general'); + reporter.push('workspace'); try { - final general = obj['general']; - if (general != null && - !(ClientCapabilitiesGeneral.canParse(general, reporter))) { - reporter.reportError('must be of type ClientCapabilitiesGeneral'); + final workspace = obj['workspace']; + if (workspace != null && + !(ClientCapabilitiesWorkspace.canParse(workspace, reporter))) { + reporter.reportError('must be of type ClientCapabilitiesWorkspace'); return false; } } finally { @@ -1828,12 +1828,12 @@ class ClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is ClientCapabilities && other.runtimeType == ClientCapabilities) { - return workspace == other.workspace && - textDocument == other.textDocument && - notebookDocument == other.notebookDocument && - window == other.window && + return experimental == other.experimental && general == other.general && - experimental == other.experimental && + notebookDocument == other.notebookDocument && + textDocument == other.textDocument && + window == other.window && + workspace == other.workspace && true; } return false; @@ -1841,12 +1841,12 @@ class ClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - workspace, - textDocument, - notebookDocument, - window, - general, experimental, + general, + notebookDocument, + textDocument, + window, + workspace, ); @override @@ -1860,37 +1860,37 @@ class ClientCapabilitiesFileOperations implements ToJsonable { ); ClientCapabilitiesFileOperations({ - this.dynamicRegistration, this.didCreate, - this.willCreate, - this.didRename, - this.willRename, this.didDelete, + this.didRename, + this.dynamicRegistration, + this.willCreate, this.willDelete, + this.willRename, }); static ClientCapabilitiesFileOperations fromJson(Map json) { - final dynamicRegistrationJson = json['dynamicRegistration']; - final dynamicRegistration = dynamicRegistrationJson as bool?; final didCreateJson = json['didCreate']; final didCreate = didCreateJson as bool?; - final willCreateJson = json['willCreate']; - final willCreate = willCreateJson as bool?; - final didRenameJson = json['didRename']; - final didRename = didRenameJson as bool?; - final willRenameJson = json['willRename']; - final willRename = willRenameJson as bool?; final didDeleteJson = json['didDelete']; final didDelete = didDeleteJson as bool?; + final didRenameJson = json['didRename']; + final didRename = didRenameJson as bool?; + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; + final willCreateJson = json['willCreate']; + final willCreate = willCreateJson as bool?; final willDeleteJson = json['willDelete']; final willDelete = willDeleteJson as bool?; + final willRenameJson = json['willRename']; + final willRename = willRenameJson as bool?; return ClientCapabilitiesFileOperations( - dynamicRegistration: dynamicRegistration, didCreate: didCreate, - willCreate: willCreate, - didRename: didRename, - willRename: willRename, didDelete: didDelete, + didRename: didRename, + dynamicRegistration: dynamicRegistration, + willCreate: willCreate, willDelete: willDelete, + willRename: willRename, ); } @@ -1918,42 +1918,32 @@ class ClientCapabilitiesFileOperations implements ToJsonable { Map toJson() { var __result = {}; - if (dynamicRegistration != null) { - __result['dynamicRegistration'] = dynamicRegistration; - } if (didCreate != null) { __result['didCreate'] = didCreate; } - if (willCreate != null) { - __result['willCreate'] = willCreate; - } - if (didRename != null) { - __result['didRename'] = didRename; - } - if (willRename != null) { - __result['willRename'] = willRename; - } if (didDelete != null) { __result['didDelete'] = didDelete; } + if (didRename != null) { + __result['didRename'] = didRename; + } + if (dynamicRegistration != null) { + __result['dynamicRegistration'] = dynamicRegistration; + } + if (willCreate != null) { + __result['willCreate'] = willCreate; + } if (willDelete != null) { __result['willDelete'] = willDelete; } + if (willRename != null) { + __result['willRename'] = willRename; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('dynamicRegistration'); - try { - final dynamicRegistration = obj['dynamicRegistration']; - if (dynamicRegistration != null && !(dynamicRegistration is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('didCreate'); try { final didCreate = obj['didCreate']; @@ -1964,36 +1954,6 @@ class ClientCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } - reporter.push('willCreate'); - try { - final willCreate = obj['willCreate']; - if (willCreate != null && !(willCreate is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('didRename'); - try { - final didRename = obj['didRename']; - if (didRename != null && !(didRename is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('willRename'); - try { - final willRename = obj['willRename']; - if (willRename != null && !(willRename is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('didDelete'); try { final didDelete = obj['didDelete']; @@ -2004,6 +1964,36 @@ class ClientCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } + reporter.push('didRename'); + try { + final didRename = obj['didRename']; + if (didRename != null && !(didRename is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('dynamicRegistration'); + try { + final dynamicRegistration = obj['dynamicRegistration']; + if (dynamicRegistration != null && !(dynamicRegistration is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('willCreate'); + try { + final willCreate = obj['willCreate']; + if (willCreate != null && !(willCreate is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('willDelete'); try { final willDelete = obj['willDelete']; @@ -2014,6 +2004,16 @@ class ClientCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } + reporter.push('willRename'); + try { + final willRename = obj['willRename']; + if (willRename != null && !(willRename is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ClientCapabilitiesFileOperations'); @@ -2025,13 +2025,13 @@ class ClientCapabilitiesFileOperations implements ToJsonable { bool operator ==(Object other) { if (other is ClientCapabilitiesFileOperations && other.runtimeType == ClientCapabilitiesFileOperations) { - return dynamicRegistration == other.dynamicRegistration && - didCreate == other.didCreate && - willCreate == other.willCreate && - didRename == other.didRename && - willRename == other.willRename && + return didCreate == other.didCreate && didDelete == other.didDelete && + didRename == other.didRename && + dynamicRegistration == other.dynamicRegistration && + willCreate == other.willCreate && willDelete == other.willDelete && + willRename == other.willRename && true; } return false; @@ -2039,13 +2039,13 @@ class ClientCapabilitiesFileOperations implements ToJsonable { @override int get hashCode => Object.hash( - dynamicRegistration, didCreate, - willCreate, - didRename, - willRename, didDelete, + didRename, + dynamicRegistration, + willCreate, willDelete, + willRename, ); @override @@ -2059,22 +2059,12 @@ class ClientCapabilitiesGeneral implements ToJsonable { ); ClientCapabilitiesGeneral({ - this.staleRequestSupport, - this.regularExpressions, this.markdown, this.positionEncodings, + this.regularExpressions, + this.staleRequestSupport, }); static ClientCapabilitiesGeneral fromJson(Map json) { - final staleRequestSupportJson = json['staleRequestSupport']; - final staleRequestSupport = staleRequestSupportJson != null - ? ClientCapabilitiesStaleRequestSupport.fromJson( - staleRequestSupportJson as Map) - : null; - final regularExpressionsJson = json['regularExpressions']; - final regularExpressions = regularExpressionsJson != null - ? RegularExpressionsClientCapabilities.fromJson( - regularExpressionsJson as Map) - : null; final markdownJson = json['markdown']; final markdown = markdownJson != null ? MarkdownClientCapabilities.fromJson( @@ -2084,11 +2074,21 @@ class ClientCapabilitiesGeneral implements ToJsonable { final positionEncodings = (positionEncodingsJson as List?) ?.map((item) => PositionEncodingKind.fromJson(item as String)) .toList(); + final regularExpressionsJson = json['regularExpressions']; + final regularExpressions = regularExpressionsJson != null + ? RegularExpressionsClientCapabilities.fromJson( + regularExpressionsJson as Map) + : null; + final staleRequestSupportJson = json['staleRequestSupport']; + final staleRequestSupport = staleRequestSupportJson != null + ? ClientCapabilitiesStaleRequestSupport.fromJson( + staleRequestSupportJson as Map) + : null; return ClientCapabilitiesGeneral( - staleRequestSupport: staleRequestSupport, - regularExpressions: regularExpressions, markdown: markdown, positionEncodings: positionEncodings, + regularExpressions: regularExpressions, + staleRequestSupport: staleRequestSupport, ); } @@ -2125,12 +2125,6 @@ class ClientCapabilitiesGeneral implements ToJsonable { Map toJson() { var __result = {}; - if (staleRequestSupport != null) { - __result['staleRequestSupport'] = staleRequestSupport?.toJson(); - } - if (regularExpressions != null) { - __result['regularExpressions'] = regularExpressions?.toJson(); - } if (markdown != null) { __result['markdown'] = markdown?.toJson(); } @@ -2138,37 +2132,17 @@ class ClientCapabilitiesGeneral implements ToJsonable { __result['positionEncodings'] = positionEncodings?.map((item) => item.toJson()).toList(); } + if (regularExpressions != null) { + __result['regularExpressions'] = regularExpressions?.toJson(); + } + if (staleRequestSupport != null) { + __result['staleRequestSupport'] = staleRequestSupport?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('staleRequestSupport'); - try { - final staleRequestSupport = obj['staleRequestSupport']; - if (staleRequestSupport != null && - !(ClientCapabilitiesStaleRequestSupport.canParse( - staleRequestSupport, reporter))) { - reporter.reportError( - 'must be of type ClientCapabilitiesStaleRequestSupport'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('regularExpressions'); - try { - final regularExpressions = obj['regularExpressions']; - if (regularExpressions != null && - !(RegularExpressionsClientCapabilities.canParse( - regularExpressions, reporter))) { - reporter.reportError( - 'must be of type RegularExpressionsClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('markdown'); try { final markdown = obj['markdown']; @@ -2193,6 +2167,32 @@ class ClientCapabilitiesGeneral implements ToJsonable { } finally { reporter.pop(); } + reporter.push('regularExpressions'); + try { + final regularExpressions = obj['regularExpressions']; + if (regularExpressions != null && + !(RegularExpressionsClientCapabilities.canParse( + regularExpressions, reporter))) { + reporter.reportError( + 'must be of type RegularExpressionsClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('staleRequestSupport'); + try { + final staleRequestSupport = obj['staleRequestSupport']; + if (staleRequestSupport != null && + !(ClientCapabilitiesStaleRequestSupport.canParse( + staleRequestSupport, reporter))) { + reporter.reportError( + 'must be of type ClientCapabilitiesStaleRequestSupport'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ClientCapabilitiesGeneral'); @@ -2204,11 +2204,11 @@ class ClientCapabilitiesGeneral implements ToJsonable { bool operator ==(Object other) { if (other is ClientCapabilitiesGeneral && other.runtimeType == ClientCapabilitiesGeneral) { - return staleRequestSupport == other.staleRequestSupport && - regularExpressions == other.regularExpressions && - markdown == other.markdown && + return markdown == other.markdown && listEqual(positionEncodings, other.positionEncodings, (PositionEncodingKind a, PositionEncodingKind b) => a == b) && + regularExpressions == other.regularExpressions && + staleRequestSupport == other.staleRequestSupport && true; } return false; @@ -2216,10 +2216,10 @@ class ClientCapabilitiesGeneral implements ToJsonable { @override int get hashCode => Object.hash( - staleRequestSupport, - regularExpressions, markdown, lspHashCode(positionEncodings), + regularExpressions, + staleRequestSupport, ); @override @@ -2340,27 +2340,27 @@ class ClientCapabilitiesWindow implements ToJsonable { ); ClientCapabilitiesWindow({ - this.workDoneProgress, - this.showMessage, this.showDocument, + this.showMessage, + this.workDoneProgress, }); static ClientCapabilitiesWindow fromJson(Map json) { - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; - final showMessageJson = json['showMessage']; - final showMessage = showMessageJson != null - ? ShowMessageRequestClientCapabilities.fromJson( - showMessageJson as Map) - : null; final showDocumentJson = json['showDocument']; final showDocument = showDocumentJson != null ? ShowDocumentClientCapabilities.fromJson( showDocumentJson as Map) : null; + final showMessageJson = json['showMessage']; + final showMessage = showMessageJson != null + ? ShowMessageRequestClientCapabilities.fromJson( + showMessageJson as Map) + : null; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return ClientCapabilitiesWindow( - workDoneProgress: workDoneProgress, - showMessage: showMessage, showDocument: showDocument, + showMessage: showMessage, + workDoneProgress: workDoneProgress, ); } @@ -2383,25 +2383,28 @@ class ClientCapabilitiesWindow implements ToJsonable { Map toJson() { var __result = {}; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; + if (showDocument != null) { + __result['showDocument'] = showDocument?.toJson(); } if (showMessage != null) { __result['showMessage'] = showMessage?.toJson(); } - if (showDocument != null) { - __result['showDocument'] = showDocument?.toJson(); + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workDoneProgress'); + reporter.push('showDocument'); try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); + final showDocument = obj['showDocument']; + if (showDocument != null && + !(ShowDocumentClientCapabilities.canParse( + showDocument, reporter))) { + reporter + .reportError('must be of type ShowDocumentClientCapabilities'); return false; } } finally { @@ -2420,14 +2423,11 @@ class ClientCapabilitiesWindow implements ToJsonable { } finally { reporter.pop(); } - reporter.push('showDocument'); + reporter.push('workDoneProgress'); try { - final showDocument = obj['showDocument']; - if (showDocument != null && - !(ShowDocumentClientCapabilities.canParse( - showDocument, reporter))) { - reporter - .reportError('must be of type ShowDocumentClientCapabilities'); + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -2444,9 +2444,9 @@ class ClientCapabilitiesWindow implements ToJsonable { bool operator ==(Object other) { if (other is ClientCapabilitiesWindow && other.runtimeType == ClientCapabilitiesWindow) { - return workDoneProgress == other.workDoneProgress && + return showDocument == other.showDocument && showMessage == other.showMessage && - showDocument == other.showDocument && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -2454,9 +2454,9 @@ class ClientCapabilitiesWindow implements ToJsonable { @override int get hashCode => Object.hash( - workDoneProgress, - showMessage, showDocument, + showMessage, + workDoneProgress, ); @override @@ -2471,27 +2471,34 @@ class ClientCapabilitiesWorkspace implements ToJsonable { ClientCapabilitiesWorkspace({ this.applyEdit, - this.workspaceEdit, + this.codeLens, + this.configuration, + this.diagnostics, this.didChangeConfiguration, this.didChangeWatchedFiles, - this.symbol, this.executeCommand, - this.workspaceFolders, - this.configuration, - this.semanticTokens, - this.codeLens, this.fileOperations, - this.inlineValue, this.inlayHint, - this.diagnostics, + this.inlineValue, + this.semanticTokens, + this.symbol, + this.workspaceEdit, + this.workspaceFolders, }); static ClientCapabilitiesWorkspace fromJson(Map json) { final applyEditJson = json['applyEdit']; final applyEdit = applyEditJson as bool?; - final workspaceEditJson = json['workspaceEdit']; - final workspaceEdit = workspaceEditJson != null - ? WorkspaceEditClientCapabilities.fromJson( - workspaceEditJson as Map) + final codeLensJson = json['codeLens']; + final codeLens = codeLensJson != null + ? CodeLensWorkspaceClientCapabilities.fromJson( + codeLensJson as Map) + : null; + final configurationJson = json['configuration']; + final configuration = configurationJson as bool?; + final diagnosticsJson = json['diagnostics']; + final diagnostics = diagnosticsJson != null + ? DiagnosticWorkspaceClientCapabilities.fromJson( + diagnosticsJson as Map) : null; final didChangeConfigurationJson = json['didChangeConfiguration']; final didChangeConfiguration = didChangeConfigurationJson != null @@ -2503,65 +2510,58 @@ class ClientCapabilitiesWorkspace implements ToJsonable { ? DidChangeWatchedFilesClientCapabilities.fromJson( didChangeWatchedFilesJson as Map) : null; - final symbolJson = json['symbol']; - final symbol = symbolJson != null - ? WorkspaceSymbolClientCapabilities.fromJson( - symbolJson as Map) - : null; final executeCommandJson = json['executeCommand']; final executeCommand = executeCommandJson != null ? ExecuteCommandClientCapabilities.fromJson( executeCommandJson as Map) : null; - final workspaceFoldersJson = json['workspaceFolders']; - final workspaceFolders = workspaceFoldersJson as bool?; - final configurationJson = json['configuration']; - final configuration = configurationJson as bool?; - final semanticTokensJson = json['semanticTokens']; - final semanticTokens = semanticTokensJson != null - ? SemanticTokensWorkspaceClientCapabilities.fromJson( - semanticTokensJson as Map) - : null; - final codeLensJson = json['codeLens']; - final codeLens = codeLensJson != null - ? CodeLensWorkspaceClientCapabilities.fromJson( - codeLensJson as Map) - : null; final fileOperationsJson = json['fileOperations']; final fileOperations = fileOperationsJson != null ? ClientCapabilitiesFileOperations.fromJson( fileOperationsJson as Map) : null; - final inlineValueJson = json['inlineValue']; - final inlineValue = inlineValueJson != null - ? InlineValueWorkspaceClientCapabilities.fromJson( - inlineValueJson as Map) - : null; final inlayHintJson = json['inlayHint']; final inlayHint = inlayHintJson != null ? InlayHintWorkspaceClientCapabilities.fromJson( inlayHintJson as Map) : null; - final diagnosticsJson = json['diagnostics']; - final diagnostics = diagnosticsJson != null - ? DiagnosticWorkspaceClientCapabilities.fromJson( - diagnosticsJson as Map) + final inlineValueJson = json['inlineValue']; + final inlineValue = inlineValueJson != null + ? InlineValueWorkspaceClientCapabilities.fromJson( + inlineValueJson as Map) : null; + final semanticTokensJson = json['semanticTokens']; + final semanticTokens = semanticTokensJson != null + ? SemanticTokensWorkspaceClientCapabilities.fromJson( + semanticTokensJson as Map) + : null; + final symbolJson = json['symbol']; + final symbol = symbolJson != null + ? WorkspaceSymbolClientCapabilities.fromJson( + symbolJson as Map) + : null; + final workspaceEditJson = json['workspaceEdit']; + final workspaceEdit = workspaceEditJson != null + ? WorkspaceEditClientCapabilities.fromJson( + workspaceEditJson as Map) + : null; + final workspaceFoldersJson = json['workspaceFolders']; + final workspaceFolders = workspaceFoldersJson as bool?; return ClientCapabilitiesWorkspace( applyEdit: applyEdit, - workspaceEdit: workspaceEdit, + codeLens: codeLens, + configuration: configuration, + diagnostics: diagnostics, didChangeConfiguration: didChangeConfiguration, didChangeWatchedFiles: didChangeWatchedFiles, - symbol: symbol, executeCommand: executeCommand, - workspaceFolders: workspaceFolders, - configuration: configuration, - semanticTokens: semanticTokens, - codeLens: codeLens, fileOperations: fileOperations, - inlineValue: inlineValue, inlayHint: inlayHint, - diagnostics: diagnostics, + inlineValue: inlineValue, + semanticTokens: semanticTokens, + symbol: symbol, + workspaceEdit: workspaceEdit, + workspaceFolders: workspaceFolders, ); } @@ -2624,8 +2624,14 @@ class ClientCapabilitiesWorkspace implements ToJsonable { if (applyEdit != null) { __result['applyEdit'] = applyEdit; } - if (workspaceEdit != null) { - __result['workspaceEdit'] = workspaceEdit?.toJson(); + if (codeLens != null) { + __result['codeLens'] = codeLens?.toJson(); + } + if (configuration != null) { + __result['configuration'] = configuration; + } + if (diagnostics != null) { + __result['diagnostics'] = diagnostics?.toJson(); } if (didChangeConfiguration != null) { __result['didChangeConfiguration'] = didChangeConfiguration?.toJson(); @@ -2633,35 +2639,29 @@ class ClientCapabilitiesWorkspace implements ToJsonable { if (didChangeWatchedFiles != null) { __result['didChangeWatchedFiles'] = didChangeWatchedFiles?.toJson(); } - if (symbol != null) { - __result['symbol'] = symbol?.toJson(); - } if (executeCommand != null) { __result['executeCommand'] = executeCommand?.toJson(); } - if (workspaceFolders != null) { - __result['workspaceFolders'] = workspaceFolders; - } - if (configuration != null) { - __result['configuration'] = configuration; - } - if (semanticTokens != null) { - __result['semanticTokens'] = semanticTokens?.toJson(); - } - if (codeLens != null) { - __result['codeLens'] = codeLens?.toJson(); - } if (fileOperations != null) { __result['fileOperations'] = fileOperations?.toJson(); } - if (inlineValue != null) { - __result['inlineValue'] = inlineValue?.toJson(); - } if (inlayHint != null) { __result['inlayHint'] = inlayHint?.toJson(); } - if (diagnostics != null) { - __result['diagnostics'] = diagnostics?.toJson(); + if (inlineValue != null) { + __result['inlineValue'] = inlineValue?.toJson(); + } + if (semanticTokens != null) { + __result['semanticTokens'] = semanticTokens?.toJson(); + } + if (symbol != null) { + __result['symbol'] = symbol?.toJson(); + } + if (workspaceEdit != null) { + __result['workspaceEdit'] = workspaceEdit?.toJson(); + } + if (workspaceFolders != null) { + __result['workspaceFolders'] = workspaceFolders; } return __result; } @@ -2678,14 +2678,37 @@ class ClientCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } - reporter.push('workspaceEdit'); + reporter.push('codeLens'); try { - final workspaceEdit = obj['workspaceEdit']; - if (workspaceEdit != null && - !(WorkspaceEditClientCapabilities.canParse( - workspaceEdit, reporter))) { - reporter - .reportError('must be of type WorkspaceEditClientCapabilities'); + final codeLens = obj['codeLens']; + if (codeLens != null && + !(CodeLensWorkspaceClientCapabilities.canParse( + codeLens, reporter))) { + reporter.reportError( + 'must be of type CodeLensWorkspaceClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('configuration'); + try { + final configuration = obj['configuration']; + if (configuration != null && !(configuration is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('diagnostics'); + try { + final diagnostics = obj['diagnostics']; + if (diagnostics != null && + !(DiagnosticWorkspaceClientCapabilities.canParse( + diagnostics, reporter))) { + reporter.reportError( + 'must be of type DiagnosticWorkspaceClientCapabilities'); return false; } } finally { @@ -2717,18 +2740,6 @@ class ClientCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } - reporter.push('symbol'); - try { - final symbol = obj['symbol']; - if (symbol != null && - !(WorkspaceSymbolClientCapabilities.canParse(symbol, reporter))) { - reporter - .reportError('must be of type WorkspaceSymbolClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('executeCommand'); try { final executeCommand = obj['executeCommand']; @@ -2742,52 +2753,6 @@ class ClientCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } - reporter.push('workspaceFolders'); - try { - final workspaceFolders = obj['workspaceFolders']; - if (workspaceFolders != null && !(workspaceFolders is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('configuration'); - try { - final configuration = obj['configuration']; - if (configuration != null && !(configuration is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('semanticTokens'); - try { - final semanticTokens = obj['semanticTokens']; - if (semanticTokens != null && - !(SemanticTokensWorkspaceClientCapabilities.canParse( - semanticTokens, reporter))) { - reporter.reportError( - 'must be of type SemanticTokensWorkspaceClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('codeLens'); - try { - final codeLens = obj['codeLens']; - if (codeLens != null && - !(CodeLensWorkspaceClientCapabilities.canParse( - codeLens, reporter))) { - reporter.reportError( - 'must be of type CodeLensWorkspaceClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('fileOperations'); try { final fileOperations = obj['fileOperations']; @@ -2801,19 +2766,6 @@ class ClientCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } - reporter.push('inlineValue'); - try { - final inlineValue = obj['inlineValue']; - if (inlineValue != null && - !(InlineValueWorkspaceClientCapabilities.canParse( - inlineValue, reporter))) { - reporter.reportError( - 'must be of type InlineValueWorkspaceClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('inlayHint'); try { final inlayHint = obj['inlayHint']; @@ -2827,14 +2779,62 @@ class ClientCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } - reporter.push('diagnostics'); + reporter.push('inlineValue'); try { - final diagnostics = obj['diagnostics']; - if (diagnostics != null && - !(DiagnosticWorkspaceClientCapabilities.canParse( - diagnostics, reporter))) { + final inlineValue = obj['inlineValue']; + if (inlineValue != null && + !(InlineValueWorkspaceClientCapabilities.canParse( + inlineValue, reporter))) { reporter.reportError( - 'must be of type DiagnosticWorkspaceClientCapabilities'); + 'must be of type InlineValueWorkspaceClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('semanticTokens'); + try { + final semanticTokens = obj['semanticTokens']; + if (semanticTokens != null && + !(SemanticTokensWorkspaceClientCapabilities.canParse( + semanticTokens, reporter))) { + reporter.reportError( + 'must be of type SemanticTokensWorkspaceClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('symbol'); + try { + final symbol = obj['symbol']; + if (symbol != null && + !(WorkspaceSymbolClientCapabilities.canParse(symbol, reporter))) { + reporter + .reportError('must be of type WorkspaceSymbolClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('workspaceEdit'); + try { + final workspaceEdit = obj['workspaceEdit']; + if (workspaceEdit != null && + !(WorkspaceEditClientCapabilities.canParse( + workspaceEdit, reporter))) { + reporter + .reportError('must be of type WorkspaceEditClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('workspaceFolders'); + try { + final workspaceFolders = obj['workspaceFolders']; + if (workspaceFolders != null && !(workspaceFolders is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -2852,19 +2852,19 @@ class ClientCapabilitiesWorkspace implements ToJsonable { if (other is ClientCapabilitiesWorkspace && other.runtimeType == ClientCapabilitiesWorkspace) { return applyEdit == other.applyEdit && - workspaceEdit == other.workspaceEdit && + codeLens == other.codeLens && + configuration == other.configuration && + diagnostics == other.diagnostics && didChangeConfiguration == other.didChangeConfiguration && didChangeWatchedFiles == other.didChangeWatchedFiles && - symbol == other.symbol && executeCommand == other.executeCommand && - workspaceFolders == other.workspaceFolders && - configuration == other.configuration && - semanticTokens == other.semanticTokens && - codeLens == other.codeLens && fileOperations == other.fileOperations && - inlineValue == other.inlineValue && inlayHint == other.inlayHint && - diagnostics == other.diagnostics && + inlineValue == other.inlineValue && + semanticTokens == other.semanticTokens && + symbol == other.symbol && + workspaceEdit == other.workspaceEdit && + workspaceFolders == other.workspaceFolders && true; } return false; @@ -2873,19 +2873,19 @@ class ClientCapabilitiesWorkspace implements ToJsonable { @override int get hashCode => Object.hash( applyEdit, - workspaceEdit, + codeLens, + configuration, + diagnostics, didChangeConfiguration, didChangeWatchedFiles, - symbol, executeCommand, - workspaceFolders, - configuration, - semanticTokens, - codeLens, fileOperations, - inlineValue, inlayHint, - diagnostics, + inlineValue, + semanticTokens, + symbol, + workspaceEdit, + workspaceFolders, ); @override @@ -2904,27 +2904,26 @@ class CodeAction implements ToJsonable { ); CodeAction({ - required this.title, - this.kind, - this.diagnostics, - this.isPreferred, - this.disabled, - this.edit, this.command, this.data, + this.diagnostics, + this.disabled, + this.edit, + this.isPreferred, + this.kind, + required this.title, }); static CodeAction fromJson(Map json) { - final titleJson = json['title']; - final title = titleJson as String; - final kindJson = json['kind']; - final kind = - kindJson != null ? CodeActionKind.fromJson(kindJson as String) : null; + final commandJson = json['command']; + final command = commandJson != null + ? Command.fromJson(commandJson as Map) + : null; + final dataJson = json['data']; + final data = dataJson; final diagnosticsJson = json['diagnostics']; final diagnostics = (diagnosticsJson as List?) ?.map((item) => Diagnostic.fromJson(item as Map)) .toList(); - final isPreferredJson = json['isPreferred']; - final isPreferred = isPreferredJson as bool?; final disabledJson = json['disabled']; final disabled = disabledJson != null ? CodeActionDisabled.fromJson(disabledJson as Map) @@ -2933,21 +2932,22 @@ class CodeAction implements ToJsonable { final edit = editJson != null ? WorkspaceEdit.fromJson(editJson as Map) : null; - final commandJson = json['command']; - final command = commandJson != null - ? Command.fromJson(commandJson as Map) - : null; - final dataJson = json['data']; - final data = dataJson; + final isPreferredJson = json['isPreferred']; + final isPreferred = isPreferredJson as bool?; + final kindJson = json['kind']; + final kind = + kindJson != null ? CodeActionKind.fromJson(kindJson as String) : null; + final titleJson = json['title']; + final title = titleJson as String; return CodeAction( - title: title, - kind: kind, - diagnostics: diagnostics, - isPreferred: isPreferred, - disabled: disabled, - edit: edit, command: command, data: data, + diagnostics: diagnostics, + disabled: disabled, + edit: edit, + isPreferred: isPreferred, + kind: kind, + title: title, ); } @@ -3003,57 +3003,39 @@ class CodeAction implements ToJsonable { Map toJson() { var __result = {}; - __result['title'] = title; - if (kind != null) { - __result['kind'] = kind?.toJson(); + if (command != null) { + __result['command'] = command?.toJson(); + } + if (data != null) { + __result['data'] = data; } if (diagnostics != null) { __result['diagnostics'] = diagnostics?.map((item) => item.toJson()).toList(); } - if (isPreferred != null) { - __result['isPreferred'] = isPreferred; - } if (disabled != null) { __result['disabled'] = disabled?.toJson(); } if (edit != null) { __result['edit'] = edit?.toJson(); } - if (command != null) { - __result['command'] = command?.toJson(); + if (isPreferred != null) { + __result['isPreferred'] = isPreferred; } - if (data != null) { - __result['data'] = data; + if (kind != null) { + __result['kind'] = kind?.toJson(); } + __result['title'] = title; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('title'); + reporter.push('command'); try { - if (!obj.containsKey('title')) { - reporter.reportError('must not be undefined'); - return false; - } - final title = obj['title']; - if (title == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(title is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('kind'); - try { - final kind = obj['kind']; - if (kind != null && !(CodeActionKind.canParse(kind, reporter))) { - reporter.reportError('must be of type CodeActionKind'); + final command = obj['command']; + if (command != null && !(Command.canParse(command, reporter))) { + reporter.reportError('must be of type Command'); return false; } } finally { @@ -3072,16 +3054,6 @@ class CodeAction implements ToJsonable { } finally { reporter.pop(); } - reporter.push('isPreferred'); - try { - final isPreferred = obj['isPreferred']; - if (isPreferred != null && !(isPreferred is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('disabled'); try { final disabled = obj['disabled']; @@ -3103,11 +3075,39 @@ class CodeAction implements ToJsonable { } finally { reporter.pop(); } - reporter.push('command'); + reporter.push('isPreferred'); try { - final command = obj['command']; - if (command != null && !(Command.canParse(command, reporter))) { - reporter.reportError('must be of type Command'); + final isPreferred = obj['isPreferred']; + if (isPreferred != null && !(isPreferred is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('kind'); + try { + final kind = obj['kind']; + if (kind != null && !(CodeActionKind.canParse(kind, reporter))) { + reporter.reportError('must be of type CodeActionKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('title'); + try { + if (!obj.containsKey('title')) { + reporter.reportError('must not be undefined'); + return false; + } + final title = obj['title']; + if (title == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(title is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -3123,15 +3123,15 @@ class CodeAction implements ToJsonable { @override bool operator ==(Object other) { if (other is CodeAction && other.runtimeType == CodeAction) { - return title == other.title && - kind == other.kind && + return command == other.command && + data == other.data && listEqual(diagnostics, other.diagnostics, (Diagnostic a, Diagnostic b) => a == b) && - isPreferred == other.isPreferred && disabled == other.disabled && edit == other.edit && - command == other.command && - data == other.data && + isPreferred == other.isPreferred && + kind == other.kind && + title == other.title && true; } return false; @@ -3139,14 +3139,14 @@ class CodeAction implements ToJsonable { @override int get hashCode => Object.hash( - title, - kind, - lspHashCode(diagnostics), - isPreferred, - disabled, - edit, command, data, + lspHashCode(diagnostics), + disabled, + edit, + isPreferred, + kind, + title, ); @override @@ -3160,43 +3160,43 @@ class CodeActionClientCapabilities implements ToJsonable { ); CodeActionClientCapabilities({ - this.dynamicRegistration, this.codeActionLiteralSupport, - this.isPreferredSupport, - this.disabledSupport, this.dataSupport, - this.resolveSupport, + this.disabledSupport, + this.dynamicRegistration, this.honorsChangeAnnotations, + this.isPreferredSupport, + this.resolveSupport, }); static CodeActionClientCapabilities fromJson(Map json) { - final dynamicRegistrationJson = json['dynamicRegistration']; - final dynamicRegistration = dynamicRegistrationJson as bool?; final codeActionLiteralSupportJson = json['codeActionLiteralSupport']; final codeActionLiteralSupport = codeActionLiteralSupportJson != null ? CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson( codeActionLiteralSupportJson as Map) : null; - final isPreferredSupportJson = json['isPreferredSupport']; - final isPreferredSupport = isPreferredSupportJson as bool?; - final disabledSupportJson = json['disabledSupport']; - final disabledSupport = disabledSupportJson as bool?; final dataSupportJson = json['dataSupport']; final dataSupport = dataSupportJson as bool?; + final disabledSupportJson = json['disabledSupport']; + final disabledSupport = disabledSupportJson as bool?; + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; + final honorsChangeAnnotationsJson = json['honorsChangeAnnotations']; + final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?; + final isPreferredSupportJson = json['isPreferredSupport']; + final isPreferredSupport = isPreferredSupportJson as bool?; final resolveSupportJson = json['resolveSupport']; final resolveSupport = resolveSupportJson != null ? CodeActionClientCapabilitiesResolveSupport.fromJson( resolveSupportJson as Map) : null; - final honorsChangeAnnotationsJson = json['honorsChangeAnnotations']; - final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?; return CodeActionClientCapabilities( - dynamicRegistration: dynamicRegistration, codeActionLiteralSupport: codeActionLiteralSupport, - isPreferredSupport: isPreferredSupport, - disabledSupport: disabledSupport, dataSupport: dataSupport, - resolveSupport: resolveSupport, + disabledSupport: disabledSupport, + dynamicRegistration: dynamicRegistration, honorsChangeAnnotations: honorsChangeAnnotations, + isPreferredSupport: isPreferredSupport, + resolveSupport: resolveSupport, ); } @@ -3236,42 +3236,32 @@ class CodeActionClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (dynamicRegistration != null) { - __result['dynamicRegistration'] = dynamicRegistration; - } if (codeActionLiteralSupport != null) { __result['codeActionLiteralSupport'] = codeActionLiteralSupport?.toJson(); } - if (isPreferredSupport != null) { - __result['isPreferredSupport'] = isPreferredSupport; - } - if (disabledSupport != null) { - __result['disabledSupport'] = disabledSupport; - } if (dataSupport != null) { __result['dataSupport'] = dataSupport; } - if (resolveSupport != null) { - __result['resolveSupport'] = resolveSupport?.toJson(); + if (disabledSupport != null) { + __result['disabledSupport'] = disabledSupport; + } + if (dynamicRegistration != null) { + __result['dynamicRegistration'] = dynamicRegistration; } if (honorsChangeAnnotations != null) { __result['honorsChangeAnnotations'] = honorsChangeAnnotations; } + if (isPreferredSupport != null) { + __result['isPreferredSupport'] = isPreferredSupport; + } + if (resolveSupport != null) { + __result['resolveSupport'] = resolveSupport?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('dynamicRegistration'); - try { - final dynamicRegistration = obj['dynamicRegistration']; - if (dynamicRegistration != null && !(dynamicRegistration is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('codeActionLiteralSupport'); try { final codeActionLiteralSupport = obj['codeActionLiteralSupport']; @@ -3285,10 +3275,10 @@ class CodeActionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('isPreferredSupport'); + reporter.push('dataSupport'); try { - final isPreferredSupport = obj['isPreferredSupport']; - if (isPreferredSupport != null && !(isPreferredSupport is bool)) { + final dataSupport = obj['dataSupport']; + if (dataSupport != null && !(dataSupport is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -3305,10 +3295,31 @@ class CodeActionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('dataSupport'); + reporter.push('dynamicRegistration'); try { - final dataSupport = obj['dataSupport']; - if (dataSupport != null && !(dataSupport is bool)) { + final dynamicRegistration = obj['dynamicRegistration']; + if (dynamicRegistration != null && !(dynamicRegistration is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('honorsChangeAnnotations'); + try { + final honorsChangeAnnotations = obj['honorsChangeAnnotations']; + if (honorsChangeAnnotations != null && + !(honorsChangeAnnotations is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('isPreferredSupport'); + try { + final isPreferredSupport = obj['isPreferredSupport']; + if (isPreferredSupport != null && !(isPreferredSupport is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -3328,17 +3339,6 @@ class CodeActionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('honorsChangeAnnotations'); - try { - final honorsChangeAnnotations = obj['honorsChangeAnnotations']; - if (honorsChangeAnnotations != null && - !(honorsChangeAnnotations is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CodeActionClientCapabilities'); @@ -3350,13 +3350,13 @@ class CodeActionClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is CodeActionClientCapabilities && other.runtimeType == CodeActionClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && - codeActionLiteralSupport == other.codeActionLiteralSupport && - isPreferredSupport == other.isPreferredSupport && - disabledSupport == other.disabledSupport && + return codeActionLiteralSupport == other.codeActionLiteralSupport && dataSupport == other.dataSupport && - resolveSupport == other.resolveSupport && + disabledSupport == other.disabledSupport && + dynamicRegistration == other.dynamicRegistration && honorsChangeAnnotations == other.honorsChangeAnnotations && + isPreferredSupport == other.isPreferredSupport && + resolveSupport == other.resolveSupport && true; } return false; @@ -3364,13 +3364,13 @@ class CodeActionClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - dynamicRegistration, codeActionLiteralSupport, - isPreferredSupport, - disabledSupport, dataSupport, - resolveSupport, + disabledSupport, + dynamicRegistration, honorsChangeAnnotations, + isPreferredSupport, + resolveSupport, ); @override @@ -4029,29 +4029,16 @@ class CodeActionParams ); CodeActionParams({ - required this.textDocument, - required this.range, required this.context, - this.workDoneToken, this.partialResultToken, + required this.range, + required this.textDocument, + this.workDoneToken, }); static CodeActionParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final contextJson = json['context']; final context = CodeActionContext.fromJson(contextJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -4060,12 +4047,25 @@ class CodeActionParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return CodeActionParams( - textDocument: textDocument, - range: range, context: context, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + range: range, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -4087,33 +4087,44 @@ class CodeActionParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['range'] = range.toJson(); __result['context'] = context.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('context'); try { - if (!obj.containsKey('textDocument')) { + if (!obj.containsKey('context')) { reporter.reportError('must not be undefined'); return false; } - final textDocument = obj['textDocument']; - if (textDocument == null) { + final context = obj['context']; + if (context == null) { reporter.reportError('must not be null'); return false; } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + if (!(CodeActionContext.canParse(context, reporter))) { + reporter.reportError('must be of type CodeActionContext'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -4137,19 +4148,19 @@ class CodeActionParams } finally { reporter.pop(); } - reporter.push('context'); + reporter.push('textDocument'); try { - if (!obj.containsKey('context')) { + if (!obj.containsKey('textDocument')) { reporter.reportError('must not be undefined'); return false; } - final context = obj['context']; - if (context == null) { + final textDocument = obj['textDocument']; + if (textDocument == null) { reporter.reportError('must not be null'); return false; } - if (!(CodeActionContext.canParse(context, reporter))) { - reporter.reportError('must be of type CodeActionContext'); + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { @@ -4166,17 +4177,6 @@ class CodeActionParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CodeActionParams'); @@ -4187,11 +4187,11 @@ class CodeActionParams @override bool operator ==(Object other) { if (other is CodeActionParams && other.runtimeType == CodeActionParams) { - return textDocument == other.textDocument && - range == other.range && - context == other.context && - workDoneToken == other.workDoneToken && + return context == other.context && partialResultToken == other.partialResultToken && + range == other.range && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken && true; } return false; @@ -4199,11 +4199,11 @@ class CodeActionParams @override int get hashCode => Object.hash( - textDocument, - range, context, - workDoneToken, partialResultToken, + range, + textDocument, + workDoneToken, ); @override @@ -4218,27 +4218,27 @@ class CodeActionRegistrationOptions ); CodeActionRegistrationOptions({ - this.documentSelector, this.codeActionKinds, + this.documentSelector, this.resolveProvider, this.workDoneProgress, }); static CodeActionRegistrationOptions fromJson(Map json) { - final documentSelectorJson = json['documentSelector']; - final documentSelector = (documentSelectorJson as List?) - ?.map((item) => DocumentFilter.fromJson(item as Map)) - .toList(); final codeActionKindsJson = json['codeActionKinds']; final codeActionKinds = (codeActionKindsJson as List?) ?.map((item) => CodeActionKind.fromJson(item as String)) .toList(); + final documentSelectorJson = json['documentSelector']; + final documentSelector = (documentSelectorJson as List?) + ?.map((item) => DocumentFilter.fromJson(item as Map)) + .toList(); final resolveProviderJson = json['resolveProvider']; final resolveProvider = resolveProviderJson as bool?; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return CodeActionRegistrationOptions( - documentSelector: documentSelector, codeActionKinds: codeActionKinds, + documentSelector: documentSelector, resolveProvider: resolveProvider, workDoneProgress: workDoneProgress, ); @@ -4262,11 +4262,11 @@ class CodeActionRegistrationOptions Map toJson() { var __result = {}; - __result['documentSelector'] = documentSelector; if (codeActionKinds != null) { __result['codeActionKinds'] = codeActionKinds?.map((item) => item.toJson()).toList(); } + __result['documentSelector'] = documentSelector; if (resolveProvider != null) { __result['resolveProvider'] = resolveProvider; } @@ -4278,6 +4278,19 @@ class CodeActionRegistrationOptions static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('codeActionKinds'); + try { + final codeActionKinds = obj['codeActionKinds']; + if (codeActionKinds != null && + !((codeActionKinds is List && + (codeActionKinds.every( + (item) => CodeActionKind.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -4295,19 +4308,6 @@ class CodeActionRegistrationOptions } finally { reporter.pop(); } - reporter.push('codeActionKinds'); - try { - final codeActionKinds = obj['codeActionKinds']; - if (codeActionKinds != null && - !((codeActionKinds is List && - (codeActionKinds.every( - (item) => CodeActionKind.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('resolveProvider'); try { final resolveProvider = obj['resolveProvider']; @@ -4339,10 +4339,10 @@ class CodeActionRegistrationOptions bool operator ==(Object other) { if (other is CodeActionRegistrationOptions && other.runtimeType == CodeActionRegistrationOptions) { - return listEqual(documentSelector, other.documentSelector, - (DocumentFilter a, DocumentFilter b) => a == b) && - listEqual(codeActionKinds, other.codeActionKinds, + return listEqual(codeActionKinds, other.codeActionKinds, (CodeActionKind a, CodeActionKind b) => a == b) && + listEqual(documentSelector, other.documentSelector, + (DocumentFilter a, DocumentFilter b) => a == b) && resolveProvider == other.resolveProvider && workDoneProgress == other.workDoneProgress && true; @@ -4352,8 +4352,8 @@ class CodeActionRegistrationOptions @override int get hashCode => Object.hash( - lspHashCode(documentSelector), lspHashCode(codeActionKinds), + lspHashCode(documentSelector), resolveProvider, workDoneProgress, ); @@ -4478,23 +4478,23 @@ class CodeLens implements ToJsonable { ); CodeLens({ - required this.range, this.command, this.data, + required this.range, }); static CodeLens fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final commandJson = json['command']; final command = commandJson != null ? Command.fromJson(commandJson as Map) : null; final dataJson = json['data']; final data = dataJson; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return CodeLens( - range: range, command: command, data: data, + range: range, ); } @@ -4511,18 +4511,28 @@ class CodeLens implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); if (command != null) { __result['command'] = command?.toJson(); } if (data != null) { __result['data'] = data; } + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('command'); + try { + final command = obj['command']; + if (command != null && !(Command.canParse(command, reporter))) { + reporter.reportError('must be of type Command'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -4541,16 +4551,6 @@ class CodeLens implements ToJsonable { } finally { reporter.pop(); } - reporter.push('command'); - try { - final command = obj['command']; - if (command != null && !(Command.canParse(command, reporter))) { - reporter.reportError('must be of type Command'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CodeLens'); @@ -4561,9 +4561,9 @@ class CodeLens implements ToJsonable { @override bool operator ==(Object other) { if (other is CodeLens && other.runtimeType == CodeLens) { - return range == other.range && - command == other.command && + return command == other.command && data == other.data && + range == other.range && true; } return false; @@ -4571,9 +4571,9 @@ class CodeLens implements ToJsonable { @override int get hashCode => Object.hash( - range, command, data, + range, ); @override @@ -4739,11 +4739,19 @@ class CodeLensParams ); CodeLensParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static CodeLensParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -4755,18 +4763,10 @@ class CodeLensParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return CodeLensParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -4782,18 +4782,29 @@ class CodeLensParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -4823,17 +4834,6 @@ class CodeLensParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CodeLensParams'); @@ -4844,9 +4844,9 @@ class CodeLensParams @override bool operator ==(Object other) { if (other is CodeLensParams && other.runtimeType == CodeLensParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -4854,9 +4854,9 @@ class CodeLensParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -5060,25 +5060,25 @@ class Color implements ToJsonable { ); Color({ - required this.red, - required this.green, - required this.blue, required this.alpha, + required this.blue, + required this.green, + required this.red, }); static Color fromJson(Map json) { - final redJson = json['red']; - final red = redJson as num; - final greenJson = json['green']; - final green = greenJson as num; - final blueJson = json['blue']; - final blue = blueJson as num; final alphaJson = json['alpha']; final alpha = alphaJson as num; + final blueJson = json['blue']; + final blue = blueJson as num; + final greenJson = json['green']; + final green = greenJson as num; + final redJson = json['red']; + final red = redJson as num; return Color( - red: red, - green: green, - blue: blue, alpha: alpha, + blue: blue, + green: green, + red: red, ); } @@ -5096,45 +5096,27 @@ class Color implements ToJsonable { Map toJson() { var __result = {}; - __result['red'] = red; - __result['green'] = green; - __result['blue'] = blue; __result['alpha'] = alpha; + __result['blue'] = blue; + __result['green'] = green; + __result['red'] = red; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('red'); + reporter.push('alpha'); try { - if (!obj.containsKey('red')) { + if (!obj.containsKey('alpha')) { reporter.reportError('must not be undefined'); return false; } - final red = obj['red']; - if (red == null) { + final alpha = obj['alpha']; + if (alpha == null) { reporter.reportError('must not be null'); return false; } - if (!(red is num)) { - reporter.reportError('must be of type num'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('green'); - try { - if (!obj.containsKey('green')) { - reporter.reportError('must not be undefined'); - return false; - } - final green = obj['green']; - if (green == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(green is num)) { + if (!(alpha is num)) { reporter.reportError('must be of type num'); return false; } @@ -5159,18 +5141,36 @@ class Color implements ToJsonable { } finally { reporter.pop(); } - reporter.push('alpha'); + reporter.push('green'); try { - if (!obj.containsKey('alpha')) { + if (!obj.containsKey('green')) { reporter.reportError('must not be undefined'); return false; } - final alpha = obj['alpha']; - if (alpha == null) { + final green = obj['green']; + if (green == null) { reporter.reportError('must not be null'); return false; } - if (!(alpha is num)) { + if (!(green is num)) { + reporter.reportError('must be of type num'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('red'); + try { + if (!obj.containsKey('red')) { + reporter.reportError('must not be undefined'); + return false; + } + final red = obj['red']; + if (red == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(red is num)) { reporter.reportError('must be of type num'); return false; } @@ -5187,10 +5187,10 @@ class Color implements ToJsonable { @override bool operator ==(Object other) { if (other is Color && other.runtimeType == Color) { - return red == other.red && - green == other.green && + return alpha == other.alpha && blue == other.blue && - alpha == other.alpha && + green == other.green && + red == other.red && true; } return false; @@ -5198,10 +5198,10 @@ class Color implements ToJsonable { @override int get hashCode => Object.hash( - red, - green, - blue, alpha, + blue, + green, + red, ); @override @@ -5215,17 +5215,17 @@ class ColorInformation implements ToJsonable { ); ColorInformation({ - required this.range, required this.color, + required this.range, }); static ColorInformation fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final colorJson = json['color']; final color = Color.fromJson(colorJson as Map); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return ColorInformation( - range: range, color: color, + range: range, ); } @@ -5237,31 +5237,13 @@ class ColorInformation implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); __result['color'] = color.toJson(); + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('color'); try { if (!obj.containsKey('color')) { @@ -5280,6 +5262,24 @@ class ColorInformation implements ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ColorInformation'); @@ -5290,15 +5290,15 @@ class ColorInformation implements ToJsonable { @override bool operator ==(Object other) { if (other is ColorInformation && other.runtimeType == ColorInformation) { - return range == other.range && color == other.color && true; + return color == other.color && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, color, + range, ); @override @@ -5312,25 +5312,25 @@ class ColorPresentation implements ToJsonable { ); ColorPresentation({ + this.additionalTextEdits, required this.label, this.textEdit, - this.additionalTextEdits, }); static ColorPresentation fromJson(Map json) { + final additionalTextEditsJson = json['additionalTextEdits']; + final additionalTextEdits = (additionalTextEditsJson as List?) + ?.map((item) => TextEdit.fromJson(item as Map)) + .toList(); final labelJson = json['label']; final label = labelJson as String; final textEditJson = json['textEdit']; final textEdit = textEditJson != null ? TextEdit.fromJson(textEditJson as Map) : null; - final additionalTextEditsJson = json['additionalTextEdits']; - final additionalTextEdits = (additionalTextEditsJson as List?) - ?.map((item) => TextEdit.fromJson(item as Map)) - .toList(); return ColorPresentation( + additionalTextEdits: additionalTextEdits, label: label, textEdit: textEdit, - additionalTextEdits: additionalTextEdits, ); } @@ -5351,19 +5351,32 @@ class ColorPresentation implements ToJsonable { Map toJson() { var __result = {}; - __result['label'] = label; - if (textEdit != null) { - __result['textEdit'] = textEdit?.toJson(); - } if (additionalTextEdits != null) { __result['additionalTextEdits'] = additionalTextEdits?.map((item) => item.toJson()).toList(); } + __result['label'] = label; + if (textEdit != null) { + __result['textEdit'] = textEdit?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('additionalTextEdits'); + try { + final additionalTextEdits = obj['additionalTextEdits']; + if (additionalTextEdits != null && + !((additionalTextEdits is List && + (additionalTextEdits + .every((item) => TextEdit.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('label'); try { if (!obj.containsKey('label')) { @@ -5392,19 +5405,6 @@ class ColorPresentation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('additionalTextEdits'); - try { - final additionalTextEdits = obj['additionalTextEdits']; - if (additionalTextEdits != null && - !((additionalTextEdits is List && - (additionalTextEdits - .every((item) => TextEdit.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ColorPresentation'); @@ -5415,10 +5415,10 @@ class ColorPresentation implements ToJsonable { @override bool operator ==(Object other) { if (other is ColorPresentation && other.runtimeType == ColorPresentation) { - return label == other.label && - textEdit == other.textEdit && - listEqual(additionalTextEdits, other.additionalTextEdits, + return listEqual(additionalTextEdits, other.additionalTextEdits, (TextEdit a, TextEdit b) => a == b) && + label == other.label && + textEdit == other.textEdit && true; } return false; @@ -5426,9 +5426,9 @@ class ColorPresentation implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(additionalTextEdits), label, textEdit, - lspHashCode(additionalTextEdits), ); @override @@ -5443,28 +5443,15 @@ class ColorPresentationParams ); ColorPresentationParams({ - required this.textDocument, required this.color, - required this.range, - this.workDoneToken, this.partialResultToken, + required this.range, + required this.textDocument, + this.workDoneToken, }); static ColorPresentationParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); final colorJson = json['color']; final color = Color.fromJson(colorJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -5473,12 +5460,25 @@ class ColorPresentationParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return ColorPresentationParams( - textDocument: textDocument, color: color, - range: range, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + range: range, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -5500,38 +5500,20 @@ class ColorPresentationParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['color'] = color.toJson(); - __result['range'] = range.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('color'); try { if (!obj.containsKey('color')) { @@ -5550,6 +5532,17 @@ class ColorPresentationParams } finally { reporter.pop(); } + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -5568,22 +5561,29 @@ class ColorPresentationParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -5601,11 +5601,11 @@ class ColorPresentationParams bool operator ==(Object other) { if (other is ColorPresentationParams && other.runtimeType == ColorPresentationParams) { - return textDocument == other.textDocument && - color == other.color && - range == other.range && - workDoneToken == other.workDoneToken && + return color == other.color && partialResultToken == other.partialResultToken && + range == other.range && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken && true; } return false; @@ -5613,11 +5613,11 @@ class ColorPresentationParams @override int get hashCode => Object.hash( - textDocument, color, - range, - workDoneToken, partialResultToken, + range, + textDocument, + workDoneToken, ); @override @@ -5631,22 +5631,22 @@ class Command implements ToJsonable { ); Command({ - required this.title, - required this.command, this.arguments, + required this.command, + required this.title, }); static Command fromJson(Map json) { - final titleJson = json['title']; - final title = titleJson as String; - final commandJson = json['command']; - final command = commandJson as String; final argumentsJson = json['arguments']; final arguments = (argumentsJson as List?)?.map((item) => item).toList(); + final commandJson = json['command']; + final command = commandJson as String; + final titleJson = json['title']; + final title = titleJson as String; return Command( - title: title, - command: command, arguments: arguments, + command: command, + title: title, ); } @@ -5661,29 +5661,23 @@ class Command implements ToJsonable { Map toJson() { var __result = {}; - __result['title'] = title; - __result['command'] = command; if (arguments != null) { __result['arguments'] = arguments; } + __result['command'] = command; + __result['title'] = title; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('title'); + reporter.push('arguments'); try { - if (!obj.containsKey('title')) { - reporter.reportError('must not be undefined'); - return false; - } - final title = obj['title']; - if (title == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(title is String)) { - reporter.reportError('must be of type String'); + final arguments = obj['arguments']; + if (arguments != null && + !((arguments is List && + (arguments.every((item) => true))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -5707,13 +5701,19 @@ class Command implements ToJsonable { } finally { reporter.pop(); } - reporter.push('arguments'); + reporter.push('title'); try { - final arguments = obj['arguments']; - if (arguments != null && - !((arguments is List && - (arguments.every((item) => true))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('title')) { + reporter.reportError('must not be undefined'); + return false; + } + final title = obj['title']; + if (title == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(title is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -5729,10 +5729,10 @@ class Command implements ToJsonable { @override bool operator ==(Object other) { if (other is Command && other.runtimeType == Command) { - return title == other.title && - command == other.command && - listEqual( + return listEqual( arguments, other.arguments, (Object? a, Object? b) => a == b) && + command == other.command && + title == other.title && true; } return false; @@ -5740,9 +5740,9 @@ class Command implements ToJsonable { @override int get hashCode => Object.hash( - title, - command, lspHashCode(arguments), + command, + title, ); @override @@ -5756,16 +5756,14 @@ class CompletionClientCapabilities implements ToJsonable { ); CompletionClientCapabilities({ - this.dynamicRegistration, this.completionItem, this.completionItemKind, - this.contextSupport, - this.insertTextMode, this.completionList, + this.contextSupport, + this.dynamicRegistration, + this.insertTextMode, }); static CompletionClientCapabilities fromJson(Map json) { - final dynamicRegistrationJson = json['dynamicRegistration']; - final dynamicRegistration = dynamicRegistrationJson as bool?; final completionItemJson = json['completionItem']; final completionItem = completionItemJson != null ? CompletionClientCapabilitiesCompletionItem.fromJson( @@ -5776,24 +5774,26 @@ class CompletionClientCapabilities implements ToJsonable { ? CompletionClientCapabilitiesCompletionItemKind.fromJson( completionItemKindJson as Map) : null; - final contextSupportJson = json['contextSupport']; - final contextSupport = contextSupportJson as bool?; - final insertTextModeJson = json['insertTextMode']; - final insertTextMode = insertTextModeJson != null - ? InsertTextMode.fromJson(insertTextModeJson as int) - : null; final completionListJson = json['completionList']; final completionList = completionListJson != null ? CompletionClientCapabilitiesCompletionList.fromJson( completionListJson as Map) : null; + final contextSupportJson = json['contextSupport']; + final contextSupport = contextSupportJson as bool?; + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; + final insertTextModeJson = json['insertTextMode']; + final insertTextMode = insertTextModeJson != null + ? InsertTextMode.fromJson(insertTextModeJson as int) + : null; return CompletionClientCapabilities( - dynamicRegistration: dynamicRegistration, completionItem: completionItem, completionItemKind: completionItemKind, - contextSupport: contextSupport, - insertTextMode: insertTextMode, completionList: completionList, + contextSupport: contextSupport, + dynamicRegistration: dynamicRegistration, + insertTextMode: insertTextMode, ); } @@ -5819,39 +5819,29 @@ class CompletionClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (dynamicRegistration != null) { - __result['dynamicRegistration'] = dynamicRegistration; - } if (completionItem != null) { __result['completionItem'] = completionItem?.toJson(); } if (completionItemKind != null) { __result['completionItemKind'] = completionItemKind?.toJson(); } + if (completionList != null) { + __result['completionList'] = completionList?.toJson(); + } if (contextSupport != null) { __result['contextSupport'] = contextSupport; } + if (dynamicRegistration != null) { + __result['dynamicRegistration'] = dynamicRegistration; + } if (insertTextMode != null) { __result['insertTextMode'] = insertTextMode?.toJson(); } - if (completionList != null) { - __result['completionList'] = completionList?.toJson(); - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('dynamicRegistration'); - try { - final dynamicRegistration = obj['dynamicRegistration']; - if (dynamicRegistration != null && !(dynamicRegistration is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('completionItem'); try { final completionItem = obj['completionItem']; @@ -5878,6 +5868,19 @@ class CompletionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('completionList'); + try { + final completionList = obj['completionList']; + if (completionList != null && + !(CompletionClientCapabilitiesCompletionList.canParse( + completionList, reporter))) { + reporter.reportError( + 'must be of type CompletionClientCapabilitiesCompletionList'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('contextSupport'); try { final contextSupport = obj['contextSupport']; @@ -5888,6 +5891,16 @@ class CompletionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('dynamicRegistration'); + try { + final dynamicRegistration = obj['dynamicRegistration']; + if (dynamicRegistration != null && !(dynamicRegistration is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('insertTextMode'); try { final insertTextMode = obj['insertTextMode']; @@ -5899,19 +5912,6 @@ class CompletionClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('completionList'); - try { - final completionList = obj['completionList']; - if (completionList != null && - !(CompletionClientCapabilitiesCompletionList.canParse( - completionList, reporter))) { - reporter.reportError( - 'must be of type CompletionClientCapabilitiesCompletionList'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CompletionClientCapabilities'); @@ -5923,12 +5923,12 @@ class CompletionClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is CompletionClientCapabilities && other.runtimeType == CompletionClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && - completionItem == other.completionItem && + return completionItem == other.completionItem && completionItemKind == other.completionItemKind && - contextSupport == other.contextSupport && - insertTextMode == other.insertTextMode && completionList == other.completionList && + contextSupport == other.contextSupport && + dynamicRegistration == other.dynamicRegistration && + insertTextMode == other.insertTextMode && true; } return false; @@ -5936,12 +5936,12 @@ class CompletionClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - dynamicRegistration, completionItem, completionItemKind, - contextSupport, - insertTextMode, completionList, + contextSupport, + dynamicRegistration, + insertTextMode, ); @override @@ -5955,43 +5955,29 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { ); CompletionClientCapabilitiesCompletionItem({ - this.snippetSupport, this.commitCharactersSupport, - this.documentationFormat, this.deprecatedSupport, - this.preselectSupport, - this.tagSupport, + this.documentationFormat, this.insertReplaceSupport, - this.resolveSupport, this.insertTextModeSupport, this.labelDetailsSupport, + this.preselectSupport, + this.resolveSupport, + this.snippetSupport, + this.tagSupport, }); static CompletionClientCapabilitiesCompletionItem fromJson( Map json) { - final snippetSupportJson = json['snippetSupport']; - final snippetSupport = snippetSupportJson as bool?; final commitCharactersSupportJson = json['commitCharactersSupport']; final commitCharactersSupport = commitCharactersSupportJson as bool?; + final deprecatedSupportJson = json['deprecatedSupport']; + final deprecatedSupport = deprecatedSupportJson as bool?; final documentationFormatJson = json['documentationFormat']; final documentationFormat = (documentationFormatJson as List?) ?.map((item) => MarkupKind.fromJson(item as String)) .toList(); - final deprecatedSupportJson = json['deprecatedSupport']; - final deprecatedSupport = deprecatedSupportJson as bool?; - final preselectSupportJson = json['preselectSupport']; - final preselectSupport = preselectSupportJson as bool?; - final tagSupportJson = json['tagSupport']; - final tagSupport = tagSupportJson != null - ? CompletionClientCapabilitiesTagSupport.fromJson( - tagSupportJson as Map) - : null; final insertReplaceSupportJson = json['insertReplaceSupport']; final insertReplaceSupport = insertReplaceSupportJson as bool?; - final resolveSupportJson = json['resolveSupport']; - final resolveSupport = resolveSupportJson != null - ? CompletionClientCapabilitiesResolveSupport.fromJson( - resolveSupportJson as Map) - : null; final insertTextModeSupportJson = json['insertTextModeSupport']; final insertTextModeSupport = insertTextModeSupportJson != null ? CompletionClientCapabilitiesInsertTextModeSupport.fromJson( @@ -5999,17 +5985,31 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { : null; final labelDetailsSupportJson = json['labelDetailsSupport']; final labelDetailsSupport = labelDetailsSupportJson as bool?; + final preselectSupportJson = json['preselectSupport']; + final preselectSupport = preselectSupportJson as bool?; + final resolveSupportJson = json['resolveSupport']; + final resolveSupport = resolveSupportJson != null + ? CompletionClientCapabilitiesResolveSupport.fromJson( + resolveSupportJson as Map) + : null; + final snippetSupportJson = json['snippetSupport']; + final snippetSupport = snippetSupportJson as bool?; + final tagSupportJson = json['tagSupport']; + final tagSupport = tagSupportJson != null + ? CompletionClientCapabilitiesTagSupport.fromJson( + tagSupportJson as Map) + : null; return CompletionClientCapabilitiesCompletionItem( - snippetSupport: snippetSupport, commitCharactersSupport: commitCharactersSupport, - documentationFormat: documentationFormat, deprecatedSupport: deprecatedSupport, - preselectSupport: preselectSupport, - tagSupport: tagSupport, + documentationFormat: documentationFormat, insertReplaceSupport: insertReplaceSupport, - resolveSupport: resolveSupport, insertTextModeSupport: insertTextModeSupport, labelDetailsSupport: labelDetailsSupport, + preselectSupport: preselectSupport, + resolveSupport: resolveSupport, + snippetSupport: snippetSupport, + tagSupport: tagSupport, ); } @@ -6066,57 +6066,57 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { Map toJson() { var __result = {}; - if (snippetSupport != null) { - __result['snippetSupport'] = snippetSupport; - } if (commitCharactersSupport != null) { __result['commitCharactersSupport'] = commitCharactersSupport; } + if (deprecatedSupport != null) { + __result['deprecatedSupport'] = deprecatedSupport; + } if (documentationFormat != null) { __result['documentationFormat'] = documentationFormat?.map((item) => item.toJson()).toList(); } - if (deprecatedSupport != null) { - __result['deprecatedSupport'] = deprecatedSupport; - } - if (preselectSupport != null) { - __result['preselectSupport'] = preselectSupport; - } - if (tagSupport != null) { - __result['tagSupport'] = tagSupport?.toJson(); - } if (insertReplaceSupport != null) { __result['insertReplaceSupport'] = insertReplaceSupport; } - if (resolveSupport != null) { - __result['resolveSupport'] = resolveSupport?.toJson(); - } if (insertTextModeSupport != null) { __result['insertTextModeSupport'] = insertTextModeSupport?.toJson(); } if (labelDetailsSupport != null) { __result['labelDetailsSupport'] = labelDetailsSupport; } + if (preselectSupport != null) { + __result['preselectSupport'] = preselectSupport; + } + if (resolveSupport != null) { + __result['resolveSupport'] = resolveSupport?.toJson(); + } + if (snippetSupport != null) { + __result['snippetSupport'] = snippetSupport; + } + if (tagSupport != null) { + __result['tagSupport'] = tagSupport?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('snippetSupport'); + reporter.push('commitCharactersSupport'); try { - final snippetSupport = obj['snippetSupport']; - if (snippetSupport != null && !(snippetSupport is bool)) { + final commitCharactersSupport = obj['commitCharactersSupport']; + if (commitCharactersSupport != null && + !(commitCharactersSupport is bool)) { reporter.reportError('must be of type bool'); return false; } } finally { reporter.pop(); } - reporter.push('commitCharactersSupport'); + reporter.push('deprecatedSupport'); try { - final commitCharactersSupport = obj['commitCharactersSupport']; - if (commitCharactersSupport != null && - !(commitCharactersSupport is bool)) { + final deprecatedSupport = obj['deprecatedSupport']; + if (deprecatedSupport != null && !(deprecatedSupport is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -6136,39 +6136,6 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('deprecatedSupport'); - try { - final deprecatedSupport = obj['deprecatedSupport']; - if (deprecatedSupport != null && !(deprecatedSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('preselectSupport'); - try { - final preselectSupport = obj['preselectSupport']; - if (preselectSupport != null && !(preselectSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('tagSupport'); - try { - final tagSupport = obj['tagSupport']; - if (tagSupport != null && - !(CompletionClientCapabilitiesTagSupport.canParse( - tagSupport, reporter))) { - reporter.reportError( - 'must be of type CompletionClientCapabilitiesTagSupport'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('insertReplaceSupport'); try { final insertReplaceSupport = obj['insertReplaceSupport']; @@ -6179,19 +6146,6 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('resolveSupport'); - try { - final resolveSupport = obj['resolveSupport']; - if (resolveSupport != null && - !(CompletionClientCapabilitiesResolveSupport.canParse( - resolveSupport, reporter))) { - reporter.reportError( - 'must be of type CompletionClientCapabilitiesResolveSupport'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('insertTextModeSupport'); try { final insertTextModeSupport = obj['insertTextModeSupport']; @@ -6215,6 +6169,52 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { } finally { reporter.pop(); } + reporter.push('preselectSupport'); + try { + final preselectSupport = obj['preselectSupport']; + if (preselectSupport != null && !(preselectSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('resolveSupport'); + try { + final resolveSupport = obj['resolveSupport']; + if (resolveSupport != null && + !(CompletionClientCapabilitiesResolveSupport.canParse( + resolveSupport, reporter))) { + reporter.reportError( + 'must be of type CompletionClientCapabilitiesResolveSupport'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('snippetSupport'); + try { + final snippetSupport = obj['snippetSupport']; + if (snippetSupport != null && !(snippetSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('tagSupport'); + try { + final tagSupport = obj['tagSupport']; + if (tagSupport != null && + !(CompletionClientCapabilitiesTagSupport.canParse( + tagSupport, reporter))) { + reporter.reportError( + 'must be of type CompletionClientCapabilitiesTagSupport'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -6227,17 +6227,17 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { bool operator ==(Object other) { if (other is CompletionClientCapabilitiesCompletionItem && other.runtimeType == CompletionClientCapabilitiesCompletionItem) { - return snippetSupport == other.snippetSupport && - commitCharactersSupport == other.commitCharactersSupport && + return commitCharactersSupport == other.commitCharactersSupport && + deprecatedSupport == other.deprecatedSupport && listEqual(documentationFormat, other.documentationFormat, (MarkupKind a, MarkupKind b) => a == b) && - deprecatedSupport == other.deprecatedSupport && - preselectSupport == other.preselectSupport && - tagSupport == other.tagSupport && insertReplaceSupport == other.insertReplaceSupport && - resolveSupport == other.resolveSupport && insertTextModeSupport == other.insertTextModeSupport && labelDetailsSupport == other.labelDetailsSupport && + preselectSupport == other.preselectSupport && + resolveSupport == other.resolveSupport && + snippetSupport == other.snippetSupport && + tagSupport == other.tagSupport && true; } return false; @@ -6245,16 +6245,16 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { @override int get hashCode => Object.hash( - snippetSupport, commitCharactersSupport, - lspHashCode(documentationFormat), deprecatedSupport, - preselectSupport, - tagSupport, + lspHashCode(documentationFormat), insertReplaceSupport, - resolveSupport, insertTextModeSupport, labelDetailsSupport, + preselectSupport, + resolveSupport, + snippetSupport, + tagSupport, ); @override @@ -6654,17 +6654,17 @@ class CompletionContext implements ToJsonable { ); CompletionContext({ - required this.triggerKind, this.triggerCharacter, + required this.triggerKind, }); static CompletionContext fromJson(Map json) { - final triggerKindJson = json['triggerKind']; - final triggerKind = CompletionTriggerKind.fromJson(triggerKindJson as int); final triggerCharacterJson = json['triggerCharacter']; final triggerCharacter = triggerCharacterJson as String?; + final triggerKindJson = json['triggerKind']; + final triggerKind = CompletionTriggerKind.fromJson(triggerKindJson as int); return CompletionContext( - triggerKind: triggerKind, triggerCharacter: triggerCharacter, + triggerKind: triggerKind, ); } @@ -6677,15 +6677,25 @@ class CompletionContext implements ToJsonable { Map toJson() { var __result = {}; - __result['triggerKind'] = triggerKind.toJson(); if (triggerCharacter != null) { __result['triggerCharacter'] = triggerCharacter; } + __result['triggerKind'] = triggerKind.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('triggerCharacter'); + try { + final triggerCharacter = obj['triggerCharacter']; + if (triggerCharacter != null && !(triggerCharacter is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('triggerKind'); try { if (!obj.containsKey('triggerKind')) { @@ -6704,16 +6714,6 @@ class CompletionContext implements ToJsonable { } finally { reporter.pop(); } - reporter.push('triggerCharacter'); - try { - final triggerCharacter = obj['triggerCharacter']; - if (triggerCharacter != null && !(triggerCharacter is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CompletionContext'); @@ -6724,8 +6724,8 @@ class CompletionContext implements ToJsonable { @override bool operator ==(Object other) { if (other is CompletionContext && other.runtimeType == CompletionContext) { - return triggerKind == other.triggerKind && - triggerCharacter == other.triggerCharacter && + return triggerCharacter == other.triggerCharacter && + triggerKind == other.triggerKind && true; } return false; @@ -6733,8 +6733,8 @@ class CompletionContext implements ToJsonable { @override int get hashCode => Object.hash( - triggerKind, triggerCharacter, + triggerKind, ); @override @@ -6748,41 +6748,46 @@ class CompletionItem implements ToJsonable { ); CompletionItem({ - required this.label, - this.labelDetails, - this.kind, - this.tags, + this.additionalTextEdits, + this.command, + this.commitCharacters, + this.data, + this.deprecated, this.detail, this.documentation, - this.deprecated, - this.preselect, - this.sortText, this.filterText, this.insertText, this.insertTextFormat, this.insertTextMode, + this.kind, + required this.label, + this.labelDetails, + this.preselect, + this.sortText, + this.tags, this.textEdit, this.textEditText, - this.additionalTextEdits, - this.commitCharacters, - this.command, - this.data, }); static CompletionItem fromJson(Map json) { - final labelJson = json['label']; - final label = labelJson as String; - final labelDetailsJson = json['labelDetails']; - final labelDetails = labelDetailsJson != null - ? CompletionItemLabelDetails.fromJson( - labelDetailsJson as Map) - : null; - final kindJson = json['kind']; - final kind = - kindJson != null ? CompletionItemKind.fromJson(kindJson as int) : null; - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => CompletionItemTag.fromJson(item as int)) + final additionalTextEditsJson = json['additionalTextEdits']; + final additionalTextEdits = (additionalTextEditsJson as List?) + ?.map((item) => TextEdit.fromJson(item as Map)) .toList(); + final commandJson = json['command']; + final command = commandJson != null + ? Command.fromJson(commandJson as Map) + : null; + final commitCharactersJson = json['commitCharacters']; + final commitCharacters = (commitCharactersJson as List?) + ?.map((item) => item as String) + .toList(); + final dataJson = json['data']; + final data = dataJson != null + ? CompletionItemResolutionInfo.fromJson( + dataJson as Map) + : null; + final deprecatedJson = json['deprecated']; + final deprecated = deprecatedJson as bool?; final detailJson = json['detail']; final detail = detailJson as String?; final documentationJson = json['documentation']; @@ -6794,12 +6799,6 @@ class CompletionItem implements ToJsonable { : (documentationJson is String ? Either2.t2(documentationJson) : (throw '''$documentationJson was not one of (MarkupContent, String)'''))); - final deprecatedJson = json['deprecated']; - final deprecated = deprecatedJson as bool?; - final preselectJson = json['preselect']; - final preselect = preselectJson as bool?; - final sortTextJson = json['sortText']; - final sortText = sortTextJson as String?; final filterTextJson = json['filterText']; final filterText = filterTextJson as String?; final insertTextJson = json['insertText']; @@ -6812,6 +6811,24 @@ class CompletionItem implements ToJsonable { final insertTextMode = insertTextModeJson != null ? InsertTextMode.fromJson(insertTextModeJson as int) : null; + final kindJson = json['kind']; + final kind = + kindJson != null ? CompletionItemKind.fromJson(kindJson as int) : null; + final labelJson = json['label']; + final label = labelJson as String; + final labelDetailsJson = json['labelDetails']; + final labelDetails = labelDetailsJson != null + ? CompletionItemLabelDetails.fromJson( + labelDetailsJson as Map) + : null; + final preselectJson = json['preselect']; + final preselect = preselectJson as bool?; + final sortTextJson = json['sortText']; + final sortText = sortTextJson as String?; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => CompletionItemTag.fromJson(item as int)) + .toList(); final textEditJson = json['textEdit']; final textEdit = textEditJson == null ? null @@ -6825,43 +6842,26 @@ class CompletionItem implements ToJsonable { : (throw '''$textEditJson was not one of (InsertReplaceEdit, TextEdit)'''))); final textEditTextJson = json['textEditText']; final textEditText = textEditTextJson as String?; - final additionalTextEditsJson = json['additionalTextEdits']; - final additionalTextEdits = (additionalTextEditsJson as List?) - ?.map((item) => TextEdit.fromJson(item as Map)) - .toList(); - final commitCharactersJson = json['commitCharacters']; - final commitCharacters = (commitCharactersJson as List?) - ?.map((item) => item as String) - .toList(); - final commandJson = json['command']; - final command = commandJson != null - ? Command.fromJson(commandJson as Map) - : null; - final dataJson = json['data']; - final data = dataJson != null - ? CompletionItemResolutionInfo.fromJson( - dataJson as Map) - : null; return CompletionItem( - label: label, - labelDetails: labelDetails, - kind: kind, - tags: tags, + additionalTextEdits: additionalTextEdits, + command: command, + commitCharacters: commitCharacters, + data: data, + deprecated: deprecated, detail: detail, documentation: documentation, - deprecated: deprecated, - preselect: preselect, - sortText: sortText, filterText: filterText, insertText: insertText, insertTextFormat: insertTextFormat, insertTextMode: insertTextMode, + kind: kind, + label: label, + labelDetails: labelDetails, + preselect: preselect, + sortText: sortText, + tags: tags, textEdit: textEdit, textEditText: textEditText, - additionalTextEdits: additionalTextEdits, - commitCharacters: commitCharacters, - command: command, - data: data, ); } @@ -7000,15 +7000,21 @@ class CompletionItem implements ToJsonable { Map toJson() { var __result = {}; - __result['label'] = label; - if (labelDetails != null) { - __result['labelDetails'] = labelDetails?.toJson(); + if (additionalTextEdits != null) { + __result['additionalTextEdits'] = + additionalTextEdits?.map((item) => item.toJson()).toList(); } - if (kind != null) { - __result['kind'] = kind?.toJson(); + if (command != null) { + __result['command'] = command?.toJson(); } - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); + if (commitCharacters != null) { + __result['commitCharacters'] = commitCharacters; + } + if (data != null) { + __result['data'] = data?.toJson(); + } + if (deprecated != null) { + __result['deprecated'] = deprecated; } if (detail != null) { __result['detail'] = detail; @@ -7016,15 +7022,6 @@ class CompletionItem implements ToJsonable { if (documentation != null) { __result['documentation'] = documentation; } - if (deprecated != null) { - __result['deprecated'] = deprecated; - } - if (preselect != null) { - __result['preselect'] = preselect; - } - if (sortText != null) { - __result['sortText'] = sortText; - } if (filterText != null) { __result['filterText'] = filterText; } @@ -7037,77 +7034,84 @@ class CompletionItem implements ToJsonable { if (insertTextMode != null) { __result['insertTextMode'] = insertTextMode?.toJson(); } + if (kind != null) { + __result['kind'] = kind?.toJson(); + } + __result['label'] = label; + if (labelDetails != null) { + __result['labelDetails'] = labelDetails?.toJson(); + } + if (preselect != null) { + __result['preselect'] = preselect; + } + if (sortText != null) { + __result['sortText'] = sortText; + } + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); + } if (textEdit != null) { __result['textEdit'] = textEdit; } if (textEditText != null) { __result['textEditText'] = textEditText; } - if (additionalTextEdits != null) { - __result['additionalTextEdits'] = - additionalTextEdits?.map((item) => item.toJson()).toList(); - } - if (commitCharacters != null) { - __result['commitCharacters'] = commitCharacters; - } - if (command != null) { - __result['command'] = command?.toJson(); - } - if (data != null) { - __result['data'] = data?.toJson(); - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('label'); + reporter.push('additionalTextEdits'); try { - if (!obj.containsKey('label')) { - reporter.reportError('must not be undefined'); - return false; - } - final label = obj['label']; - if (label == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(label is String)) { - reporter.reportError('must be of type String'); + final additionalTextEdits = obj['additionalTextEdits']; + if (additionalTextEdits != null && + !((additionalTextEdits is List && + (additionalTextEdits + .every((item) => TextEdit.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { reporter.pop(); } - reporter.push('labelDetails'); + reporter.push('command'); try { - final labelDetails = obj['labelDetails']; - if (labelDetails != null && - !(CompletionItemLabelDetails.canParse(labelDetails, reporter))) { - reporter.reportError('must be of type CompletionItemLabelDetails'); + final command = obj['command']; + if (command != null && !(Command.canParse(command, reporter))) { + reporter.reportError('must be of type Command'); return false; } } finally { reporter.pop(); } - reporter.push('kind'); + reporter.push('commitCharacters'); try { - final kind = obj['kind']; - if (kind != null && !(CompletionItemKind.canParse(kind, reporter))) { - reporter.reportError('must be of type CompletionItemKind'); + final commitCharacters = obj['commitCharacters']; + if (commitCharacters != null && + !((commitCharacters is List && + (commitCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); return false; } } finally { reporter.pop(); } - reporter.push('tags'); + reporter.push('data'); try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every( - (item) => CompletionItemTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + final data = obj['data']; + if (data != null && + !(CompletionItemResolutionInfo.canParse(data, reporter))) { + reporter.reportError('must be of type CompletionItemResolutionInfo'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('deprecated'); + try { + final deprecated = obj['deprecated']; + if (deprecated != null && !(deprecated is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -7136,36 +7140,6 @@ class CompletionItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('deprecated'); - try { - final deprecated = obj['deprecated']; - if (deprecated != null && !(deprecated is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('preselect'); - try { - final preselect = obj['preselect']; - if (preselect != null && !(preselect is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('sortText'); - try { - final sortText = obj['sortText']; - if (sortText != null && !(sortText is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('filterText'); try { final filterText = obj['filterText']; @@ -7208,6 +7182,78 @@ class CompletionItem implements ToJsonable { } finally { reporter.pop(); } + reporter.push('kind'); + try { + final kind = obj['kind']; + if (kind != null && !(CompletionItemKind.canParse(kind, reporter))) { + reporter.reportError('must be of type CompletionItemKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('label'); + try { + if (!obj.containsKey('label')) { + reporter.reportError('must not be undefined'); + return false; + } + final label = obj['label']; + if (label == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(label is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('labelDetails'); + try { + final labelDetails = obj['labelDetails']; + if (labelDetails != null && + !(CompletionItemLabelDetails.canParse(labelDetails, reporter))) { + reporter.reportError('must be of type CompletionItemLabelDetails'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('preselect'); + try { + final preselect = obj['preselect']; + if (preselect != null && !(preselect is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('sortText'); + try { + final sortText = obj['sortText']; + if (sortText != null && !(sortText is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every( + (item) => CompletionItemTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textEdit'); try { final textEdit = obj['textEdit']; @@ -7231,52 +7277,6 @@ class CompletionItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('additionalTextEdits'); - try { - final additionalTextEdits = obj['additionalTextEdits']; - if (additionalTextEdits != null && - !((additionalTextEdits is List && - (additionalTextEdits - .every((item) => TextEdit.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('commitCharacters'); - try { - final commitCharacters = obj['commitCharacters']; - if (commitCharacters != null && - !((commitCharacters is List && - (commitCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('command'); - try { - final command = obj['command']; - if (command != null && !(Command.canParse(command, reporter))) { - reporter.reportError('must be of type Command'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('data'); - try { - final data = obj['data']; - if (data != null && - !(CompletionItemResolutionInfo.canParse(data, reporter))) { - reporter.reportError('must be of type CompletionItemResolutionInfo'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CompletionItem'); @@ -7287,28 +7287,28 @@ class CompletionItem implements ToJsonable { @override bool operator ==(Object other) { if (other is CompletionItem && other.runtimeType == CompletionItem) { - return label == other.label && - labelDetails == other.labelDetails && - kind == other.kind && - listEqual(tags, other.tags, - (CompletionItemTag a, CompletionItemTag b) => a == b) && + return listEqual(additionalTextEdits, other.additionalTextEdits, + (TextEdit a, TextEdit b) => a == b) && + command == other.command && + listEqual(commitCharacters, other.commitCharacters, + (String a, String b) => a == b) && + data == other.data && + deprecated == other.deprecated && detail == other.detail && documentation == other.documentation && - deprecated == other.deprecated && - preselect == other.preselect && - sortText == other.sortText && filterText == other.filterText && insertText == other.insertText && insertTextFormat == other.insertTextFormat && insertTextMode == other.insertTextMode && + kind == other.kind && + label == other.label && + labelDetails == other.labelDetails && + preselect == other.preselect && + sortText == other.sortText && + listEqual(tags, other.tags, + (CompletionItemTag a, CompletionItemTag b) => a == b) && textEdit == other.textEdit && textEditText == other.textEditText && - listEqual(additionalTextEdits, other.additionalTextEdits, - (TextEdit a, TextEdit b) => a == b) && - listEqual(commitCharacters, other.commitCharacters, - (String a, String b) => a == b) && - command == other.command && - data == other.data && true; } return false; @@ -7316,25 +7316,25 @@ class CompletionItem implements ToJsonable { @override int get hashCode => Object.hash( - label, - labelDetails, - kind, - lspHashCode(tags), + lspHashCode(additionalTextEdits), + command, + lspHashCode(commitCharacters), + data, + deprecated, detail, documentation, - deprecated, - preselect, - sortText, filterText, insertText, insertTextFormat, insertTextMode, + kind, + label, + labelDetails, + preselect, + sortText, + lspHashCode(tags), textEdit, textEditText, - lspHashCode(additionalTextEdits), - lspHashCode(commitCharacters), - command, - data, ); @override @@ -7398,17 +7398,17 @@ class CompletionItemLabelDetails implements ToJsonable { ); CompletionItemLabelDetails({ - this.detail, this.description, + this.detail, }); static CompletionItemLabelDetails fromJson(Map json) { - final detailJson = json['detail']; - final detail = detailJson as String?; final descriptionJson = json['description']; final description = descriptionJson as String?; + final detailJson = json['detail']; + final detail = detailJson as String?; return CompletionItemLabelDetails( - detail: detail, description: description, + detail: detail, ); } @@ -7424,31 +7424,31 @@ class CompletionItemLabelDetails implements ToJsonable { Map toJson() { var __result = {}; - if (detail != null) { - __result['detail'] = detail; - } if (description != null) { __result['description'] = description; } + if (detail != null) { + __result['detail'] = detail; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('detail'); + reporter.push('description'); try { - final detail = obj['detail']; - if (detail != null && !(detail is String)) { + final description = obj['description']; + if (description != null && !(description is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } - reporter.push('description'); + reporter.push('detail'); try { - final description = obj['description']; - if (description != null && !(description is String)) { + final detail = obj['detail']; + if (detail != null && !(detail is String)) { reporter.reportError('must be of type String'); return false; } @@ -7466,15 +7466,15 @@ class CompletionItemLabelDetails implements ToJsonable { bool operator ==(Object other) { if (other is CompletionItemLabelDetails && other.runtimeType == CompletionItemLabelDetails) { - return detail == other.detail && description == other.description && true; + return description == other.description && detail == other.detail && true; } return false; } @override int get hashCode => Object.hash( - detail, description, + detail, ); @override @@ -7916,38 +7916,38 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { ); CompletionOptions({ - this.triggerCharacters, this.allCommitCharacters, - this.resolveProvider, this.completionItem, + this.resolveProvider, + this.triggerCharacters, this.workDoneProgress, }); static CompletionOptions fromJson(Map json) { if (CompletionRegistrationOptions.canParse(json, nullLspJsonReporter)) { return CompletionRegistrationOptions.fromJson(json); } - final triggerCharactersJson = json['triggerCharacters']; - final triggerCharacters = (triggerCharactersJson as List?) - ?.map((item) => item as String) - .toList(); final allCommitCharactersJson = json['allCommitCharacters']; final allCommitCharacters = (allCommitCharactersJson as List?) ?.map((item) => item as String) .toList(); - final resolveProviderJson = json['resolveProvider']; - final resolveProvider = resolveProviderJson as bool?; final completionItemJson = json['completionItem']; final completionItem = completionItemJson != null ? CompletionOptionsCompletionItem.fromJson( completionItemJson as Map) : null; + final resolveProviderJson = json['resolveProvider']; + final resolveProvider = resolveProviderJson as bool?; + final triggerCharactersJson = json['triggerCharacters']; + final triggerCharacters = (triggerCharactersJson as List?) + ?.map((item) => item as String) + .toList(); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return CompletionOptions( - triggerCharacters: triggerCharacters, allCommitCharacters: allCommitCharacters, - resolveProvider: resolveProvider, completionItem: completionItem, + resolveProvider: resolveProvider, + triggerCharacters: triggerCharacters, workDoneProgress: workDoneProgress, ); } @@ -7985,17 +7985,17 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { Map toJson() { var __result = {}; - if (triggerCharacters != null) { - __result['triggerCharacters'] = triggerCharacters; - } if (allCommitCharacters != null) { __result['allCommitCharacters'] = allCommitCharacters; } + if (completionItem != null) { + __result['completionItem'] = completionItem?.toJson(); + } if (resolveProvider != null) { __result['resolveProvider'] = resolveProvider; } - if (completionItem != null) { - __result['completionItem'] = completionItem?.toJson(); + if (triggerCharacters != null) { + __result['triggerCharacters'] = triggerCharacters; } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; @@ -8005,18 +8005,6 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('triggerCharacters'); - try { - final triggerCharacters = obj['triggerCharacters']; - if (triggerCharacters != null && - !((triggerCharacters is List && - (triggerCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('allCommitCharacters'); try { final allCommitCharacters = obj['allCommitCharacters']; @@ -8029,6 +8017,19 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } + reporter.push('completionItem'); + try { + final completionItem = obj['completionItem']; + if (completionItem != null && + !(CompletionOptionsCompletionItem.canParse( + completionItem, reporter))) { + reporter + .reportError('must be of type CompletionOptionsCompletionItem'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('resolveProvider'); try { final resolveProvider = obj['resolveProvider']; @@ -8039,14 +8040,13 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } - reporter.push('completionItem'); + reporter.push('triggerCharacters'); try { - final completionItem = obj['completionItem']; - if (completionItem != null && - !(CompletionOptionsCompletionItem.canParse( - completionItem, reporter))) { - reporter - .reportError('must be of type CompletionOptionsCompletionItem'); + final triggerCharacters = obj['triggerCharacters']; + if (triggerCharacters != null && + !((triggerCharacters is List && + (triggerCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -8072,12 +8072,12 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { @override bool operator ==(Object other) { if (other is CompletionOptions && other.runtimeType == CompletionOptions) { - return listEqual(triggerCharacters, other.triggerCharacters, + return listEqual(allCommitCharacters, other.allCommitCharacters, (String a, String b) => a == b) && - listEqual(allCommitCharacters, other.allCommitCharacters, - (String a, String b) => a == b) && - resolveProvider == other.resolveProvider && completionItem == other.completionItem && + resolveProvider == other.resolveProvider && + listEqual(triggerCharacters, other.triggerCharacters, + (String a, String b) => a == b) && workDoneProgress == other.workDoneProgress && true; } @@ -8086,10 +8086,10 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { @override int get hashCode => Object.hash( - lspHashCode(triggerCharacters), lspHashCode(allCommitCharacters), - resolveProvider, completionItem, + resolveProvider, + lspHashCode(triggerCharacters), workDoneProgress, ); @@ -8176,29 +8176,16 @@ class CompletionParams CompletionParams({ this.context, - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static CompletionParams fromJson(Map json) { final contextJson = json['context']; final context = contextJson != null ? CompletionContext.fromJson(contextJson as Map) : null; - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -8207,12 +8194,25 @@ class CompletionParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return CompletionParams( context: context, - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -8238,14 +8238,14 @@ class CompletionParams if (context != null) { __result['context'] = context?.toJson(); } - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -8262,19 +8262,12 @@ class CompletionParams } finally { reporter.pop(); } - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -8298,22 +8291,29 @@ class CompletionParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -8331,10 +8331,10 @@ class CompletionParams bool operator ==(Object other) { if (other is CompletionParams && other.runtimeType == CompletionParams) { return context == other.context && - textDocument == other.textDocument && - position == other.position && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + position == other.position && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken && true; } return false; @@ -8343,10 +8343,10 @@ class CompletionParams @override int get hashCode => Object.hash( context, - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -8361,41 +8361,41 @@ class CompletionRegistrationOptions ); CompletionRegistrationOptions({ - this.documentSelector, - this.triggerCharacters, this.allCommitCharacters, - this.resolveProvider, this.completionItem, + this.documentSelector, + this.resolveProvider, + this.triggerCharacters, this.workDoneProgress, }); static CompletionRegistrationOptions fromJson(Map json) { - final documentSelectorJson = json['documentSelector']; - final documentSelector = (documentSelectorJson as List?) - ?.map((item) => DocumentFilter.fromJson(item as Map)) - .toList(); - final triggerCharactersJson = json['triggerCharacters']; - final triggerCharacters = (triggerCharactersJson as List?) - ?.map((item) => item as String) - .toList(); final allCommitCharactersJson = json['allCommitCharacters']; final allCommitCharacters = (allCommitCharactersJson as List?) ?.map((item) => item as String) .toList(); - final resolveProviderJson = json['resolveProvider']; - final resolveProvider = resolveProviderJson as bool?; final completionItemJson = json['completionItem']; final completionItem = completionItemJson != null ? CompletionOptionsCompletionItem.fromJson( completionItemJson as Map) : null; + final documentSelectorJson = json['documentSelector']; + final documentSelector = (documentSelectorJson as List?) + ?.map((item) => DocumentFilter.fromJson(item as Map)) + .toList(); + final resolveProviderJson = json['resolveProvider']; + final resolveProvider = resolveProviderJson as bool?; + final triggerCharactersJson = json['triggerCharacters']; + final triggerCharacters = (triggerCharactersJson as List?) + ?.map((item) => item as String) + .toList(); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return CompletionRegistrationOptions( - documentSelector: documentSelector, - triggerCharacters: triggerCharacters, allCommitCharacters: allCommitCharacters, - resolveProvider: resolveProvider, completionItem: completionItem, + documentSelector: documentSelector, + resolveProvider: resolveProvider, + triggerCharacters: triggerCharacters, workDoneProgress: workDoneProgress, ); } @@ -8437,18 +8437,18 @@ class CompletionRegistrationOptions Map toJson() { var __result = {}; - __result['documentSelector'] = documentSelector; - if (triggerCharacters != null) { - __result['triggerCharacters'] = triggerCharacters; - } if (allCommitCharacters != null) { __result['allCommitCharacters'] = allCommitCharacters; } + if (completionItem != null) { + __result['completionItem'] = completionItem?.toJson(); + } + __result['documentSelector'] = documentSelector; if (resolveProvider != null) { __result['resolveProvider'] = resolveProvider; } - if (completionItem != null) { - __result['completionItem'] = completionItem?.toJson(); + if (triggerCharacters != null) { + __result['triggerCharacters'] = triggerCharacters; } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; @@ -8458,6 +8458,31 @@ class CompletionRegistrationOptions static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('allCommitCharacters'); + try { + final allCommitCharacters = obj['allCommitCharacters']; + if (allCommitCharacters != null && + !((allCommitCharacters is List && + (allCommitCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('completionItem'); + try { + final completionItem = obj['completionItem']; + if (completionItem != null && + !(CompletionOptionsCompletionItem.canParse( + completionItem, reporter))) { + reporter + .reportError('must be of type CompletionOptionsCompletionItem'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -8475,30 +8500,6 @@ class CompletionRegistrationOptions } finally { reporter.pop(); } - reporter.push('triggerCharacters'); - try { - final triggerCharacters = obj['triggerCharacters']; - if (triggerCharacters != null && - !((triggerCharacters is List && - (triggerCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('allCommitCharacters'); - try { - final allCommitCharacters = obj['allCommitCharacters']; - if (allCommitCharacters != null && - !((allCommitCharacters is List && - (allCommitCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('resolveProvider'); try { final resolveProvider = obj['resolveProvider']; @@ -8509,14 +8510,13 @@ class CompletionRegistrationOptions } finally { reporter.pop(); } - reporter.push('completionItem'); + reporter.push('triggerCharacters'); try { - final completionItem = obj['completionItem']; - if (completionItem != null && - !(CompletionOptionsCompletionItem.canParse( - completionItem, reporter))) { - reporter - .reportError('must be of type CompletionOptionsCompletionItem'); + final triggerCharacters = obj['triggerCharacters']; + if (triggerCharacters != null && + !((triggerCharacters is List && + (triggerCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -8543,14 +8543,14 @@ class CompletionRegistrationOptions bool operator ==(Object other) { if (other is CompletionRegistrationOptions && other.runtimeType == CompletionRegistrationOptions) { - return listEqual(documentSelector, other.documentSelector, + return listEqual(allCommitCharacters, other.allCommitCharacters, + (String a, String b) => a == b) && + completionItem == other.completionItem && + listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && + resolveProvider == other.resolveProvider && listEqual(triggerCharacters, other.triggerCharacters, (String a, String b) => a == b) && - listEqual(allCommitCharacters, other.allCommitCharacters, - (String a, String b) => a == b) && - resolveProvider == other.resolveProvider && - completionItem == other.completionItem && workDoneProgress == other.workDoneProgress && true; } @@ -8559,11 +8559,11 @@ class CompletionRegistrationOptions @override int get hashCode => Object.hash( - lspHashCode(documentSelector), - lspHashCode(triggerCharacters), lspHashCode(allCommitCharacters), - resolveProvider, completionItem, + lspHashCode(documentSelector), + resolveProvider, + lspHashCode(triggerCharacters), workDoneProgress, ); @@ -8778,31 +8778,31 @@ class CreateFile implements ToJsonable { ); CreateFile({ - this.kind = 'create', - required this.uri, - this.options, this.annotationId, + this.kind = 'create', + this.options, + required this.uri, }) { if (kind != 'create') { throw 'kind may only be the literal \'create\''; } } static CreateFile fromJson(Map json) { + final annotationIdJson = json['annotationId']; + final annotationId = annotationIdJson as String?; final kindJson = json['kind']; final kind = kindJson as String; - final uriJson = json['uri']; - final uri = uriJson as String; final optionsJson = json['options']; final options = optionsJson != null ? CreateFileOptions.fromJson(optionsJson as Map) : null; - final annotationIdJson = json['annotationId']; - final annotationId = annotationIdJson as String?; + final uriJson = json['uri']; + final uri = uriJson as String; return CreateFile( - kind: kind, - uri: uri, - options: options, annotationId: annotationId, + kind: kind, + options: options, + uri: uri, ); } @@ -8821,19 +8821,29 @@ class CreateFile implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; - __result['uri'] = uri; - if (options != null) { - __result['options'] = options?.toJson(); - } if (annotationId != null) { __result['annotationId'] = annotationId; } + __result['kind'] = kind; + if (options != null) { + __result['options'] = options?.toJson(); + } + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('annotationId'); + try { + final annotationId = obj['annotationId']; + if (annotationId != null && !(annotationId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -8852,6 +8862,17 @@ class CreateFile implements ToJsonable { } finally { reporter.pop(); } + reporter.push('options'); + try { + final options = obj['options']; + if (options != null && + !(CreateFileOptions.canParse(options, reporter))) { + reporter.reportError('must be of type CreateFileOptions'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -8870,27 +8891,6 @@ class CreateFile implements ToJsonable { } finally { reporter.pop(); } - reporter.push('options'); - try { - final options = obj['options']; - if (options != null && - !(CreateFileOptions.canParse(options, reporter))) { - reporter.reportError('must be of type CreateFileOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('annotationId'); - try { - final annotationId = obj['annotationId']; - if (annotationId != null && !(annotationId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type CreateFile'); @@ -8901,10 +8901,10 @@ class CreateFile implements ToJsonable { @override bool operator ==(Object other) { if (other is CreateFile && other.runtimeType == CreateFile) { - return kind == other.kind && - uri == other.uri && + return annotationId == other.annotationId && + kind == other.kind && options == other.options && - annotationId == other.annotationId && + uri == other.uri && true; } return false; @@ -8912,10 +8912,10 @@ class CreateFile implements ToJsonable { @override int get hashCode => Object.hash( - kind, - uri, - options, annotationId, + kind, + options, + uri, ); @override @@ -8930,17 +8930,17 @@ class CreateFileOptions implements ToJsonable { ); CreateFileOptions({ - this.overwrite, this.ignoreIfExists, + this.overwrite, }); static CreateFileOptions fromJson(Map json) { - final overwriteJson = json['overwrite']; - final overwrite = overwriteJson as bool?; final ignoreIfExistsJson = json['ignoreIfExists']; final ignoreIfExists = ignoreIfExistsJson as bool?; + final overwriteJson = json['overwrite']; + final overwrite = overwriteJson as bool?; return CreateFileOptions( - overwrite: overwrite, ignoreIfExists: ignoreIfExists, + overwrite: overwrite, ); } @@ -8952,31 +8952,31 @@ class CreateFileOptions implements ToJsonable { Map toJson() { var __result = {}; - if (overwrite != null) { - __result['overwrite'] = overwrite; - } if (ignoreIfExists != null) { __result['ignoreIfExists'] = ignoreIfExists; } + if (overwrite != null) { + __result['overwrite'] = overwrite; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('overwrite'); + reporter.push('ignoreIfExists'); try { - final overwrite = obj['overwrite']; - if (overwrite != null && !(overwrite is bool)) { + final ignoreIfExists = obj['ignoreIfExists']; + if (ignoreIfExists != null && !(ignoreIfExists is bool)) { reporter.reportError('must be of type bool'); return false; } } finally { reporter.pop(); } - reporter.push('ignoreIfExists'); + reporter.push('overwrite'); try { - final ignoreIfExists = obj['ignoreIfExists']; - if (ignoreIfExists != null && !(ignoreIfExists is bool)) { + final overwrite = obj['overwrite']; + if (overwrite != null && !(overwrite is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -8993,8 +8993,8 @@ class CreateFileOptions implements ToJsonable { @override bool operator ==(Object other) { if (other is CreateFileOptions && other.runtimeType == CreateFileOptions) { - return overwrite == other.overwrite && - ignoreIfExists == other.ignoreIfExists && + return ignoreIfExists == other.ignoreIfExists && + overwrite == other.overwrite && true; } return false; @@ -9002,8 +9002,8 @@ class CreateFileOptions implements ToJsonable { @override int get hashCode => Object.hash( - overwrite, ignoreIfExists, + overwrite, ); @override @@ -9253,25 +9253,12 @@ class DeclarationParams ); DeclarationParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static DeclarationParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -9280,11 +9267,24 @@ class DeclarationParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DeclarationParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -9303,32 +9303,25 @@ class DeclarationParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -9352,22 +9345,29 @@ class DeclarationParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -9384,10 +9384,10 @@ class DeclarationParams @override bool operator ==(Object other) { if (other is DeclarationParams && other.runtimeType == DeclarationParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -9395,10 +9395,10 @@ class DeclarationParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -9417,23 +9417,23 @@ class DeclarationRegistrationOptions ); DeclarationRegistrationOptions({ - this.workDoneProgress, this.documentSelector, this.id, + this.workDoneProgress, }); static DeclarationRegistrationOptions fromJson(Map json) { - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return DeclarationRegistrationOptions( - workDoneProgress: workDoneProgress, documentSelector: documentSelector, id: id, + workDoneProgress: workDoneProgress, ); } @@ -9448,28 +9448,18 @@ class DeclarationRegistrationOptions Map toJson() { var __result = {}; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } __result['documentSelector'] = documentSelector; if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -9497,6 +9487,16 @@ class DeclarationRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type DeclarationRegistrationOptions'); @@ -9508,10 +9508,10 @@ class DeclarationRegistrationOptions bool operator ==(Object other) { if (other is DeclarationRegistrationOptions && other.runtimeType == DeclarationRegistrationOptions) { - return workDoneProgress == other.workDoneProgress && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -9519,9 +9519,9 @@ class DeclarationRegistrationOptions @override int get hashCode => Object.hash( - workDoneProgress, lspHashCode(documentSelector), id, + workDoneProgress, ); @override @@ -9693,25 +9693,12 @@ class DefinitionParams ); DefinitionParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static DefinitionParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -9720,11 +9707,24 @@ class DefinitionParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DefinitionParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -9743,32 +9743,25 @@ class DefinitionParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -9792,22 +9785,29 @@ class DefinitionParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -9824,10 +9824,10 @@ class DefinitionParams @override bool operator ==(Object other) { if (other is DefinitionParams && other.runtimeType == DefinitionParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -9835,10 +9835,10 @@ class DefinitionParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -9949,31 +9949,31 @@ class DeleteFile implements ToJsonable { ); DeleteFile({ - this.kind = 'delete', - required this.uri, - this.options, this.annotationId, + this.kind = 'delete', + this.options, + required this.uri, }) { if (kind != 'delete') { throw 'kind may only be the literal \'delete\''; } } static DeleteFile fromJson(Map json) { + final annotationIdJson = json['annotationId']; + final annotationId = annotationIdJson as String?; final kindJson = json['kind']; final kind = kindJson as String; - final uriJson = json['uri']; - final uri = uriJson as String; final optionsJson = json['options']; final options = optionsJson != null ? DeleteFileOptions.fromJson(optionsJson as Map) : null; - final annotationIdJson = json['annotationId']; - final annotationId = annotationIdJson as String?; + final uriJson = json['uri']; + final uri = uriJson as String; return DeleteFile( - kind: kind, - uri: uri, - options: options, annotationId: annotationId, + kind: kind, + options: options, + uri: uri, ); } @@ -9992,19 +9992,29 @@ class DeleteFile implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; - __result['uri'] = uri; - if (options != null) { - __result['options'] = options?.toJson(); - } if (annotationId != null) { __result['annotationId'] = annotationId; } + __result['kind'] = kind; + if (options != null) { + __result['options'] = options?.toJson(); + } + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('annotationId'); + try { + final annotationId = obj['annotationId']; + if (annotationId != null && !(annotationId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -10023,6 +10033,17 @@ class DeleteFile implements ToJsonable { } finally { reporter.pop(); } + reporter.push('options'); + try { + final options = obj['options']; + if (options != null && + !(DeleteFileOptions.canParse(options, reporter))) { + reporter.reportError('must be of type DeleteFileOptions'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -10041,27 +10062,6 @@ class DeleteFile implements ToJsonable { } finally { reporter.pop(); } - reporter.push('options'); - try { - final options = obj['options']; - if (options != null && - !(DeleteFileOptions.canParse(options, reporter))) { - reporter.reportError('must be of type DeleteFileOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('annotationId'); - try { - final annotationId = obj['annotationId']; - if (annotationId != null && !(annotationId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DeleteFile'); @@ -10072,10 +10072,10 @@ class DeleteFile implements ToJsonable { @override bool operator ==(Object other) { if (other is DeleteFile && other.runtimeType == DeleteFile) { - return kind == other.kind && - uri == other.uri && + return annotationId == other.annotationId && + kind == other.kind && options == other.options && - annotationId == other.annotationId && + uri == other.uri && true; } return false; @@ -10083,10 +10083,10 @@ class DeleteFile implements ToJsonable { @override int get hashCode => Object.hash( - kind, - uri, - options, annotationId, + kind, + options, + uri, ); @override @@ -10101,17 +10101,17 @@ class DeleteFileOptions implements ToJsonable { ); DeleteFileOptions({ - this.recursive, this.ignoreIfNotExists, + this.recursive, }); static DeleteFileOptions fromJson(Map json) { - final recursiveJson = json['recursive']; - final recursive = recursiveJson as bool?; final ignoreIfNotExistsJson = json['ignoreIfNotExists']; final ignoreIfNotExists = ignoreIfNotExistsJson as bool?; + final recursiveJson = json['recursive']; + final recursive = recursiveJson as bool?; return DeleteFileOptions( - recursive: recursive, ignoreIfNotExists: ignoreIfNotExists, + recursive: recursive, ); } @@ -10123,31 +10123,31 @@ class DeleteFileOptions implements ToJsonable { Map toJson() { var __result = {}; - if (recursive != null) { - __result['recursive'] = recursive; - } if (ignoreIfNotExists != null) { __result['ignoreIfNotExists'] = ignoreIfNotExists; } + if (recursive != null) { + __result['recursive'] = recursive; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('recursive'); + reporter.push('ignoreIfNotExists'); try { - final recursive = obj['recursive']; - if (recursive != null && !(recursive is bool)) { + final ignoreIfNotExists = obj['ignoreIfNotExists']; + if (ignoreIfNotExists != null && !(ignoreIfNotExists is bool)) { reporter.reportError('must be of type bool'); return false; } } finally { reporter.pop(); } - reporter.push('ignoreIfNotExists'); + reporter.push('recursive'); try { - final ignoreIfNotExists = obj['ignoreIfNotExists']; - if (ignoreIfNotExists != null && !(ignoreIfNotExists is bool)) { + final recursive = obj['recursive']; + if (recursive != null && !(recursive is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -10164,8 +10164,8 @@ class DeleteFileOptions implements ToJsonable { @override bool operator ==(Object other) { if (other is DeleteFileOptions && other.runtimeType == DeleteFileOptions) { - return recursive == other.recursive && - ignoreIfNotExists == other.ignoreIfNotExists && + return ignoreIfNotExists == other.ignoreIfNotExists && + recursive == other.recursive && true; } return false; @@ -10173,8 +10173,8 @@ class DeleteFileOptions implements ToJsonable { @override int get hashCode => Object.hash( - recursive, ignoreIfNotExists, + recursive, ); @override @@ -10264,54 +10264,54 @@ class Diagnostic implements ToJsonable { ); Diagnostic({ - required this.range, - this.severity, this.code, this.codeDescription, - this.source, - required this.message, - this.tags, - this.relatedInformation, this.data, + required this.message, + required this.range, + this.relatedInformation, + this.severity, + this.source, + this.tags, }); static Diagnostic fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); - final severityJson = json['severity']; - final severity = severityJson != null - ? DiagnosticSeverity.fromJson(severityJson as int) - : null; final codeJson = json['code']; final code = codeJson as String?; final codeDescriptionJson = json['codeDescription']; final codeDescription = codeDescriptionJson != null ? CodeDescription.fromJson(codeDescriptionJson as Map) : null; - final sourceJson = json['source']; - final source = sourceJson as String?; + final dataJson = json['data']; + final data = dataJson; final messageJson = json['message']; final message = messageJson as String; - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => DiagnosticTag.fromJson(item as int)) - .toList(); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); final relatedInformationJson = json['relatedInformation']; final relatedInformation = (relatedInformationJson as List?) ?.map((item) => DiagnosticRelatedInformation.fromJson(item as Map)) .toList(); - final dataJson = json['data']; - final data = dataJson; + final severityJson = json['severity']; + final severity = severityJson != null + ? DiagnosticSeverity.fromJson(severityJson as int) + : null; + final sourceJson = json['source']; + final source = sourceJson as String?; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => DiagnosticTag.fromJson(item as int)) + .toList(); return Diagnostic( - range: range, - severity: severity, code: code, codeDescription: codeDescription, - source: source, - message: message, - tags: tags, - relatedInformation: relatedInformation, data: data, + message: message, + range: range, + relatedInformation: relatedInformation, + severity: severity, + source: source, + tags: tags, ); } @@ -10352,64 +10352,35 @@ class Diagnostic implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); - if (severity != null) { - __result['severity'] = severity?.toJson(); - } if (code != null) { __result['code'] = code; } if (codeDescription != null) { __result['codeDescription'] = codeDescription?.toJson(); } - if (source != null) { - __result['source'] = source; + if (data != null) { + __result['data'] = data; } __result['message'] = message; - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); - } + __result['range'] = range.toJson(); if (relatedInformation != null) { __result['relatedInformation'] = relatedInformation?.map((item) => item.toJson()).toList(); } - if (data != null) { - __result['data'] = data; + if (severity != null) { + __result['severity'] = severity?.toJson(); + } + if (source != null) { + __result['source'] = source; + } + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('severity'); - try { - final severity = obj['severity']; - if (severity != null && - !(DiagnosticSeverity.canParse(severity, reporter))) { - reporter.reportError('must be of type DiagnosticSeverity'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('code'); try { final code = obj['code']; @@ -10431,16 +10402,6 @@ class Diagnostic implements ToJsonable { } finally { reporter.pop(); } - reporter.push('source'); - try { - final source = obj['source']; - if (source != null && !(source is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('message'); try { if (!obj.containsKey('message')) { @@ -10459,14 +10420,19 @@ class Diagnostic implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); + reporter.push('range'); try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every( - (item) => DiagnosticTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); return false; } } finally { @@ -10486,6 +10452,40 @@ class Diagnostic implements ToJsonable { } finally { reporter.pop(); } + reporter.push('severity'); + try { + final severity = obj['severity']; + if (severity != null && + !(DiagnosticSeverity.canParse(severity, reporter))) { + reporter.reportError('must be of type DiagnosticSeverity'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('source'); + try { + final source = obj['source']; + if (source != null && !(source is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every( + (item) => DiagnosticTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type Diagnostic'); @@ -10496,21 +10496,21 @@ class Diagnostic implements ToJsonable { @override bool operator ==(Object other) { if (other is Diagnostic && other.runtimeType == Diagnostic) { - return range == other.range && - severity == other.severity && - code == other.code && + return code == other.code && codeDescription == other.codeDescription && - source == other.source && + data == other.data && message == other.message && - listEqual( - tags, other.tags, (DiagnosticTag a, DiagnosticTag b) => a == b) && + range == other.range && listEqual( relatedInformation, other.relatedInformation, (DiagnosticRelatedInformation a, DiagnosticRelatedInformation b) => a == b) && - data == other.data && + severity == other.severity && + source == other.source && + listEqual( + tags, other.tags, (DiagnosticTag a, DiagnosticTag b) => a == b) && true; } return false; @@ -10518,15 +10518,15 @@ class Diagnostic implements ToJsonable { @override int get hashCode => Object.hash( - range, - severity, code, codeDescription, - source, - message, - lspHashCode(tags), - lspHashCode(relatedInformation), data, + message, + range, + lspHashCode(relatedInformation), + severity, + source, + lspHashCode(tags), ); @override @@ -10639,8 +10639,8 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { DiagnosticOptions({ this.identifier, required this.interFileDependencies, - required this.workspaceDiagnostics, this.workDoneProgress, + required this.workspaceDiagnostics, }); static DiagnosticOptions fromJson(Map json) { if (DiagnosticRegistrationOptions.canParse(json, nullLspJsonReporter)) { @@ -10650,15 +10650,15 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { final identifier = identifierJson as String?; final interFileDependenciesJson = json['interFileDependencies']; final interFileDependencies = interFileDependenciesJson as bool; - final workspaceDiagnosticsJson = json['workspaceDiagnostics']; - final workspaceDiagnostics = workspaceDiagnosticsJson as bool; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; + final workspaceDiagnosticsJson = json['workspaceDiagnostics']; + final workspaceDiagnostics = workspaceDiagnosticsJson as bool; return DiagnosticOptions( identifier: identifier, interFileDependencies: interFileDependencies, - workspaceDiagnostics: workspaceDiagnostics, workDoneProgress: workDoneProgress, + workspaceDiagnostics: workspaceDiagnostics, ); } @@ -10682,10 +10682,10 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { __result['identifier'] = identifier; } __result['interFileDependencies'] = interFileDependencies; - __result['workspaceDiagnostics'] = workspaceDiagnostics; if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } + __result['workspaceDiagnostics'] = workspaceDiagnostics; return __result; } @@ -10719,6 +10719,16 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workspaceDiagnostics'); try { if (!obj.containsKey('workspaceDiagnostics')) { @@ -10737,16 +10747,6 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DiagnosticOptions'); @@ -10759,8 +10759,8 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { if (other is DiagnosticOptions && other.runtimeType == DiagnosticOptions) { return identifier == other.identifier && interFileDependencies == other.interFileDependencies && - workspaceDiagnostics == other.workspaceDiagnostics && workDoneProgress == other.workDoneProgress && + workspaceDiagnostics == other.workspaceDiagnostics && true; } return false; @@ -10770,8 +10770,8 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { int get hashCode => Object.hash( identifier, interFileDependencies, - workspaceDiagnostics, workDoneProgress, + workspaceDiagnostics, ); @override @@ -10793,34 +10793,34 @@ class DiagnosticRegistrationOptions DiagnosticRegistrationOptions({ this.documentSelector, + this.id, this.identifier, required this.interFileDependencies, - required this.workspaceDiagnostics, this.workDoneProgress, - this.id, + required this.workspaceDiagnostics, }); static DiagnosticRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); + final idJson = json['id']; + final id = idJson as String?; final identifierJson = json['identifier']; final identifier = identifierJson as String?; final interFileDependenciesJson = json['interFileDependencies']; final interFileDependencies = interFileDependenciesJson as bool; - final workspaceDiagnosticsJson = json['workspaceDiagnostics']; - final workspaceDiagnostics = workspaceDiagnosticsJson as bool; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; - final idJson = json['id']; - final id = idJson as String?; + final workspaceDiagnosticsJson = json['workspaceDiagnostics']; + final workspaceDiagnostics = workspaceDiagnosticsJson as bool; return DiagnosticRegistrationOptions( documentSelector: documentSelector, + id: id, identifier: identifier, interFileDependencies: interFileDependencies, - workspaceDiagnostics: workspaceDiagnostics, workDoneProgress: workDoneProgress, - id: id, + workspaceDiagnostics: workspaceDiagnostics, ); } @@ -10849,17 +10849,17 @@ class DiagnosticRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; + if (id != null) { + __result['id'] = id; + } if (identifier != null) { __result['identifier'] = identifier; } __result['interFileDependencies'] = interFileDependencies; - __result['workspaceDiagnostics'] = workspaceDiagnostics; if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } - if (id != null) { - __result['id'] = id; - } + __result['workspaceDiagnostics'] = workspaceDiagnostics; return __result; } @@ -10882,6 +10882,16 @@ class DiagnosticRegistrationOptions } finally { reporter.pop(); } + reporter.push('id'); + try { + final id = obj['id']; + if (id != null && !(id is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('identifier'); try { final identifier = obj['identifier']; @@ -10910,6 +10920,16 @@ class DiagnosticRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workspaceDiagnostics'); try { if (!obj.containsKey('workspaceDiagnostics')) { @@ -10928,26 +10948,6 @@ class DiagnosticRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('id'); - try { - final id = obj['id']; - if (id != null && !(id is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DiagnosticRegistrationOptions'); @@ -10961,11 +10961,11 @@ class DiagnosticRegistrationOptions other.runtimeType == DiagnosticRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && + id == other.id && identifier == other.identifier && interFileDependencies == other.interFileDependencies && - workspaceDiagnostics == other.workspaceDiagnostics && workDoneProgress == other.workDoneProgress && - id == other.id && + workspaceDiagnostics == other.workspaceDiagnostics && true; } return false; @@ -10974,11 +10974,11 @@ class DiagnosticRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), + id, identifier, interFileDependencies, - workspaceDiagnostics, workDoneProgress, - id, + workspaceDiagnostics, ); @override @@ -11421,19 +11421,19 @@ class DidChangeNotebookDocumentParams implements ToJsonable { ); DidChangeNotebookDocumentParams({ - required this.notebookDocument, required this.change, + required this.notebookDocument, }); static DidChangeNotebookDocumentParams fromJson(Map json) { - final notebookDocumentJson = json['notebookDocument']; - final notebookDocument = VersionedNotebookDocumentIdentifier.fromJson( - notebookDocumentJson as Map); final changeJson = json['change']; final change = NotebookDocumentChangeEvent.fromJson( changeJson as Map); + final notebookDocumentJson = json['notebookDocument']; + final notebookDocument = VersionedNotebookDocumentIdentifier.fromJson( + notebookDocumentJson as Map); return DidChangeNotebookDocumentParams( - notebookDocument: notebookDocument, change: change, + notebookDocument: notebookDocument, ); } @@ -11456,13 +11456,31 @@ class DidChangeNotebookDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['notebookDocument'] = notebookDocument.toJson(); __result['change'] = change.toJson(); + __result['notebookDocument'] = notebookDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('change'); + try { + if (!obj.containsKey('change')) { + reporter.reportError('must not be undefined'); + return false; + } + final change = obj['change']; + if (change == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(NotebookDocumentChangeEvent.canParse(change, reporter))) { + reporter.reportError('must be of type NotebookDocumentChangeEvent'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('notebookDocument'); try { if (!obj.containsKey('notebookDocument')) { @@ -11483,24 +11501,6 @@ class DidChangeNotebookDocumentParams implements ToJsonable { } finally { reporter.pop(); } - reporter.push('change'); - try { - if (!obj.containsKey('change')) { - reporter.reportError('must not be undefined'); - return false; - } - final change = obj['change']; - if (change == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(NotebookDocumentChangeEvent.canParse(change, reporter))) { - reporter.reportError('must be of type NotebookDocumentChangeEvent'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DidChangeNotebookDocumentParams'); @@ -11512,8 +11512,8 @@ class DidChangeNotebookDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is DidChangeNotebookDocumentParams && other.runtimeType == DidChangeNotebookDocumentParams) { - return notebookDocument == other.notebookDocument && - change == other.change && + return change == other.change && + notebookDocument == other.notebookDocument && true; } return false; @@ -11521,8 +11521,8 @@ class DidChangeNotebookDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - notebookDocument, change, + notebookDocument, ); @override @@ -11536,13 +11536,10 @@ class DidChangeTextDocumentParams implements ToJsonable { ); DidChangeTextDocumentParams({ - required this.textDocument, required this.contentChanges, + required this.textDocument, }); static DidChangeTextDocumentParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = VersionedTextDocumentIdentifier.fromJson( - textDocumentJson as Map); final contentChangesJson = json['contentChanges']; final contentChanges = (contentChangesJson as List) .map((item) => TextDocumentContentChangeEvent1.canParse( @@ -11556,9 +11553,12 @@ class DidChangeTextDocumentParams implements ToJsonable { TextDocumentContentChangeEvent2.fromJson(item as Map)) : (throw '''$item was not one of (TextDocumentContentChangeEvent1, TextDocumentContentChangeEvent2)'''))) .toList(); + final textDocumentJson = json['textDocument']; + final textDocument = VersionedTextDocumentIdentifier.fromJson( + textDocumentJson as Map); return DidChangeTextDocumentParams( - textDocument: textDocument, contentChanges: contentChanges, + textDocument: textDocument, ); } @@ -11585,33 +11585,13 @@ class DidChangeTextDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['contentChanges'] = contentChanges; + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(VersionedTextDocumentIdentifier.canParse( - textDocument, reporter))) { - reporter - .reportError('must be of type VersionedTextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('contentChanges'); try { if (!obj.containsKey('contentChanges')) { @@ -11635,6 +11615,26 @@ class DidChangeTextDocumentParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(VersionedTextDocumentIdentifier.canParse( + textDocument, reporter))) { + reporter + .reportError('must be of type VersionedTextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type DidChangeTextDocumentParams'); @@ -11646,8 +11646,7 @@ class DidChangeTextDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is DidChangeTextDocumentParams && other.runtimeType == DidChangeTextDocumentParams) { - return textDocument == other.textDocument && - listEqual( + return listEqual( contentChanges, other.contentChanges, (Either2 b) => a == b) && + textDocument == other.textDocument && true; } return false; @@ -11664,8 +11664,8 @@ class DidChangeTextDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - textDocument, lspHashCode(contentChanges), + textDocument, ); @override @@ -11997,21 +11997,21 @@ class DidCloseNotebookDocumentParams implements ToJsonable { ); DidCloseNotebookDocumentParams({ - required this.notebookDocument, required this.cellTextDocuments, + required this.notebookDocument, }); static DidCloseNotebookDocumentParams fromJson(Map json) { - final notebookDocumentJson = json['notebookDocument']; - final notebookDocument = NotebookDocumentIdentifier.fromJson( - notebookDocumentJson as Map); final cellTextDocumentsJson = json['cellTextDocuments']; final cellTextDocuments = (cellTextDocumentsJson as List) .map((item) => TextDocumentIdentifier.fromJson(item as Map)) .toList(); + final notebookDocumentJson = json['notebookDocument']; + final notebookDocument = NotebookDocumentIdentifier.fromJson( + notebookDocumentJson as Map); return DidCloseNotebookDocumentParams( - notebookDocument: notebookDocument, cellTextDocuments: cellTextDocuments, + notebookDocument: notebookDocument, ); } @@ -12024,33 +12024,14 @@ class DidCloseNotebookDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['notebookDocument'] = notebookDocument.toJson(); __result['cellTextDocuments'] = cellTextDocuments.map((item) => item.toJson()).toList(); + __result['notebookDocument'] = notebookDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('notebookDocument'); - try { - if (!obj.containsKey('notebookDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final notebookDocument = obj['notebookDocument']; - if (notebookDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(NotebookDocumentIdentifier.canParse( - notebookDocument, reporter))) { - reporter.reportError('must be of type NotebookDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('cellTextDocuments'); try { if (!obj.containsKey('cellTextDocuments')) { @@ -12071,6 +12052,25 @@ class DidCloseNotebookDocumentParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('notebookDocument'); + try { + if (!obj.containsKey('notebookDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final notebookDocument = obj['notebookDocument']; + if (notebookDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(NotebookDocumentIdentifier.canParse( + notebookDocument, reporter))) { + reporter.reportError('must be of type NotebookDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type DidCloseNotebookDocumentParams'); @@ -12082,9 +12082,9 @@ class DidCloseNotebookDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is DidCloseNotebookDocumentParams && other.runtimeType == DidCloseNotebookDocumentParams) { - return notebookDocument == other.notebookDocument && - listEqual(cellTextDocuments, other.cellTextDocuments, + return listEqual(cellTextDocuments, other.cellTextDocuments, (TextDocumentIdentifier a, TextDocumentIdentifier b) => a == b) && + notebookDocument == other.notebookDocument && true; } return false; @@ -12092,8 +12092,8 @@ class DidCloseNotebookDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - notebookDocument, lspHashCode(cellTextDocuments), + notebookDocument, ); @override @@ -12179,20 +12179,20 @@ class DidOpenNotebookDocumentParams implements ToJsonable { ); DidOpenNotebookDocumentParams({ - required this.notebookDocument, required this.cellTextDocuments, + required this.notebookDocument, }); static DidOpenNotebookDocumentParams fromJson(Map json) { - final notebookDocumentJson = json['notebookDocument']; - final notebookDocument = - NotebookDocument.fromJson(notebookDocumentJson as Map); final cellTextDocumentsJson = json['cellTextDocuments']; final cellTextDocuments = (cellTextDocumentsJson as List) .map((item) => TextDocumentItem.fromJson(item as Map)) .toList(); + final notebookDocumentJson = json['notebookDocument']; + final notebookDocument = + NotebookDocument.fromJson(notebookDocumentJson as Map); return DidOpenNotebookDocumentParams( - notebookDocument: notebookDocument, cellTextDocuments: cellTextDocuments, + notebookDocument: notebookDocument, ); } @@ -12204,32 +12204,14 @@ class DidOpenNotebookDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['notebookDocument'] = notebookDocument.toJson(); __result['cellTextDocuments'] = cellTextDocuments.map((item) => item.toJson()).toList(); + __result['notebookDocument'] = notebookDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('notebookDocument'); - try { - if (!obj.containsKey('notebookDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final notebookDocument = obj['notebookDocument']; - if (notebookDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(NotebookDocument.canParse(notebookDocument, reporter))) { - reporter.reportError('must be of type NotebookDocument'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('cellTextDocuments'); try { if (!obj.containsKey('cellTextDocuments')) { @@ -12250,6 +12232,24 @@ class DidOpenNotebookDocumentParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('notebookDocument'); + try { + if (!obj.containsKey('notebookDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final notebookDocument = obj['notebookDocument']; + if (notebookDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(NotebookDocument.canParse(notebookDocument, reporter))) { + reporter.reportError('must be of type NotebookDocument'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type DidOpenNotebookDocumentParams'); @@ -12261,9 +12261,9 @@ class DidOpenNotebookDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is DidOpenNotebookDocumentParams && other.runtimeType == DidOpenNotebookDocumentParams) { - return notebookDocument == other.notebookDocument && - listEqual(cellTextDocuments, other.cellTextDocuments, + return listEqual(cellTextDocuments, other.cellTextDocuments, (TextDocumentItem a, TextDocumentItem b) => a == b) && + notebookDocument == other.notebookDocument && true; } return false; @@ -12271,8 +12271,8 @@ class DidOpenNotebookDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - notebookDocument, lspHashCode(cellTextDocuments), + notebookDocument, ); @override @@ -12429,18 +12429,18 @@ class DidSaveTextDocumentParams implements ToJsonable { ); DidSaveTextDocumentParams({ - required this.textDocument, this.text, + required this.textDocument, }); static DidSaveTextDocumentParams fromJson(Map json) { + final textJson = json['text']; + final text = textJson as String?; final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final textJson = json['text']; - final text = textJson as String?; return DidSaveTextDocumentParams( - textDocument: textDocument, text: text, + textDocument: textDocument, ); } @@ -12453,15 +12453,25 @@ class DidSaveTextDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); if (text != null) { __result['text'] = text; } + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('text'); + try { + final text = obj['text']; + if (text != null && !(text is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -12480,16 +12490,6 @@ class DidSaveTextDocumentParams implements ToJsonable { } finally { reporter.pop(); } - reporter.push('text'); - try { - final text = obj['text']; - if (text != null && !(text is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DidSaveTextDocumentParams'); @@ -12501,15 +12501,15 @@ class DidSaveTextDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is DidSaveTextDocumentParams && other.runtimeType == DidSaveTextDocumentParams) { - return textDocument == other.textDocument && text == other.text && true; + return text == other.text && textDocument == other.textDocument && true; } return false; } @override int get hashCode => Object.hash( - textDocument, text, + textDocument, ); @override @@ -12652,11 +12652,19 @@ class DocumentColorParams ); DocumentColorParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static DocumentColorParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -12668,18 +12676,10 @@ class DocumentColorParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return DocumentColorParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -12695,18 +12695,29 @@ class DocumentColorParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -12736,17 +12747,6 @@ class DocumentColorParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentColorParams'); @@ -12758,9 +12758,9 @@ class DocumentColorParams bool operator ==(Object other) { if (other is DocumentColorParams && other.runtimeType == DocumentColorParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -12768,9 +12768,9 @@ class DocumentColorParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -12910,28 +12910,15 @@ class DocumentDiagnosticParams ); DocumentDiagnosticParams({ - required this.textDocument, this.identifier, - this.previousResultId, - this.workDoneToken, this.partialResultToken, + this.previousResultId, + required this.textDocument, + this.workDoneToken, }); static DocumentDiagnosticParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); final identifierJson = json['identifier']; final identifier = identifierJson as String?; - final previousResultIdJson = json['previousResultId']; - final previousResultId = previousResultIdJson as String?; - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -12940,12 +12927,25 @@ class DocumentDiagnosticParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final previousResultIdJson = json['previousResultId']; + final previousResultId = previousResultIdJson as String?; + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DocumentDiagnosticParams( - textDocument: textDocument, identifier: identifier, - previousResultId: previousResultId, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + previousResultId: previousResultId, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -12967,24 +12967,55 @@ class DocumentDiagnosticParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); if (identifier != null) { __result['identifier'] = identifier; } + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } if (previousResultId != null) { __result['previousResultId'] = previousResultId; } + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('identifier'); + try { + final identifier = obj['identifier']; + if (identifier != null && !(identifier is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('previousResultId'); + try { + final previousResultId = obj['previousResultId']; + if (previousResultId != null && !(previousResultId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -13003,26 +13034,6 @@ class DocumentDiagnosticParams } finally { reporter.pop(); } - reporter.push('identifier'); - try { - final identifier = obj['identifier']; - if (identifier != null && !(identifier is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('previousResultId'); - try { - final previousResultId = obj['previousResultId']; - if (previousResultId != null && !(previousResultId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -13034,17 +13045,6 @@ class DocumentDiagnosticParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentDiagnosticParams'); @@ -13056,11 +13056,11 @@ class DocumentDiagnosticParams bool operator ==(Object other) { if (other is DocumentDiagnosticParams && other.runtimeType == DocumentDiagnosticParams) { - return textDocument == other.textDocument && - identifier == other.identifier && - previousResultId == other.previousResultId && - workDoneToken == other.workDoneToken && + return identifier == other.identifier && partialResultToken == other.partialResultToken && + previousResultId == other.previousResultId && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken && true; } return false; @@ -13068,11 +13068,11 @@ class DocumentDiagnosticParams @override int get hashCode => Object.hash( - textDocument, identifier, - previousResultId, - workDoneToken, partialResultToken, + previousResultId, + textDocument, + workDoneToken, ); @override @@ -13221,20 +13221,20 @@ class DocumentFilter implements ToJsonable { DocumentFilter({ this.language, - this.scheme, this.pattern, + this.scheme, }); static DocumentFilter fromJson(Map json) { final languageJson = json['language']; final language = languageJson as String?; - final schemeJson = json['scheme']; - final scheme = schemeJson as String?; final patternJson = json['pattern']; final pattern = patternJson as String?; + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; return DocumentFilter( language: language, - scheme: scheme, pattern: pattern, + scheme: scheme, ); } @@ -13264,12 +13264,12 @@ class DocumentFilter implements ToJsonable { if (language != null) { __result['language'] = language; } - if (scheme != null) { - __result['scheme'] = scheme; - } if (pattern != null) { __result['pattern'] = pattern; } + if (scheme != null) { + __result['scheme'] = scheme; + } return __result; } @@ -13285,20 +13285,20 @@ class DocumentFilter implements ToJsonable { } finally { reporter.pop(); } - reporter.push('scheme'); + reporter.push('pattern'); try { - final scheme = obj['scheme']; - if (scheme != null && !(scheme is String)) { + final pattern = obj['pattern']; + if (pattern != null && !(pattern is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } - reporter.push('pattern'); + reporter.push('scheme'); try { - final pattern = obj['pattern']; - if (pattern != null && !(pattern is String)) { + final scheme = obj['scheme']; + if (scheme != null && !(scheme is String)) { reporter.reportError('must be of type String'); return false; } @@ -13316,8 +13316,8 @@ class DocumentFilter implements ToJsonable { bool operator ==(Object other) { if (other is DocumentFilter && other.runtimeType == DocumentFilter) { return language == other.language && - scheme == other.scheme && pattern == other.pattern && + scheme == other.scheme && true; } return false; @@ -13326,8 +13326,8 @@ class DocumentFilter implements ToJsonable { @override int get hashCode => Object.hash( language, - scheme, pattern, + scheme, ); @override @@ -13472,17 +13472,17 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { ); DocumentFormattingParams({ - required this.textDocument, required this.options, + required this.textDocument, this.workDoneToken, }); static DocumentFormattingParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); final optionsJson = json['options']; final options = FormattingOptions.fromJson(optionsJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -13492,8 +13492,8 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DocumentFormattingParams( - textDocument: textDocument, options: options, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -13509,8 +13509,8 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['options'] = options.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -13519,24 +13519,6 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('options'); try { if (!obj.containsKey('options')) { @@ -13555,6 +13537,24 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -13577,8 +13577,8 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { bool operator ==(Object other) { if (other is DocumentFormattingParams && other.runtimeType == DocumentFormattingParams) { - return textDocument == other.textDocument && - options == other.options && + return options == other.options && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -13587,8 +13587,8 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { @override int get hashCode => Object.hash( - textDocument, options, + textDocument, workDoneToken, ); @@ -13707,19 +13707,19 @@ class DocumentHighlight implements ToJsonable { ); DocumentHighlight({ - required this.range, this.kind, + required this.range, }); static DocumentHighlight fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final kindJson = json['kind']; final kind = kindJson != null ? DocumentHighlightKind.fromJson(kindJson as int) : null; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return DocumentHighlight( - range: range, kind: kind, + range: range, ); } @@ -13731,15 +13731,25 @@ class DocumentHighlight implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); if (kind != null) { __result['kind'] = kind?.toJson(); } + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('kind'); + try { + final kind = obj['kind']; + if (kind != null && !(DocumentHighlightKind.canParse(kind, reporter))) { + reporter.reportError('must be of type DocumentHighlightKind'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -13758,16 +13768,6 @@ class DocumentHighlight implements ToJsonable { } finally { reporter.pop(); } - reporter.push('kind'); - try { - final kind = obj['kind']; - if (kind != null && !(DocumentHighlightKind.canParse(kind, reporter))) { - reporter.reportError('must be of type DocumentHighlightKind'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentHighlight'); @@ -13778,15 +13778,15 @@ class DocumentHighlight implements ToJsonable { @override bool operator ==(Object other) { if (other is DocumentHighlight && other.runtimeType == DocumentHighlight) { - return range == other.range && kind == other.kind && true; + return kind == other.kind && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, kind, + range, ); @override @@ -13968,25 +13968,12 @@ class DocumentHighlightParams ); DocumentHighlightParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static DocumentHighlightParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -13995,11 +13982,24 @@ class DocumentHighlightParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DocumentHighlightParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -14018,32 +14018,25 @@ class DocumentHighlightParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -14067,22 +14060,29 @@ class DocumentHighlightParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -14100,10 +14100,10 @@ class DocumentHighlightParams bool operator ==(Object other) { if (other is DocumentHighlightParams && other.runtimeType == DocumentHighlightParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -14111,10 +14111,10 @@ class DocumentHighlightParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -14231,25 +14231,25 @@ class DocumentLink implements ToJsonable { ); DocumentLink({ + this.data, required this.range, this.target, this.tooltip, - this.data, }); static DocumentLink fromJson(Map json) { + final dataJson = json['data']; + final data = dataJson; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); final targetJson = json['target']; final target = targetJson as String?; final tooltipJson = json['tooltip']; final tooltip = tooltipJson as String?; - final dataJson = json['data']; - final data = dataJson; return DocumentLink( + data: data, range: range, target: target, tooltip: tooltip, - data: data, ); } @@ -14274,6 +14274,9 @@ class DocumentLink implements ToJsonable { Map toJson() { var __result = {}; + if (data != null) { + __result['data'] = data; + } __result['range'] = range.toJson(); if (target != null) { __result['target'] = target; @@ -14281,9 +14284,6 @@ class DocumentLink implements ToJsonable { if (tooltip != null) { __result['tooltip'] = tooltip; } - if (data != null) { - __result['data'] = data; - } return __result; } @@ -14337,10 +14337,10 @@ class DocumentLink implements ToJsonable { @override bool operator ==(Object other) { if (other is DocumentLink && other.runtimeType == DocumentLink) { - return range == other.range && + return data == other.data && + range == other.range && target == other.target && tooltip == other.tooltip && - data == other.data && true; } return false; @@ -14348,10 +14348,10 @@ class DocumentLink implements ToJsonable { @override int get hashCode => Object.hash( + data, range, target, tooltip, - data, ); @override @@ -14544,11 +14544,19 @@ class DocumentLinkParams ); DocumentLinkParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static DocumentLinkParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -14560,18 +14568,10 @@ class DocumentLinkParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return DocumentLinkParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -14587,18 +14587,29 @@ class DocumentLinkParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -14628,17 +14639,6 @@ class DocumentLinkParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentLinkParams'); @@ -14650,9 +14650,9 @@ class DocumentLinkParams bool operator ==(Object other) { if (other is DocumentLinkParams && other.runtimeType == DocumentLinkParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -14660,9 +14660,9 @@ class DocumentLinkParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -14965,27 +14965,27 @@ class DocumentOnTypeFormattingParams implements ToJsonable { ); DocumentOnTypeFormattingParams({ - required this.textDocument, - required this.position, required this.ch, required this.options, + required this.position, + required this.textDocument, }); static DocumentOnTypeFormattingParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final chJson = json['ch']; final ch = chJson as String; final optionsJson = json['options']; final options = FormattingOptions.fromJson(optionsJson as Map); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); return DocumentOnTypeFormattingParams( - textDocument: textDocument, - position: position, ch: ch, options: options, + position: position, + textDocument: textDocument, ); } @@ -15008,51 +15008,15 @@ class DocumentOnTypeFormattingParams implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); __result['ch'] = ch; __result['options'] = options.toJson(); + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('position'); - try { - if (!obj.containsKey('position')) { - reporter.reportError('must not be undefined'); - return false; - } - final position = obj['position']; - if (position == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Position.canParse(position, reporter))) { - reporter.reportError('must be of type Position'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('ch'); try { if (!obj.containsKey('ch')) { @@ -15089,6 +15053,42 @@ class DocumentOnTypeFormattingParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('position'); + try { + if (!obj.containsKey('position')) { + reporter.reportError('must not be undefined'); + return false; + } + final position = obj['position']; + if (position == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Position.canParse(position, reporter))) { + reporter.reportError('must be of type Position'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type DocumentOnTypeFormattingParams'); @@ -15100,10 +15100,10 @@ class DocumentOnTypeFormattingParams implements ToJsonable { bool operator ==(Object other) { if (other is DocumentOnTypeFormattingParams && other.runtimeType == DocumentOnTypeFormattingParams) { - return textDocument == other.textDocument && - position == other.position && - ch == other.ch && + return ch == other.ch && options == other.options && + position == other.position && + textDocument == other.textDocument && true; } return false; @@ -15111,10 +15111,10 @@ class DocumentOnTypeFormattingParams implements ToJsonable { @override int get hashCode => Object.hash( - textDocument, - position, ch, options, + position, + textDocument, ); @override @@ -15397,20 +15397,20 @@ class DocumentRangeFormattingParams ); DocumentRangeFormattingParams({ - required this.textDocument, - required this.range, required this.options, + required this.range, + required this.textDocument, this.workDoneToken, }); static DocumentRangeFormattingParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final optionsJson = json['options']; final options = FormattingOptions.fromJson(optionsJson as Map); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -15420,9 +15420,9 @@ class DocumentRangeFormattingParams ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return DocumentRangeFormattingParams( - textDocument: textDocument, - range: range, options: options, + range: range, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -15441,9 +15441,9 @@ class DocumentRangeFormattingParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['range'] = range.toJson(); __result['options'] = options.toJson(); + __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -15452,19 +15452,19 @@ class DocumentRangeFormattingParams static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('options'); try { - if (!obj.containsKey('textDocument')) { + if (!obj.containsKey('options')) { reporter.reportError('must not be undefined'); return false; } - final textDocument = obj['textDocument']; - if (textDocument == null) { + final options = obj['options']; + if (options == null) { reporter.reportError('must not be null'); return false; } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + if (!(FormattingOptions.canParse(options, reporter))) { + reporter.reportError('must be of type FormattingOptions'); return false; } } finally { @@ -15488,19 +15488,19 @@ class DocumentRangeFormattingParams } finally { reporter.pop(); } - reporter.push('options'); + reporter.push('textDocument'); try { - if (!obj.containsKey('options')) { + if (!obj.containsKey('textDocument')) { reporter.reportError('must not be undefined'); return false; } - final options = obj['options']; - if (options == null) { + final textDocument = obj['textDocument']; + if (textDocument == null) { reporter.reportError('must not be null'); return false; } - if (!(FormattingOptions.canParse(options, reporter))) { - reporter.reportError('must be of type FormattingOptions'); + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { @@ -15528,9 +15528,9 @@ class DocumentRangeFormattingParams bool operator ==(Object other) { if (other is DocumentRangeFormattingParams && other.runtimeType == DocumentRangeFormattingParams) { - return textDocument == other.textDocument && + return options == other.options && range == other.range && - options == other.options && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -15539,9 +15539,9 @@ class DocumentRangeFormattingParams @override int get hashCode => Object.hash( - textDocument, - range, options, + range, + textDocument, workDoneToken, ); @@ -15661,46 +15661,46 @@ class DocumentSymbol implements ToJsonable { ); DocumentSymbol({ - required this.name, + this.children, + this.deprecated, this.detail, required this.kind, - this.tags, - this.deprecated, + required this.name, required this.range, required this.selectionRange, - this.children, + this.tags, }); static DocumentSymbol fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; + final childrenJson = json['children']; + final children = (childrenJson as List?) + ?.map((item) => DocumentSymbol.fromJson(item as Map)) + .toList(); + final deprecatedJson = json['deprecated']; + final deprecated = deprecatedJson as bool?; final detailJson = json['detail']; final detail = detailJson as String?; final kindJson = json['kind']; final kind = SymbolKind.fromJson(kindJson as int); - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => SymbolTag.fromJson(item as int)) - .toList(); - final deprecatedJson = json['deprecated']; - final deprecated = deprecatedJson as bool?; + final nameJson = json['name']; + final name = nameJson as String; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); final selectionRangeJson = json['selectionRange']; final selectionRange = Range.fromJson(selectionRangeJson as Map); - final childrenJson = json['children']; - final children = (childrenJson as List?) - ?.map((item) => DocumentSymbol.fromJson(item as Map)) + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => SymbolTag.fromJson(item as int)) .toList(); return DocumentSymbol( - name: name, + children: children, + deprecated: deprecated, detail: detail, kind: kind, - tags: tags, - deprecated: deprecated, + name: name, range: range, selectionRange: selectionRange, - children: children, + tags: tags, ); } @@ -15738,40 +15738,45 @@ class DocumentSymbol implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; - if (detail != null) { - __result['detail'] = detail; - } - __result['kind'] = kind.toJson(); - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); + if (children != null) { + __result['children'] = children?.map((item) => item.toJson()).toList(); } if (deprecated != null) { __result['deprecated'] = deprecated; } + if (detail != null) { + __result['detail'] = detail; + } + __result['kind'] = kind.toJson(); + __result['name'] = name; __result['range'] = range.toJson(); __result['selectionRange'] = selectionRange.toJson(); - if (children != null) { - __result['children'] = children?.map((item) => item.toJson()).toList(); + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); + reporter.push('children'); try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); + final children = obj['children']; + if (children != null && + !((children is List && + (children.every( + (item) => DocumentSymbol.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { - reporter.reportError('must be of type String'); + } finally { + reporter.pop(); + } + reporter.push('deprecated'); + try { + final deprecated = obj['deprecated']; + if (deprecated != null && !(deprecated is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -15805,23 +15810,19 @@ class DocumentSymbol implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); + reporter.push('name'); try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('name')) { + reporter.reportError('must not be undefined'); return false; } - } finally { - reporter.pop(); - } - reporter.push('deprecated'); - try { - final deprecated = obj['deprecated']; - if (deprecated != null && !(deprecated is bool)) { - reporter.reportError('must be of type bool'); + final name = obj['name']; + if (name == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(name is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -15863,14 +15864,13 @@ class DocumentSymbol implements ToJsonable { } finally { reporter.pop(); } - reporter.push('children'); + reporter.push('tags'); try { - final children = obj['children']; - if (children != null && - !((children is List && - (children.every( - (item) => DocumentSymbol.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -15886,15 +15886,15 @@ class DocumentSymbol implements ToJsonable { @override bool operator ==(Object other) { if (other is DocumentSymbol && other.runtimeType == DocumentSymbol) { - return name == other.name && + return listEqual(children, other.children, + (DocumentSymbol a, DocumentSymbol b) => a == b) && + deprecated == other.deprecated && detail == other.detail && kind == other.kind && - listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && - deprecated == other.deprecated && + name == other.name && range == other.range && selectionRange == other.selectionRange && - listEqual(children, other.children, - (DocumentSymbol a, DocumentSymbol b) => a == b) && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && true; } return false; @@ -15902,14 +15902,14 @@ class DocumentSymbol implements ToJsonable { @override int get hashCode => Object.hash( - name, + lspHashCode(children), + deprecated, detail, kind, - lspHashCode(tags), - deprecated, + name, range, selectionRange, - lspHashCode(children), + lspHashCode(tags), ); @override @@ -15924,36 +15924,36 @@ class DocumentSymbolClientCapabilities implements ToJsonable { DocumentSymbolClientCapabilities({ this.dynamicRegistration, - this.symbolKind, this.hierarchicalDocumentSymbolSupport, - this.tagSupport, this.labelSupport, + this.symbolKind, + this.tagSupport, }); static DocumentSymbolClientCapabilities fromJson(Map json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final hierarchicalDocumentSymbolSupportJson = + json['hierarchicalDocumentSymbolSupport']; + final hierarchicalDocumentSymbolSupport = + hierarchicalDocumentSymbolSupportJson as bool?; + final labelSupportJson = json['labelSupport']; + final labelSupport = labelSupportJson as bool?; final symbolKindJson = json['symbolKind']; final symbolKind = symbolKindJson != null ? DocumentSymbolClientCapabilitiesSymbolKind.fromJson( symbolKindJson as Map) : null; - final hierarchicalDocumentSymbolSupportJson = - json['hierarchicalDocumentSymbolSupport']; - final hierarchicalDocumentSymbolSupport = - hierarchicalDocumentSymbolSupportJson as bool?; final tagSupportJson = json['tagSupport']; final tagSupport = tagSupportJson != null ? DocumentSymbolClientCapabilitiesTagSupport.fromJson( tagSupportJson as Map) : null; - final labelSupportJson = json['labelSupport']; - final labelSupport = labelSupportJson as bool?; return DocumentSymbolClientCapabilities( dynamicRegistration: dynamicRegistration, - symbolKind: symbolKind, hierarchicalDocumentSymbolSupport: hierarchicalDocumentSymbolSupport, - tagSupport: tagSupport, labelSupport: labelSupport, + symbolKind: symbolKind, + tagSupport: tagSupport, ); } @@ -15983,19 +15983,19 @@ class DocumentSymbolClientCapabilities implements ToJsonable { if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } - if (symbolKind != null) { - __result['symbolKind'] = symbolKind?.toJson(); - } if (hierarchicalDocumentSymbolSupport != null) { __result['hierarchicalDocumentSymbolSupport'] = hierarchicalDocumentSymbolSupport; } - if (tagSupport != null) { - __result['tagSupport'] = tagSupport?.toJson(); - } if (labelSupport != null) { __result['labelSupport'] = labelSupport; } + if (symbolKind != null) { + __result['symbolKind'] = symbolKind?.toJson(); + } + if (tagSupport != null) { + __result['tagSupport'] = tagSupport?.toJson(); + } return __result; } @@ -16011,6 +16011,28 @@ class DocumentSymbolClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('hierarchicalDocumentSymbolSupport'); + try { + final hierarchicalDocumentSymbolSupport = + obj['hierarchicalDocumentSymbolSupport']; + if (hierarchicalDocumentSymbolSupport != null && + !(hierarchicalDocumentSymbolSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('labelSupport'); + try { + final labelSupport = obj['labelSupport']; + if (labelSupport != null && !(labelSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('symbolKind'); try { final symbolKind = obj['symbolKind']; @@ -16024,18 +16046,6 @@ class DocumentSymbolClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('hierarchicalDocumentSymbolSupport'); - try { - final hierarchicalDocumentSymbolSupport = - obj['hierarchicalDocumentSymbolSupport']; - if (hierarchicalDocumentSymbolSupport != null && - !(hierarchicalDocumentSymbolSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('tagSupport'); try { final tagSupport = obj['tagSupport']; @@ -16049,16 +16059,6 @@ class DocumentSymbolClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('labelSupport'); - try { - final labelSupport = obj['labelSupport']; - if (labelSupport != null && !(labelSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentSymbolClientCapabilities'); @@ -16071,11 +16071,11 @@ class DocumentSymbolClientCapabilities implements ToJsonable { if (other is DocumentSymbolClientCapabilities && other.runtimeType == DocumentSymbolClientCapabilities) { return dynamicRegistration == other.dynamicRegistration && - symbolKind == other.symbolKind && hierarchicalDocumentSymbolSupport == other.hierarchicalDocumentSymbolSupport && - tagSupport == other.tagSupport && labelSupport == other.labelSupport && + symbolKind == other.symbolKind && + tagSupport == other.tagSupport && true; } return false; @@ -16084,10 +16084,10 @@ class DocumentSymbolClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( dynamicRegistration, - symbolKind, hierarchicalDocumentSymbolSupport, - tagSupport, labelSupport, + symbolKind, + tagSupport, ); @override @@ -16346,11 +16346,19 @@ class DocumentSymbolParams ); DocumentSymbolParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static DocumentSymbolParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -16362,18 +16370,10 @@ class DocumentSymbolParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return DocumentSymbolParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -16389,18 +16389,29 @@ class DocumentSymbolParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -16430,17 +16441,6 @@ class DocumentSymbolParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type DocumentSymbolParams'); @@ -16452,9 +16452,9 @@ class DocumentSymbolParams bool operator ==(Object other) { if (other is DocumentSymbolParams && other.runtimeType == DocumentSymbolParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -16462,9 +16462,9 @@ class DocumentSymbolParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -16840,16 +16840,16 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { ); ExecuteCommandParams({ - required this.command, this.arguments, + required this.command, this.workDoneToken, }); static ExecuteCommandParams fromJson(Map json) { - final commandJson = json['command']; - final command = commandJson as String; final argumentsJson = json['arguments']; final arguments = (argumentsJson as List?)?.map((item) => item).toList(); + final commandJson = json['command']; + final command = commandJson as String; final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -16859,8 +16859,8 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return ExecuteCommandParams( - command: command, arguments: arguments, + command: command, workDoneToken: workDoneToken, ); } @@ -16876,10 +16876,10 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { Map toJson() { var __result = {}; - __result['command'] = command; if (arguments != null) { __result['arguments'] = arguments; } + __result['command'] = command; if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -16888,6 +16888,18 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('arguments'); + try { + final arguments = obj['arguments']; + if (arguments != null && + !((arguments is List && + (arguments.every((item) => true))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('command'); try { if (!obj.containsKey('command')) { @@ -16906,18 +16918,6 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } - reporter.push('arguments'); - try { - final arguments = obj['arguments']; - if (arguments != null && - !((arguments is List && - (arguments.every((item) => true))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -16940,9 +16940,9 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { bool operator ==(Object other) { if (other is ExecuteCommandParams && other.runtimeType == ExecuteCommandParams) { - return command == other.command && - listEqual( + return listEqual( arguments, other.arguments, (Object? a, Object? b) => a == b) && + command == other.command && workDoneToken == other.workDoneToken && true; } @@ -16951,8 +16951,8 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { @override int get hashCode => Object.hash( - command, lspHashCode(arguments), + command, workDoneToken, ); @@ -17377,17 +17377,17 @@ class FileEvent implements ToJsonable { ); FileEvent({ - required this.uri, required this.type, + required this.uri, }); static FileEvent fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final typeJson = json['type']; final type = typeJson as int; + final uriJson = json['uri']; + final uri = uriJson as String; return FileEvent( - uri: uri, type: type, + uri: uri, ); } @@ -17399,31 +17399,13 @@ class FileEvent implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; __result['type'] = type; + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('type'); try { if (!obj.containsKey('type')) { @@ -17442,6 +17424,24 @@ class FileEvent implements ToJsonable { } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FileEvent'); @@ -17452,15 +17452,15 @@ class FileEvent implements ToJsonable { @override bool operator ==(Object other) { if (other is FileEvent && other.runtimeType == FileEvent) { - return uri == other.uri && type == other.type && true; + return type == other.type && uri == other.uri && true; } return false; } @override int get hashCode => Object.hash( - uri, type, + uri, ); @override @@ -17477,18 +17477,18 @@ class FileOperationFilter implements ToJsonable { ); FileOperationFilter({ - this.scheme, required this.pattern, + this.scheme, }); static FileOperationFilter fromJson(Map json) { - final schemeJson = json['scheme']; - final scheme = schemeJson as String?; final patternJson = json['pattern']; final pattern = FileOperationPattern.fromJson(patternJson as Map); + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; return FileOperationFilter( - scheme: scheme, pattern: pattern, + scheme: scheme, ); } @@ -17500,25 +17500,15 @@ class FileOperationFilter implements ToJsonable { Map toJson() { var __result = {}; + __result['pattern'] = pattern.toJson(); if (scheme != null) { __result['scheme'] = scheme; } - __result['pattern'] = pattern.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('scheme'); - try { - final scheme = obj['scheme']; - if (scheme != null && !(scheme is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('pattern'); try { if (!obj.containsKey('pattern')) { @@ -17537,6 +17527,16 @@ class FileOperationFilter implements ToJsonable { } finally { reporter.pop(); } + reporter.push('scheme'); + try { + final scheme = obj['scheme']; + if (scheme != null && !(scheme is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FileOperationFilter'); @@ -17548,15 +17548,15 @@ class FileOperationFilter implements ToJsonable { bool operator ==(Object other) { if (other is FileOperationFilter && other.runtimeType == FileOperationFilter) { - return scheme == other.scheme && pattern == other.pattern && true; + return pattern == other.pattern && scheme == other.scheme && true; } return false; } @override int get hashCode => Object.hash( - scheme, pattern, + scheme, ); @override @@ -17883,17 +17883,17 @@ class FileRename implements ToJsonable { ); FileRename({ - required this.oldUri, required this.newUri, + required this.oldUri, }); static FileRename fromJson(Map json) { - final oldUriJson = json['oldUri']; - final oldUri = oldUriJson as String; final newUriJson = json['newUri']; final newUri = newUriJson as String; + final oldUriJson = json['oldUri']; + final oldUri = oldUriJson as String; return FileRename( - oldUri: oldUri, newUri: newUri, + oldUri: oldUri, ); } @@ -17905,31 +17905,13 @@ class FileRename implements ToJsonable { Map toJson() { var __result = {}; - __result['oldUri'] = oldUri; __result['newUri'] = newUri; + __result['oldUri'] = oldUri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('oldUri'); - try { - if (!obj.containsKey('oldUri')) { - reporter.reportError('must not be undefined'); - return false; - } - final oldUri = obj['oldUri']; - if (oldUri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(oldUri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('newUri'); try { if (!obj.containsKey('newUri')) { @@ -17948,6 +17930,24 @@ class FileRename implements ToJsonable { } finally { reporter.pop(); } + reporter.push('oldUri'); + try { + if (!obj.containsKey('oldUri')) { + reporter.reportError('must not be undefined'); + return false; + } + final oldUri = obj['oldUri']; + if (oldUri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(oldUri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FileRename'); @@ -17958,15 +17958,15 @@ class FileRename implements ToJsonable { @override bool operator ==(Object other) { if (other is FileRename && other.runtimeType == FileRename) { - return oldUri == other.oldUri && newUri == other.newUri && true; + return newUri == other.newUri && oldUri == other.oldUri && true; } return false; } @override int get hashCode => Object.hash( - oldUri, newUri, + oldUri, ); @override @@ -18084,34 +18084,34 @@ class FoldingRange implements ToJsonable { ); FoldingRange({ - required this.startLine, - this.startCharacter, - required this.endLine, - this.endCharacter, - this.kind, this.collapsedText, + this.endCharacter, + required this.endLine, + this.kind, + this.startCharacter, + required this.startLine, }); static FoldingRange fromJson(Map json) { - final startLineJson = json['startLine']; - final startLine = startLineJson as int; - final startCharacterJson = json['startCharacter']; - final startCharacter = startCharacterJson as int?; - final endLineJson = json['endLine']; - final endLine = endLineJson as int; + final collapsedTextJson = json['collapsedText']; + final collapsedText = collapsedTextJson as String?; final endCharacterJson = json['endCharacter']; final endCharacter = endCharacterJson as int?; + final endLineJson = json['endLine']; + final endLine = endLineJson as int; final kindJson = json['kind']; final kind = kindJson != null ? FoldingRangeKind.fromJson(kindJson as String) : null; - final collapsedTextJson = json['collapsedText']; - final collapsedText = collapsedTextJson as String?; + final startCharacterJson = json['startCharacter']; + final startCharacter = startCharacterJson as int?; + final startLineJson = json['startLine']; + final startLine = startLineJson as int; return FoldingRange( - startLine: startLine, - startCharacter: startCharacter, - endLine: endLine, - endCharacter: endCharacter, - kind: kind, collapsedText: collapsedText, + endCharacter: endCharacter, + endLine: endLine, + kind: kind, + startCharacter: startCharacter, + startLine: startLine, ); } @@ -18147,47 +18147,39 @@ class FoldingRange implements ToJsonable { Map toJson() { var __result = {}; - __result['startLine'] = startLine; - if (startCharacter != null) { - __result['startCharacter'] = startCharacter; - } - __result['endLine'] = endLine; - if (endCharacter != null) { - __result['endCharacter'] = endCharacter; - } - if (kind != null) { - __result['kind'] = kind?.toJson(); - } if (collapsedText != null) { __result['collapsedText'] = collapsedText; } + if (endCharacter != null) { + __result['endCharacter'] = endCharacter; + } + __result['endLine'] = endLine; + if (kind != null) { + __result['kind'] = kind?.toJson(); + } + if (startCharacter != null) { + __result['startCharacter'] = startCharacter; + } + __result['startLine'] = startLine; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('startLine'); + reporter.push('collapsedText'); try { - if (!obj.containsKey('startLine')) { - reporter.reportError('must not be undefined'); - return false; - } - final startLine = obj['startLine']; - if (startLine == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(startLine is int)) { - reporter.reportError('must be of type int'); + final collapsedText = obj['collapsedText']; + if (collapsedText != null && !(collapsedText is String)) { + reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } - reporter.push('startCharacter'); + reporter.push('endCharacter'); try { - final startCharacter = obj['startCharacter']; - if (startCharacter != null && !(startCharacter is int)) { + final endCharacter = obj['endCharacter']; + if (endCharacter != null && !(endCharacter is int)) { reporter.reportError('must be of type int'); return false; } @@ -18212,16 +18204,6 @@ class FoldingRange implements ToJsonable { } finally { reporter.pop(); } - reporter.push('endCharacter'); - try { - final endCharacter = obj['endCharacter']; - if (endCharacter != null && !(endCharacter is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('kind'); try { final kind = obj['kind']; @@ -18232,11 +18214,29 @@ class FoldingRange implements ToJsonable { } finally { reporter.pop(); } - reporter.push('collapsedText'); + reporter.push('startCharacter'); try { - final collapsedText = obj['collapsedText']; - if (collapsedText != null && !(collapsedText is String)) { - reporter.reportError('must be of type String'); + final startCharacter = obj['startCharacter']; + if (startCharacter != null && !(startCharacter is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('startLine'); + try { + if (!obj.containsKey('startLine')) { + reporter.reportError('must not be undefined'); + return false; + } + final startLine = obj['startLine']; + if (startLine == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(startLine is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -18252,12 +18252,12 @@ class FoldingRange implements ToJsonable { @override bool operator ==(Object other) { if (other is FoldingRange && other.runtimeType == FoldingRange) { - return startLine == other.startLine && - startCharacter == other.startCharacter && - endLine == other.endLine && + return collapsedText == other.collapsedText && endCharacter == other.endCharacter && + endLine == other.endLine && kind == other.kind && - collapsedText == other.collapsedText && + startCharacter == other.startCharacter && + startLine == other.startLine && true; } return false; @@ -18265,12 +18265,12 @@ class FoldingRange implements ToJsonable { @override int get hashCode => Object.hash( - startLine, - startCharacter, - endLine, - endCharacter, - kind, collapsedText, + endCharacter, + endLine, + kind, + startCharacter, + startLine, ); @override @@ -18285,34 +18285,34 @@ class FoldingRangeClientCapabilities implements ToJsonable { FoldingRangeClientCapabilities({ this.dynamicRegistration, - this.rangeLimit, - this.lineFoldingOnly, - this.foldingRangeKind, this.foldingRange, + this.foldingRangeKind, + this.lineFoldingOnly, + this.rangeLimit, }); static FoldingRangeClientCapabilities fromJson(Map json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; - final rangeLimitJson = json['rangeLimit']; - final rangeLimit = rangeLimitJson as int?; - final lineFoldingOnlyJson = json['lineFoldingOnly']; - final lineFoldingOnly = lineFoldingOnlyJson as bool?; - final foldingRangeKindJson = json['foldingRangeKind']; - final foldingRangeKind = foldingRangeKindJson != null - ? FoldingRangeClientCapabilitiesFoldingRangeKind.fromJson( - foldingRangeKindJson as Map) - : null; final foldingRangeJson = json['foldingRange']; final foldingRange = foldingRangeJson != null ? FoldingRangeClientCapabilitiesFoldingRange.fromJson( foldingRangeJson as Map) : null; + final foldingRangeKindJson = json['foldingRangeKind']; + final foldingRangeKind = foldingRangeKindJson != null + ? FoldingRangeClientCapabilitiesFoldingRangeKind.fromJson( + foldingRangeKindJson as Map) + : null; + final lineFoldingOnlyJson = json['lineFoldingOnly']; + final lineFoldingOnly = lineFoldingOnlyJson as bool?; + final rangeLimitJson = json['rangeLimit']; + final rangeLimit = rangeLimitJson as int?; return FoldingRangeClientCapabilities( dynamicRegistration: dynamicRegistration, - rangeLimit: rangeLimit, - lineFoldingOnly: lineFoldingOnly, - foldingRangeKind: foldingRangeKind, foldingRange: foldingRange, + foldingRangeKind: foldingRangeKind, + lineFoldingOnly: lineFoldingOnly, + rangeLimit: rangeLimit, ); } @@ -18344,17 +18344,17 @@ class FoldingRangeClientCapabilities implements ToJsonable { if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } - if (rangeLimit != null) { - __result['rangeLimit'] = rangeLimit; - } - if (lineFoldingOnly != null) { - __result['lineFoldingOnly'] = lineFoldingOnly; + if (foldingRange != null) { + __result['foldingRange'] = foldingRange?.toJson(); } if (foldingRangeKind != null) { __result['foldingRangeKind'] = foldingRangeKind?.toJson(); } - if (foldingRange != null) { - __result['foldingRange'] = foldingRange?.toJson(); + if (lineFoldingOnly != null) { + __result['lineFoldingOnly'] = lineFoldingOnly; + } + if (rangeLimit != null) { + __result['rangeLimit'] = rangeLimit; } return __result; } @@ -18371,39 +18371,6 @@ class FoldingRangeClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('rangeLimit'); - try { - final rangeLimit = obj['rangeLimit']; - if (rangeLimit != null && !(rangeLimit is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('lineFoldingOnly'); - try { - final lineFoldingOnly = obj['lineFoldingOnly']; - if (lineFoldingOnly != null && !(lineFoldingOnly is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('foldingRangeKind'); - try { - final foldingRangeKind = obj['foldingRangeKind']; - if (foldingRangeKind != null && - !(FoldingRangeClientCapabilitiesFoldingRangeKind.canParse( - foldingRangeKind, reporter))) { - reporter.reportError( - 'must be of type FoldingRangeClientCapabilitiesFoldingRangeKind'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('foldingRange'); try { final foldingRange = obj['foldingRange']; @@ -18417,6 +18384,39 @@ class FoldingRangeClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('foldingRangeKind'); + try { + final foldingRangeKind = obj['foldingRangeKind']; + if (foldingRangeKind != null && + !(FoldingRangeClientCapabilitiesFoldingRangeKind.canParse( + foldingRangeKind, reporter))) { + reporter.reportError( + 'must be of type FoldingRangeClientCapabilitiesFoldingRangeKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('lineFoldingOnly'); + try { + final lineFoldingOnly = obj['lineFoldingOnly']; + if (lineFoldingOnly != null && !(lineFoldingOnly is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('rangeLimit'); + try { + final rangeLimit = obj['rangeLimit']; + if (rangeLimit != null && !(rangeLimit is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FoldingRangeClientCapabilities'); @@ -18429,10 +18429,10 @@ class FoldingRangeClientCapabilities implements ToJsonable { if (other is FoldingRangeClientCapabilities && other.runtimeType == FoldingRangeClientCapabilities) { return dynamicRegistration == other.dynamicRegistration && - rangeLimit == other.rangeLimit && - lineFoldingOnly == other.lineFoldingOnly && - foldingRangeKind == other.foldingRangeKind && foldingRange == other.foldingRange && + foldingRangeKind == other.foldingRangeKind && + lineFoldingOnly == other.lineFoldingOnly && + rangeLimit == other.rangeLimit && true; } return false; @@ -18441,10 +18441,10 @@ class FoldingRangeClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( dynamicRegistration, - rangeLimit, - lineFoldingOnly, - foldingRangeKind, foldingRange, + foldingRangeKind, + lineFoldingOnly, + rangeLimit, ); @override @@ -18696,11 +18696,19 @@ class FoldingRangeParams ); FoldingRangeParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static FoldingRangeParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -18712,18 +18720,10 @@ class FoldingRangeParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return FoldingRangeParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -18739,18 +18739,29 @@ class FoldingRangeParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -18780,17 +18791,6 @@ class FoldingRangeParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type FoldingRangeParams'); @@ -18802,9 +18802,9 @@ class FoldingRangeParams bool operator ==(Object other) { if (other is FoldingRangeParams && other.runtimeType == FoldingRangeParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -18812,9 +18812,9 @@ class FoldingRangeParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -18834,22 +18834,22 @@ class FoldingRangeRegistrationOptions FoldingRangeRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static FoldingRangeRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return FoldingRangeRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -18865,12 +18865,12 @@ class FoldingRangeRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -18893,16 +18893,6 @@ class FoldingRangeRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -18913,6 +18903,16 @@ class FoldingRangeRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FoldingRangeRegistrationOptions'); @@ -18926,8 +18926,8 @@ class FoldingRangeRegistrationOptions other.runtimeType == FoldingRangeRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -18936,8 +18936,8 @@ class FoldingRangeRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -18952,29 +18952,29 @@ class FormattingOptions implements ToJsonable { ); FormattingOptions({ - required this.tabSize, - required this.insertSpaces, - this.trimTrailingWhitespace, this.insertFinalNewline, + required this.insertSpaces, + required this.tabSize, this.trimFinalNewlines, + this.trimTrailingWhitespace, }); static FormattingOptions fromJson(Map json) { - final tabSizeJson = json['tabSize']; - final tabSize = tabSizeJson as int; - final insertSpacesJson = json['insertSpaces']; - final insertSpaces = insertSpacesJson as bool; - final trimTrailingWhitespaceJson = json['trimTrailingWhitespace']; - final trimTrailingWhitespace = trimTrailingWhitespaceJson as bool?; final insertFinalNewlineJson = json['insertFinalNewline']; final insertFinalNewline = insertFinalNewlineJson as bool?; + final insertSpacesJson = json['insertSpaces']; + final insertSpaces = insertSpacesJson as bool; + final tabSizeJson = json['tabSize']; + final tabSize = tabSizeJson as int; final trimFinalNewlinesJson = json['trimFinalNewlines']; final trimFinalNewlines = trimFinalNewlinesJson as bool?; + final trimTrailingWhitespaceJson = json['trimTrailingWhitespace']; + final trimTrailingWhitespace = trimTrailingWhitespaceJson as bool?; return FormattingOptions( - tabSize: tabSize, - insertSpaces: insertSpaces, - trimTrailingWhitespace: trimTrailingWhitespace, insertFinalNewline: insertFinalNewline, + insertSpaces: insertSpaces, + tabSize: tabSize, trimFinalNewlines: trimFinalNewlines, + trimTrailingWhitespace: trimTrailingWhitespace, ); } @@ -18998,35 +18998,27 @@ class FormattingOptions implements ToJsonable { Map toJson() { var __result = {}; - __result['tabSize'] = tabSize; - __result['insertSpaces'] = insertSpaces; - if (trimTrailingWhitespace != null) { - __result['trimTrailingWhitespace'] = trimTrailingWhitespace; - } if (insertFinalNewline != null) { __result['insertFinalNewline'] = insertFinalNewline; } + __result['insertSpaces'] = insertSpaces; + __result['tabSize'] = tabSize; if (trimFinalNewlines != null) { __result['trimFinalNewlines'] = trimFinalNewlines; } + if (trimTrailingWhitespace != null) { + __result['trimTrailingWhitespace'] = trimTrailingWhitespace; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('tabSize'); + reporter.push('insertFinalNewline'); try { - if (!obj.containsKey('tabSize')) { - reporter.reportError('must not be undefined'); - return false; - } - final tabSize = obj['tabSize']; - if (tabSize == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(tabSize is int)) { - reporter.reportError('must be of type int'); + final insertFinalNewline = obj['insertFinalNewline']; + if (insertFinalNewline != null && !(insertFinalNewline is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -19050,22 +19042,19 @@ class FormattingOptions implements ToJsonable { } finally { reporter.pop(); } - reporter.push('trimTrailingWhitespace'); + reporter.push('tabSize'); try { - final trimTrailingWhitespace = obj['trimTrailingWhitespace']; - if (trimTrailingWhitespace != null && - !(trimTrailingWhitespace is bool)) { - reporter.reportError('must be of type bool'); + if (!obj.containsKey('tabSize')) { + reporter.reportError('must not be undefined'); return false; } - } finally { - reporter.pop(); - } - reporter.push('insertFinalNewline'); - try { - final insertFinalNewline = obj['insertFinalNewline']; - if (insertFinalNewline != null && !(insertFinalNewline is bool)) { - reporter.reportError('must be of type bool'); + final tabSize = obj['tabSize']; + if (tabSize == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(tabSize is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -19081,6 +19070,17 @@ class FormattingOptions implements ToJsonable { } finally { reporter.pop(); } + reporter.push('trimTrailingWhitespace'); + try { + final trimTrailingWhitespace = obj['trimTrailingWhitespace']; + if (trimTrailingWhitespace != null && + !(trimTrailingWhitespace is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type FormattingOptions'); @@ -19091,11 +19091,11 @@ class FormattingOptions implements ToJsonable { @override bool operator ==(Object other) { if (other is FormattingOptions && other.runtimeType == FormattingOptions) { - return tabSize == other.tabSize && + return insertFinalNewline == other.insertFinalNewline && insertSpaces == other.insertSpaces && - trimTrailingWhitespace == other.trimTrailingWhitespace && - insertFinalNewline == other.insertFinalNewline && + tabSize == other.tabSize && trimFinalNewlines == other.trimFinalNewlines && + trimTrailingWhitespace == other.trimTrailingWhitespace && true; } return false; @@ -19103,11 +19103,11 @@ class FormattingOptions implements ToJsonable { @override int get hashCode => Object.hash( - tabSize, - insertSpaces, - trimTrailingWhitespace, insertFinalNewline, + insertSpaces, + tabSize, trimFinalNewlines, + trimTrailingWhitespace, ); @override @@ -19123,9 +19123,9 @@ class FullDocumentDiagnosticReport implements ToJsonable { ); FullDocumentDiagnosticReport({ + required this.items, this.kind = 'full', this.resultId, - required this.items, }) { if (kind != 'full') { throw 'kind may only be the literal \'full\''; @@ -19140,18 +19140,18 @@ class FullDocumentDiagnosticReport implements ToJsonable { json, nullLspJsonReporter)) { return WorkspaceFullDocumentDiagnosticReport.fromJson(json); } - final kindJson = json['kind']; - final kind = kindJson as String; - final resultIdJson = json['resultId']; - final resultId = resultIdJson as String?; final itemsJson = json['items']; final items = (itemsJson as List) .map((item) => Diagnostic.fromJson(item as Map)) .toList(); + final kindJson = json['kind']; + final kind = kindJson as String; + final resultIdJson = json['resultId']; + final resultId = resultIdJson as String?; return FullDocumentDiagnosticReport( + items: items, kind: kind, resultId: resultId, - items: items, ); } @@ -19167,16 +19167,35 @@ class FullDocumentDiagnosticReport implements ToJsonable { Map toJson() { var __result = {}; + __result['items'] = items.map((item) => item.toJson()).toList(); __result['kind'] = kind; if (resultId != null) { __result['resultId'] = resultId; } - __result['items'] = items.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('items'); + try { + if (!obj.containsKey('items')) { + reporter.reportError('must not be undefined'); + return false; + } + final items = obj['items']; + if (items == null) { + reporter.reportError('must not be null'); + return false; + } + if (!((items is List && + (items.every((item) => Diagnostic.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -19205,25 +19224,6 @@ class FullDocumentDiagnosticReport implements ToJsonable { } finally { reporter.pop(); } - reporter.push('items'); - try { - if (!obj.containsKey('items')) { - reporter.reportError('must not be undefined'); - return false; - } - final items = obj['items']; - if (items == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((items is List && - (items.every((item) => Diagnostic.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type FullDocumentDiagnosticReport'); @@ -19235,10 +19235,10 @@ class FullDocumentDiagnosticReport implements ToJsonable { bool operator ==(Object other) { if (other is FullDocumentDiagnosticReport && other.runtimeType == FullDocumentDiagnosticReport) { - return kind == other.kind && - resultId == other.resultId && - listEqual( + return listEqual( items, other.items, (Diagnostic a, Diagnostic b) => a == b) && + kind == other.kind && + resultId == other.resultId && true; } return false; @@ -19246,9 +19246,9 @@ class FullDocumentDiagnosticReport implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(items), kind, resultId, - lspHashCode(items), ); @override @@ -19364,19 +19364,19 @@ class HoverClientCapabilities implements ToJsonable { ); HoverClientCapabilities({ - this.dynamicRegistration, this.contentFormat, + this.dynamicRegistration, }); static HoverClientCapabilities fromJson(Map json) { - final dynamicRegistrationJson = json['dynamicRegistration']; - final dynamicRegistration = dynamicRegistrationJson as bool?; final contentFormatJson = json['contentFormat']; final contentFormat = (contentFormatJson as List?) ?.map((item) => MarkupKind.fromJson(item as String)) .toList(); + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; return HoverClientCapabilities( - dynamicRegistration: dynamicRegistration, contentFormat: contentFormat, + dynamicRegistration: dynamicRegistration, ); } @@ -19390,28 +19390,18 @@ class HoverClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (dynamicRegistration != null) { - __result['dynamicRegistration'] = dynamicRegistration; - } if (contentFormat != null) { __result['contentFormat'] = contentFormat?.map((item) => item.toJson()).toList(); } + if (dynamicRegistration != null) { + __result['dynamicRegistration'] = dynamicRegistration; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('dynamicRegistration'); - try { - final dynamicRegistration = obj['dynamicRegistration']; - if (dynamicRegistration != null && !(dynamicRegistration is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('contentFormat'); try { final contentFormat = obj['contentFormat']; @@ -19425,6 +19415,16 @@ class HoverClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('dynamicRegistration'); + try { + final dynamicRegistration = obj['dynamicRegistration']; + if (dynamicRegistration != null && !(dynamicRegistration is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type HoverClientCapabilities'); @@ -19436,9 +19436,9 @@ class HoverClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is HoverClientCapabilities && other.runtimeType == HoverClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && - listEqual(contentFormat, other.contentFormat, + return listEqual(contentFormat, other.contentFormat, (MarkupKind a, MarkupKind b) => a == b) && + dynamicRegistration == other.dynamicRegistration && true; } return false; @@ -19446,8 +19446,8 @@ class HoverClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - dynamicRegistration, lspHashCode(contentFormat), + dynamicRegistration, ); @override @@ -19526,16 +19526,16 @@ class HoverParams ); HoverParams({ - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static HoverParams fromJson(Map json) { + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -19545,8 +19545,8 @@ class HoverParams ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return HoverParams( - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -19562,8 +19562,8 @@ class HoverParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -19572,24 +19572,6 @@ class HoverParams static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -19608,6 +19590,24 @@ class HoverParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -19629,8 +19629,8 @@ class HoverParams @override bool operator ==(Object other) { if (other is HoverParams && other.runtimeType == HoverParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -19639,8 +19639,8 @@ class HoverParams @override int get hashCode => Object.hash( - textDocument, position, + textDocument, workDoneToken, ); @@ -19655,17 +19655,17 @@ class HoverParamsPosition implements ToJsonable { ); HoverParamsPosition({ - required this.line, required this.character, + required this.line, }); static HoverParamsPosition fromJson(Map json) { - final lineJson = json['line']; - final line = lineJson as int; final characterJson = json['character']; final character = characterJson as int; + final lineJson = json['line']; + final line = lineJson as int; return HoverParamsPosition( - line: line, character: character, + line: line, ); } @@ -19674,31 +19674,13 @@ class HoverParamsPosition implements ToJsonable { Map toJson() { var __result = {}; - __result['line'] = line; __result['character'] = character; + __result['line'] = line; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('line'); - try { - if (!obj.containsKey('line')) { - reporter.reportError('must not be undefined'); - return false; - } - final line = obj['line']; - if (line == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(line is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('character'); try { if (!obj.containsKey('character')) { @@ -19717,6 +19699,24 @@ class HoverParamsPosition implements ToJsonable { } finally { reporter.pop(); } + reporter.push('line'); + try { + if (!obj.containsKey('line')) { + reporter.reportError('must not be undefined'); + return false; + } + final line = obj['line']; + if (line == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(line is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type HoverParamsPosition'); @@ -19728,15 +19728,15 @@ class HoverParamsPosition implements ToJsonable { bool operator ==(Object other) { if (other is HoverParamsPosition && other.runtimeType == HoverParamsPosition) { - return line == other.line && character == other.character && true; + return character == other.character && line == other.line && true; } return false; } @override int get hashCode => Object.hash( - line, character, + line, ); @override @@ -20074,25 +20074,12 @@ class ImplementationParams ); ImplementationParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static ImplementationParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -20101,11 +20088,24 @@ class ImplementationParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return ImplementationParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -20124,32 +20124,25 @@ class ImplementationParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -20173,22 +20166,29 @@ class ImplementationParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -20206,10 +20206,10 @@ class ImplementationParams bool operator ==(Object other) { if (other is ImplementationParams && other.runtimeType == ImplementationParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -20217,10 +20217,10 @@ class ImplementationParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -20240,22 +20240,22 @@ class ImplementationRegistrationOptions ImplementationRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static ImplementationRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return ImplementationRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -20271,12 +20271,12 @@ class ImplementationRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -20299,16 +20299,6 @@ class ImplementationRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -20319,6 +20309,16 @@ class ImplementationRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ImplementationRegistrationOptions'); @@ -20332,8 +20332,8 @@ class ImplementationRegistrationOptions other.runtimeType == ImplementationRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -20342,8 +20342,8 @@ class ImplementationRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -20379,44 +20379,40 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { ); InitializeParams({ - this.processId, + required this.capabilities, this.clientInfo, + this.initializationOptions, this.locale, + this.processId, this.rootPath, this.rootUri, - this.initializationOptions, - required this.capabilities, this.trace, - this.workspaceFolders, this.workDoneToken, + this.workspaceFolders, }); static InitializeParams fromJson(Map json) { - final processIdJson = json['processId']; - final processId = processIdJson as int?; + final capabilitiesJson = json['capabilities']; + final capabilities = + ClientCapabilities.fromJson(capabilitiesJson as Map); final clientInfoJson = json['clientInfo']; final clientInfo = clientInfoJson != null ? InitializeParamsClientInfo.fromJson( clientInfoJson as Map) : null; + final initializationOptionsJson = json['initializationOptions']; + final initializationOptions = initializationOptionsJson; final localeJson = json['locale']; final locale = localeJson as String?; + final processIdJson = json['processId']; + final processId = processIdJson as int?; final rootPathJson = json['rootPath']; final rootPath = rootPathJson as String?; final rootUriJson = json['rootUri']; final rootUri = rootUriJson as String?; - final initializationOptionsJson = json['initializationOptions']; - final initializationOptions = initializationOptionsJson; - final capabilitiesJson = json['capabilities']; - final capabilities = - ClientCapabilities.fromJson(capabilitiesJson as Map); final traceJson = json['trace']; final trace = const {null, 'off', 'messages', 'verbose'}.contains(traceJson) ? traceJson as String? : throw '''$traceJson was not one of (null, 'off', 'messages', 'verbose')'''; - final workspaceFoldersJson = json['workspaceFolders']; - final workspaceFolders = (workspaceFoldersJson as List?) - ?.map((item) => WorkspaceFolder.fromJson(item as Map)) - .toList(); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -20425,17 +20421,21 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); + final workspaceFoldersJson = json['workspaceFolders']; + final workspaceFolders = (workspaceFoldersJson as List?) + ?.map((item) => WorkspaceFolder.fromJson(item as Map)) + .toList(); return InitializeParams( - processId: processId, + capabilities: capabilities, clientInfo: clientInfo, + initializationOptions: initializationOptions, locale: locale, + processId: processId, rootPath: rootPath, rootUri: rootUri, - initializationOptions: initializationOptions, - capabilities: capabilities, trace: trace, - workspaceFolders: workspaceFolders, workDoneToken: workDoneToken, + workspaceFolders: workspaceFolders, ); } @@ -20487,45 +20487,49 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { Map toJson() { var __result = {}; - __result['processId'] = processId; + __result['capabilities'] = capabilities.toJson(); if (clientInfo != null) { __result['clientInfo'] = clientInfo?.toJson(); } + if (initializationOptions != null) { + __result['initializationOptions'] = initializationOptions; + } if (locale != null) { __result['locale'] = locale; } + __result['processId'] = processId; if (rootPath != null) { __result['rootPath'] = rootPath; } __result['rootUri'] = rootUri; - if (initializationOptions != null) { - __result['initializationOptions'] = initializationOptions; - } - __result['capabilities'] = capabilities.toJson(); if (trace != null) { __result['trace'] = trace; } + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } if (workspaceFolders != null) { __result['workspaceFolders'] = workspaceFolders?.map((item) => item.toJson()).toList(); } - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('processId'); + reporter.push('capabilities'); try { - if (!obj.containsKey('processId')) { + if (!obj.containsKey('capabilities')) { reporter.reportError('must not be undefined'); return false; } - final processId = obj['processId']; - if (processId != null && !(processId is int)) { - reporter.reportError('must be of type int'); + final capabilities = obj['capabilities']; + if (capabilities == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(ClientCapabilities.canParse(capabilities, reporter))) { + reporter.reportError('must be of type ClientCapabilities'); return false; } } finally { @@ -20552,6 +20556,20 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } + reporter.push('processId'); + try { + if (!obj.containsKey('processId')) { + reporter.reportError('must not be undefined'); + return false; + } + final processId = obj['processId']; + if (processId != null && !(processId is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('rootPath'); try { final rootPath = obj['rootPath']; @@ -20576,24 +20594,6 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } - reporter.push('capabilities'); - try { - if (!obj.containsKey('capabilities')) { - reporter.reportError('must not be undefined'); - return false; - } - final capabilities = obj['capabilities']; - if (capabilities == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(ClientCapabilities.canParse(capabilities, reporter))) { - reporter.reportError('must be of type ClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('trace'); try { final trace = obj['trace']; @@ -20606,6 +20606,17 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } + reporter.push('workDoneToken'); + try { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workspaceFolders'); try { final workspaceFolders = obj['workspaceFolders']; @@ -20619,17 +20630,6 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } - reporter.push('workDoneToken'); - try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type InitializeParams'); @@ -20640,17 +20640,17 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { @override bool operator ==(Object other) { if (other is InitializeParams && other.runtimeType == InitializeParams) { - return processId == other.processId && + return capabilities == other.capabilities && clientInfo == other.clientInfo && + initializationOptions == other.initializationOptions && locale == other.locale && + processId == other.processId && rootPath == other.rootPath && rootUri == other.rootUri && - initializationOptions == other.initializationOptions && - capabilities == other.capabilities && trace == other.trace && + workDoneToken == other.workDoneToken && listEqual(workspaceFolders, other.workspaceFolders, (WorkspaceFolder a, WorkspaceFolder b) => a == b) && - workDoneToken == other.workDoneToken && true; } return false; @@ -20658,16 +20658,16 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { @override int get hashCode => Object.hash( - processId, + capabilities, clientInfo, + initializationOptions, locale, + processId, rootPath, rootUri, - initializationOptions, - capabilities, trace, - lspHashCode(workspaceFolders), workDoneToken, + lspHashCode(workspaceFolders), ); @override @@ -21005,18 +21005,21 @@ class InlayHint implements ToJsonable { ); InlayHint({ - required this.position, - required this.label, + this.data, this.kind, - this.textEdits, - this.tooltip, + required this.label, this.paddingLeft, this.paddingRight, - this.data, + required this.position, + this.textEdits, + this.tooltip, }); static InlayHint fromJson(Map json) { - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); + final dataJson = json['data']; + final data = dataJson; + final kindJson = json['kind']; + final kind = + kindJson != null ? InlayHintKind.fromJson(kindJson as int) : null; final labelJson = json['label']; final label = (labelJson is List && (labelJson.every((item) => @@ -21028,9 +21031,12 @@ class InlayHint implements ToJsonable { : (labelJson is String ? Either2, String>.t2(labelJson) : (throw '''$labelJson was not one of (List, String)''')); - final kindJson = json['kind']; - final kind = - kindJson != null ? InlayHintKind.fromJson(kindJson as int) : null; + final paddingLeftJson = json['paddingLeft']; + final paddingLeft = paddingLeftJson as bool?; + final paddingRightJson = json['paddingRight']; + final paddingRight = paddingRightJson as bool?; + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textEditsJson = json['textEdits']; final textEdits = (textEditsJson as List?) ?.map((item) => TextEdit.fromJson(item as Map)) @@ -21044,21 +21050,15 @@ class InlayHint implements ToJsonable { : (tooltipJson is String ? Either2.t2(tooltipJson) : (throw '''$tooltipJson was not one of (MarkupContent, String)'''))); - final paddingLeftJson = json['paddingLeft']; - final paddingLeft = paddingLeftJson as bool?; - final paddingRightJson = json['paddingRight']; - final paddingRight = paddingRightJson as bool?; - final dataJson = json['data']; - final data = dataJson; return InlayHint( - position: position, - label: label, + data: data, kind: kind, - textEdits: textEdits, - tooltip: tooltip, + label: label, paddingLeft: paddingLeft, paddingRight: paddingRight, - data: data, + position: position, + textEdits: textEdits, + tooltip: tooltip, ); } @@ -21111,44 +21111,36 @@ class InlayHint implements ToJsonable { Map toJson() { var __result = {}; - __result['position'] = position.toJson(); - __result['label'] = label; + if (data != null) { + __result['data'] = data; + } if (kind != null) { __result['kind'] = kind?.toJson(); } - if (textEdits != null) { - __result['textEdits'] = textEdits?.map((item) => item.toJson()).toList(); - } - if (tooltip != null) { - __result['tooltip'] = tooltip; - } + __result['label'] = label; if (paddingLeft != null) { __result['paddingLeft'] = paddingLeft; } if (paddingRight != null) { __result['paddingRight'] = paddingRight; } - if (data != null) { - __result['data'] = data; + __result['position'] = position.toJson(); + if (textEdits != null) { + __result['textEdits'] = textEdits?.map((item) => item.toJson()).toList(); + } + if (tooltip != null) { + __result['tooltip'] = tooltip; } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('position'); + reporter.push('kind'); try { - if (!obj.containsKey('position')) { - reporter.reportError('must not be undefined'); - return false; - } - final position = obj['position']; - if (position == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Position.canParse(position, reporter))) { - reporter.reportError('must be of type Position'); + final kind = obj['kind']; + if (kind != null && !(InlayHintKind.canParse(kind, reporter))) { + reporter.reportError('must be of type InlayHintKind'); return false; } } finally { @@ -21176,11 +21168,39 @@ class InlayHint implements ToJsonable { } finally { reporter.pop(); } - reporter.push('kind'); + reporter.push('paddingLeft'); try { - final kind = obj['kind']; - if (kind != null && !(InlayHintKind.canParse(kind, reporter))) { - reporter.reportError('must be of type InlayHintKind'); + final paddingLeft = obj['paddingLeft']; + if (paddingLeft != null && !(paddingLeft is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('paddingRight'); + try { + final paddingRight = obj['paddingRight']; + if (paddingRight != null && !(paddingRight is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('position'); + try { + if (!obj.containsKey('position')) { + reporter.reportError('must not be undefined'); + return false; + } + final position = obj['position']; + if (position == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Position.canParse(position, reporter))) { + reporter.reportError('must be of type Position'); return false; } } finally { @@ -21212,26 +21232,6 @@ class InlayHint implements ToJsonable { } finally { reporter.pop(); } - reporter.push('paddingLeft'); - try { - final paddingLeft = obj['paddingLeft']; - if (paddingLeft != null && !(paddingLeft is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('paddingRight'); - try { - final paddingRight = obj['paddingRight']; - if (paddingRight != null && !(paddingRight is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type InlayHint'); @@ -21242,15 +21242,15 @@ class InlayHint implements ToJsonable { @override bool operator ==(Object other) { if (other is InlayHint && other.runtimeType == InlayHint) { - return position == other.position && - label == other.label && + return data == other.data && kind == other.kind && + label == other.label && + paddingLeft == other.paddingLeft && + paddingRight == other.paddingRight && + position == other.position && listEqual( textEdits, other.textEdits, (TextEdit a, TextEdit b) => a == b) && tooltip == other.tooltip && - paddingLeft == other.paddingLeft && - paddingRight == other.paddingRight && - data == other.data && true; } return false; @@ -21258,14 +21258,14 @@ class InlayHint implements ToJsonable { @override int get hashCode => Object.hash( - position, - label, + data, kind, - lspHashCode(textEdits), - tooltip, + label, paddingLeft, paddingRight, - data, + position, + lspHashCode(textEdits), + tooltip, ); @override @@ -21483,14 +21483,20 @@ class InlayHintLabelPart implements ToJsonable { ); InlayHintLabelPart({ - required this.value, - this.tooltip, - this.location, this.command, + this.location, + this.tooltip, + required this.value, }); static InlayHintLabelPart fromJson(Map json) { - final valueJson = json['value']; - final value = valueJson as String; + final commandJson = json['command']; + final command = commandJson != null + ? Command.fromJson(commandJson as Map) + : null; + final locationJson = json['location']; + final location = locationJson != null + ? Location.fromJson(locationJson as Map) + : null; final tooltipJson = json['tooltip']; final tooltip = tooltipJson == null ? null @@ -21500,19 +21506,13 @@ class InlayHintLabelPart implements ToJsonable { : (tooltipJson is String ? Either2.t2(tooltipJson) : (throw '''$tooltipJson was not one of (MarkupContent, String)'''))); - final locationJson = json['location']; - final location = locationJson != null - ? Location.fromJson(locationJson as Map) - : null; - final commandJson = json['command']; - final command = commandJson != null - ? Command.fromJson(commandJson as Map) - : null; + final valueJson = json['value']; + final value = valueJson as String; return InlayHintLabelPart( - value: value, - tooltip: tooltip, - location: location, command: command, + location: location, + tooltip: tooltip, + value: value, ); } @@ -21544,34 +21544,36 @@ class InlayHintLabelPart implements ToJsonable { Map toJson() { var __result = {}; - __result['value'] = value; - if (tooltip != null) { - __result['tooltip'] = tooltip; + if (command != null) { + __result['command'] = command?.toJson(); } if (location != null) { __result['location'] = location?.toJson(); } - if (command != null) { - __result['command'] = command?.toJson(); + if (tooltip != null) { + __result['tooltip'] = tooltip; } + __result['value'] = value; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('value'); + reporter.push('command'); try { - if (!obj.containsKey('value')) { - reporter.reportError('must not be undefined'); + final command = obj['command']; + if (command != null && !(Command.canParse(command, reporter))) { + reporter.reportError('must be of type Command'); return false; } - final value = obj['value']; - if (value == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(value is String)) { - reporter.reportError('must be of type String'); + } finally { + reporter.pop(); + } + reporter.push('location'); + try { + final location = obj['location']; + if (location != null && !(Location.canParse(location, reporter))) { + reporter.reportError('must be of type Location'); return false; } } finally { @@ -21590,21 +21592,19 @@ class InlayHintLabelPart implements ToJsonable { } finally { reporter.pop(); } - reporter.push('location'); + reporter.push('value'); try { - final location = obj['location']; - if (location != null && !(Location.canParse(location, reporter))) { - reporter.reportError('must be of type Location'); + if (!obj.containsKey('value')) { + reporter.reportError('must not be undefined'); return false; } - } finally { - reporter.pop(); - } - reporter.push('command'); - try { - final command = obj['command']; - if (command != null && !(Command.canParse(command, reporter))) { - reporter.reportError('must be of type Command'); + final value = obj['value']; + if (value == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(value is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -21621,10 +21621,10 @@ class InlayHintLabelPart implements ToJsonable { bool operator ==(Object other) { if (other is InlayHintLabelPart && other.runtimeType == InlayHintLabelPart) { - return value == other.value && - tooltip == other.tooltip && + return command == other.command && location == other.location && - command == other.command && + tooltip == other.tooltip && + value == other.value && true; } return false; @@ -21632,10 +21632,10 @@ class InlayHintLabelPart implements ToJsonable { @override int get hashCode => Object.hash( - value, - tooltip, - location, command, + location, + tooltip, + value, ); @override @@ -21742,16 +21742,16 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { ); InlayHintParams({ - required this.textDocument, required this.range, + required this.textDocument, this.workDoneToken, }); static InlayHintParams fromJson(Map json) { + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -21761,8 +21761,8 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return InlayHintParams( - textDocument: textDocument, range: range, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -21778,8 +21778,8 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -21788,24 +21788,6 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -21824,6 +21806,24 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -21845,8 +21845,8 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { @override bool operator ==(Object other) { if (other is InlayHintParams && other.runtimeType == InlayHintParams) { - return textDocument == other.textDocument && - range == other.range && + return range == other.range && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -21855,8 +21855,8 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { @override int get hashCode => Object.hash( - textDocument, range, + textDocument, workDoneToken, ); @@ -21878,27 +21878,27 @@ class InlayHintRegistrationOptions ); InlayHintRegistrationOptions({ - this.resolveProvider, - this.workDoneProgress, this.documentSelector, this.id, + this.resolveProvider, + this.workDoneProgress, }); static InlayHintRegistrationOptions fromJson(Map json) { - final resolveProviderJson = json['resolveProvider']; - final resolveProvider = resolveProviderJson as bool?; - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); final idJson = json['id']; final id = idJson as String?; + final resolveProviderJson = json['resolveProvider']; + final resolveProvider = resolveProviderJson as bool?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return InlayHintRegistrationOptions( - resolveProvider: resolveProvider, - workDoneProgress: workDoneProgress, documentSelector: documentSelector, id: id, + resolveProvider: resolveProvider, + workDoneProgress: workDoneProgress, ); } @@ -21917,41 +21917,21 @@ class InlayHintRegistrationOptions Map toJson() { var __result = {}; + __result['documentSelector'] = documentSelector; + if (id != null) { + __result['id'] = id; + } if (resolveProvider != null) { __result['resolveProvider'] = resolveProvider; } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } - __result['documentSelector'] = documentSelector; - if (id != null) { - __result['id'] = id; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('resolveProvider'); - try { - final resolveProvider = obj['resolveProvider']; - if (resolveProvider != null && !(resolveProvider is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -21979,6 +21959,26 @@ class InlayHintRegistrationOptions } finally { reporter.pop(); } + reporter.push('resolveProvider'); + try { + final resolveProvider = obj['resolveProvider']; + if (resolveProvider != null && !(resolveProvider is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type InlayHintRegistrationOptions'); @@ -21990,11 +21990,11 @@ class InlayHintRegistrationOptions bool operator ==(Object other) { if (other is InlayHintRegistrationOptions && other.runtimeType == InlayHintRegistrationOptions) { - return resolveProvider == other.resolveProvider && - workDoneProgress == other.workDoneProgress && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && id == other.id && + resolveProvider == other.resolveProvider && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -22002,10 +22002,10 @@ class InlayHintRegistrationOptions @override int get hashCode => Object.hash( - resolveProvider, - workDoneProgress, lspHashCode(documentSelector), id, + resolveProvider, + workDoneProgress, ); @override @@ -22237,17 +22237,17 @@ class InlineValueEvaluatableExpression implements ToJsonable { ); InlineValueEvaluatableExpression({ - required this.range, this.expression, + required this.range, }); static InlineValueEvaluatableExpression fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final expressionJson = json['expression']; final expression = expressionJson as String?; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return InlineValueEvaluatableExpression( - range: range, expression: expression, + range: range, ); } @@ -22260,15 +22260,25 @@ class InlineValueEvaluatableExpression implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); if (expression != null) { __result['expression'] = expression; } + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('expression'); + try { + final expression = obj['expression']; + if (expression != null && !(expression is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -22287,16 +22297,6 @@ class InlineValueEvaluatableExpression implements ToJsonable { } finally { reporter.pop(); } - reporter.push('expression'); - try { - final expression = obj['expression']; - if (expression != null && !(expression is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type InlineValueEvaluatableExpression'); @@ -22308,15 +22308,15 @@ class InlineValueEvaluatableExpression implements ToJsonable { bool operator ==(Object other) { if (other is InlineValueEvaluatableExpression && other.runtimeType == InlineValueEvaluatableExpression) { - return range == other.range && expression == other.expression && true; + return expression == other.expression && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, expression, + range, ); @override @@ -22399,20 +22399,20 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { ); InlineValueParams({ - required this.textDocument, - required this.range, required this.context, + required this.range, + required this.textDocument, this.workDoneToken, }); static InlineValueParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final contextJson = json['context']; final context = InlineValueContext.fromJson(contextJson as Map); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -22422,9 +22422,9 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return InlineValueParams( - textDocument: textDocument, - range: range, context: context, + range: range, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -22444,9 +22444,9 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['range'] = range.toJson(); __result['context'] = context.toJson(); + __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -22455,19 +22455,19 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('context'); try { - if (!obj.containsKey('textDocument')) { + if (!obj.containsKey('context')) { reporter.reportError('must not be undefined'); return false; } - final textDocument = obj['textDocument']; - if (textDocument == null) { + final context = obj['context']; + if (context == null) { reporter.reportError('must not be null'); return false; } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + if (!(InlineValueContext.canParse(context, reporter))) { + reporter.reportError('must be of type InlineValueContext'); return false; } } finally { @@ -22491,19 +22491,19 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { } finally { reporter.pop(); } - reporter.push('context'); + reporter.push('textDocument'); try { - if (!obj.containsKey('context')) { + if (!obj.containsKey('textDocument')) { reporter.reportError('must not be undefined'); return false; } - final context = obj['context']; - if (context == null) { + final textDocument = obj['textDocument']; + if (textDocument == null) { reporter.reportError('must not be null'); return false; } - if (!(InlineValueContext.canParse(context, reporter))) { - reporter.reportError('must be of type InlineValueContext'); + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { @@ -22530,9 +22530,9 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { @override bool operator ==(Object other) { if (other is InlineValueParams && other.runtimeType == InlineValueParams) { - return textDocument == other.textDocument && + return context == other.context && range == other.range && - context == other.context && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -22541,9 +22541,9 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { @override int get hashCode => Object.hash( - textDocument, - range, context, + range, + textDocument, workDoneToken, ); @@ -22565,23 +22565,23 @@ class InlineValueRegistrationOptions ); InlineValueRegistrationOptions({ - this.workDoneProgress, this.documentSelector, this.id, + this.workDoneProgress, }); static InlineValueRegistrationOptions fromJson(Map json) { - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return InlineValueRegistrationOptions( - workDoneProgress: workDoneProgress, documentSelector: documentSelector, id: id, + workDoneProgress: workDoneProgress, ); } @@ -22596,28 +22596,18 @@ class InlineValueRegistrationOptions Map toJson() { var __result = {}; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } __result['documentSelector'] = documentSelector; if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -22645,6 +22635,16 @@ class InlineValueRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type InlineValueRegistrationOptions'); @@ -22656,10 +22656,10 @@ class InlineValueRegistrationOptions bool operator ==(Object other) { if (other is InlineValueRegistrationOptions && other.runtimeType == InlineValueRegistrationOptions) { - return workDoneProgress == other.workDoneProgress && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -22667,9 +22667,9 @@ class InlineValueRegistrationOptions @override int get hashCode => Object.hash( - workDoneProgress, lspHashCode(documentSelector), id, + workDoneProgress, ); @override @@ -22789,21 +22789,21 @@ class InlineValueVariableLookup implements ToJsonable { ); InlineValueVariableLookup({ + required this.caseSensitiveLookup, required this.range, this.variableName, - required this.caseSensitiveLookup, }); static InlineValueVariableLookup fromJson(Map json) { + final caseSensitiveLookupJson = json['caseSensitiveLookup']; + final caseSensitiveLookup = caseSensitiveLookupJson as bool; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); final variableNameJson = json['variableName']; final variableName = variableNameJson as String?; - final caseSensitiveLookupJson = json['caseSensitiveLookup']; - final caseSensitiveLookup = caseSensitiveLookupJson as bool; return InlineValueVariableLookup( + caseSensitiveLookup: caseSensitiveLookup, range: range, variableName: variableName, - caseSensitiveLookup: caseSensitiveLookup, ); } @@ -22819,16 +22819,34 @@ class InlineValueVariableLookup implements ToJsonable { Map toJson() { var __result = {}; + __result['caseSensitiveLookup'] = caseSensitiveLookup; __result['range'] = range.toJson(); if (variableName != null) { __result['variableName'] = variableName; } - __result['caseSensitiveLookup'] = caseSensitiveLookup; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('caseSensitiveLookup'); + try { + if (!obj.containsKey('caseSensitiveLookup')) { + reporter.reportError('must not be undefined'); + return false; + } + final caseSensitiveLookup = obj['caseSensitiveLookup']; + if (caseSensitiveLookup == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(caseSensitiveLookup is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -22857,24 +22875,6 @@ class InlineValueVariableLookup implements ToJsonable { } finally { reporter.pop(); } - reporter.push('caseSensitiveLookup'); - try { - if (!obj.containsKey('caseSensitiveLookup')) { - reporter.reportError('must not be undefined'); - return false; - } - final caseSensitiveLookup = obj['caseSensitiveLookup']; - if (caseSensitiveLookup == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(caseSensitiveLookup is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type InlineValueVariableLookup'); @@ -22886,9 +22886,9 @@ class InlineValueVariableLookup implements ToJsonable { bool operator ==(Object other) { if (other is InlineValueVariableLookup && other.runtimeType == InlineValueVariableLookup) { - return range == other.range && + return caseSensitiveLookup == other.caseSensitiveLookup && + range == other.range && variableName == other.variableName && - caseSensitiveLookup == other.caseSensitiveLookup && true; } return false; @@ -22896,9 +22896,9 @@ class InlineValueVariableLookup implements ToJsonable { @override int get hashCode => Object.hash( + caseSensitiveLookup, range, variableName, - caseSensitiveLookup, ); @override @@ -22987,20 +22987,20 @@ class InsertReplaceEdit implements ToJsonable { ); InsertReplaceEdit({ - required this.newText, required this.insert, + required this.newText, required this.replace, }); static InsertReplaceEdit fromJson(Map json) { - final newTextJson = json['newText']; - final newText = newTextJson as String; final insertJson = json['insert']; final insert = Range.fromJson(insertJson as Map); + final newTextJson = json['newText']; + final newText = newTextJson as String; final replaceJson = json['replace']; final replace = Range.fromJson(replaceJson as Map); return InsertReplaceEdit( - newText: newText, insert: insert, + newText: newText, replace: replace, ); } @@ -23016,32 +23016,14 @@ class InsertReplaceEdit implements ToJsonable { Map toJson() { var __result = {}; - __result['newText'] = newText; __result['insert'] = insert.toJson(); + __result['newText'] = newText; __result['replace'] = replace.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('newText'); - try { - if (!obj.containsKey('newText')) { - reporter.reportError('must not be undefined'); - return false; - } - final newText = obj['newText']; - if (newText == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(newText is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('insert'); try { if (!obj.containsKey('insert')) { @@ -23060,6 +23042,24 @@ class InsertReplaceEdit implements ToJsonable { } finally { reporter.pop(); } + reporter.push('newText'); + try { + if (!obj.containsKey('newText')) { + reporter.reportError('must not be undefined'); + return false; + } + final newText = obj['newText']; + if (newText == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(newText is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('replace'); try { if (!obj.containsKey('replace')) { @@ -23088,8 +23088,8 @@ class InsertReplaceEdit implements ToJsonable { @override bool operator ==(Object other) { if (other is InsertReplaceEdit && other.runtimeType == InsertReplaceEdit) { - return newText == other.newText && - insert == other.insert && + return insert == other.insert && + newText == other.newText && replace == other.replace && true; } @@ -23098,8 +23098,8 @@ class InsertReplaceEdit implements ToJsonable { @override int get hashCode => Object.hash( - newText, insert, + newText, replace, ); @@ -23325,16 +23325,16 @@ class LinkedEditingRangeParams ); LinkedEditingRangeParams({ - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static LinkedEditingRangeParams fromJson(Map json) { + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -23344,8 +23344,8 @@ class LinkedEditingRangeParams ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return LinkedEditingRangeParams( - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -23361,8 +23361,8 @@ class LinkedEditingRangeParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -23371,24 +23371,6 @@ class LinkedEditingRangeParams static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -23407,6 +23389,24 @@ class LinkedEditingRangeParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -23429,8 +23429,8 @@ class LinkedEditingRangeParams bool operator ==(Object other) { if (other is LinkedEditingRangeParams && other.runtimeType == LinkedEditingRangeParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -23439,8 +23439,8 @@ class LinkedEditingRangeParams @override int get hashCode => Object.hash( - textDocument, position, + textDocument, workDoneToken, ); @@ -23461,8 +23461,8 @@ class LinkedEditingRangeRegistrationOptions LinkedEditingRangeRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static LinkedEditingRangeRegistrationOptions fromJson( Map json) { @@ -23470,14 +23470,14 @@ class LinkedEditingRangeRegistrationOptions final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return LinkedEditingRangeRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -23493,12 +23493,12 @@ class LinkedEditingRangeRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -23521,16 +23521,6 @@ class LinkedEditingRangeRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -23541,6 +23531,16 @@ class LinkedEditingRangeRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter @@ -23555,8 +23555,8 @@ class LinkedEditingRangeRegistrationOptions other.runtimeType == LinkedEditingRangeRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -23565,8 +23565,8 @@ class LinkedEditingRangeRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -23681,17 +23681,17 @@ class Location implements ToJsonable { ); Location({ - required this.uri, required this.range, + required this.uri, }); static Location fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); + final uriJson = json['uri']; + final uri = uriJson as String; return Location( - uri: uri, range: range, + uri: uri, ); } @@ -23700,31 +23700,13 @@ class Location implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; __result['range'] = range.toJson(); + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -23743,6 +23725,24 @@ class Location implements ToJsonable { } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type Location'); @@ -23753,15 +23753,15 @@ class Location implements ToJsonable { @override bool operator ==(Object other) { if (other is Location && other.runtimeType == Location) { - return uri == other.uri && range == other.range && true; + return range == other.range && uri == other.uri && true; } return false; } @override int get hashCode => Object.hash( - uri, range, + uri, ); @override @@ -23776,27 +23776,27 @@ class LocationLink implements ToJsonable { LocationLink({ this.originSelectionRange, - required this.targetUri, required this.targetRange, required this.targetSelectionRange, + required this.targetUri, }); static LocationLink fromJson(Map json) { final originSelectionRangeJson = json['originSelectionRange']; final originSelectionRange = originSelectionRangeJson != null ? Range.fromJson(originSelectionRangeJson as Map) : null; - final targetUriJson = json['targetUri']; - final targetUri = targetUriJson as String; final targetRangeJson = json['targetRange']; final targetRange = Range.fromJson(targetRangeJson as Map); final targetSelectionRangeJson = json['targetSelectionRange']; final targetSelectionRange = Range.fromJson(targetSelectionRangeJson as Map); + final targetUriJson = json['targetUri']; + final targetUri = targetUriJson as String; return LocationLink( originSelectionRange: originSelectionRange, - targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, + targetUri: targetUri, ); } @@ -23825,9 +23825,9 @@ class LocationLink implements ToJsonable { if (originSelectionRange != null) { __result['originSelectionRange'] = originSelectionRange?.toJson(); } - __result['targetUri'] = targetUri; __result['targetRange'] = targetRange.toJson(); __result['targetSelectionRange'] = targetSelectionRange.toJson(); + __result['targetUri'] = targetUri; return __result; } @@ -23844,24 +23844,6 @@ class LocationLink implements ToJsonable { } finally { reporter.pop(); } - reporter.push('targetUri'); - try { - if (!obj.containsKey('targetUri')) { - reporter.reportError('must not be undefined'); - return false; - } - final targetUri = obj['targetUri']; - if (targetUri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(targetUri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('targetRange'); try { if (!obj.containsKey('targetRange')) { @@ -23898,6 +23880,24 @@ class LocationLink implements ToJsonable { } finally { reporter.pop(); } + reporter.push('targetUri'); + try { + if (!obj.containsKey('targetUri')) { + reporter.reportError('must not be undefined'); + return false; + } + final targetUri = obj['targetUri']; + if (targetUri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(targetUri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type LocationLink'); @@ -23909,9 +23909,9 @@ class LocationLink implements ToJsonable { bool operator ==(Object other) { if (other is LocationLink && other.runtimeType == LocationLink) { return originSelectionRange == other.originSelectionRange && - targetUri == other.targetUri && targetRange == other.targetRange && targetSelectionRange == other.targetSelectionRange && + targetUri == other.targetUri && true; } return false; @@ -23920,9 +23920,9 @@ class LocationLink implements ToJsonable { @override int get hashCode => Object.hash( originSelectionRange, - targetUri, targetRange, targetSelectionRange, + targetUri, ); @override @@ -23936,17 +23936,17 @@ class LogMessageParams implements ToJsonable { ); LogMessageParams({ - required this.type, required this.message, + required this.type, }); static LogMessageParams fromJson(Map json) { - final typeJson = json['type']; - final type = MessageType.fromJson(typeJson as int); final messageJson = json['message']; final message = messageJson as String; + final typeJson = json['type']; + final type = MessageType.fromJson(typeJson as int); return LogMessageParams( - type: type, message: message, + type: type, ); } @@ -23958,31 +23958,13 @@ class LogMessageParams implements ToJsonable { Map toJson() { var __result = {}; - __result['type'] = type.toJson(); __result['message'] = message; + __result['type'] = type.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('type'); - try { - if (!obj.containsKey('type')) { - reporter.reportError('must not be undefined'); - return false; - } - final type = obj['type']; - if (type == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(MessageType.canParse(type, reporter))) { - reporter.reportError('must be of type MessageType'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('message'); try { if (!obj.containsKey('message')) { @@ -24001,6 +23983,24 @@ class LogMessageParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('type'); + try { + if (!obj.containsKey('type')) { + reporter.reportError('must not be undefined'); + return false; + } + final type = obj['type']; + if (type == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(MessageType.canParse(type, reporter))) { + reporter.reportError('must be of type MessageType'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type LogMessageParams'); @@ -24011,15 +24011,15 @@ class LogMessageParams implements ToJsonable { @override bool operator ==(Object other) { if (other is LogMessageParams && other.runtimeType == LogMessageParams) { - return type == other.type && message == other.message && true; + return message == other.message && type == other.type && true; } return false; } @override int get hashCode => Object.hash( - type, message, + type, ); @override @@ -24127,23 +24127,23 @@ class MarkdownClientCapabilities implements ToJsonable { ); MarkdownClientCapabilities({ + this.allowedTags, required this.parser, this.version, - this.allowedTags, }); static MarkdownClientCapabilities fromJson(Map json) { - final parserJson = json['parser']; - final parser = parserJson as String; - final versionJson = json['version']; - final version = versionJson as String?; final allowedTagsJson = json['allowedTags']; final allowedTags = (allowedTagsJson as List?) ?.map((item) => item as String) .toList(); + final parserJson = json['parser']; + final parser = parserJson as String; + final versionJson = json['version']; + final version = versionJson as String?; return MarkdownClientCapabilities( + allowedTags: allowedTags, parser: parser, version: version, - allowedTags: allowedTags, ); } @@ -24159,18 +24159,30 @@ class MarkdownClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; + if (allowedTags != null) { + __result['allowedTags'] = allowedTags; + } __result['parser'] = parser; if (version != null) { __result['version'] = version; } - if (allowedTags != null) { - __result['allowedTags'] = allowedTags; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('allowedTags'); + try { + final allowedTags = obj['allowedTags']; + if (allowedTags != null && + !((allowedTags is List && + (allowedTags.every((item) => item is String))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('parser'); try { if (!obj.containsKey('parser')) { @@ -24199,18 +24211,6 @@ class MarkdownClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('allowedTags'); - try { - final allowedTags = obj['allowedTags']; - if (allowedTags != null && - !((allowedTags is List && - (allowedTags.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type MarkdownClientCapabilities'); @@ -24222,10 +24222,10 @@ class MarkdownClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is MarkdownClientCapabilities && other.runtimeType == MarkdownClientCapabilities) { - return parser == other.parser && - version == other.version && - listEqual( + return listEqual( allowedTags, other.allowedTags, (String a, String b) => a == b) && + parser == other.parser && + version == other.version && true; } return false; @@ -24233,9 +24233,9 @@ class MarkdownClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(allowedTags), parser, version, - lspHashCode(allowedTags), ); @override @@ -24403,8 +24403,8 @@ class Message implements ToJsonable { ); Message({ - required this.jsonrpc, this.clientRequestTime, + required this.jsonrpc, }); static Message fromJson(Map json) { if (RequestMessage.canParse(json, nullLspJsonReporter)) { @@ -24416,13 +24416,13 @@ class Message implements ToJsonable { if (NotificationMessage.canParse(json, nullLspJsonReporter)) { return NotificationMessage.fromJson(json); } - final jsonrpcJson = json['jsonrpc']; - final jsonrpc = jsonrpcJson as String; final clientRequestTimeJson = json['clientRequestTime']; final clientRequestTime = clientRequestTimeJson as int?; + final jsonrpcJson = json['jsonrpc']; + final jsonrpc = jsonrpcJson as String; return Message( - jsonrpc: jsonrpc, clientRequestTime: clientRequestTime, + jsonrpc: jsonrpc, ); } @@ -24431,15 +24431,25 @@ class Message implements ToJsonable { Map toJson() { var __result = {}; - __result['jsonrpc'] = jsonrpc; if (clientRequestTime != null) { __result['clientRequestTime'] = clientRequestTime; } + __result['jsonrpc'] = jsonrpc; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('clientRequestTime'); + try { + final clientRequestTime = obj['clientRequestTime']; + if (clientRequestTime != null && !(clientRequestTime is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('jsonrpc'); try { if (!obj.containsKey('jsonrpc')) { @@ -24458,16 +24468,6 @@ class Message implements ToJsonable { } finally { reporter.pop(); } - reporter.push('clientRequestTime'); - try { - final clientRequestTime = obj['clientRequestTime']; - if (clientRequestTime != null && !(clientRequestTime is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type Message'); @@ -24478,8 +24478,8 @@ class Message implements ToJsonable { @override bool operator ==(Object other) { if (other is Message && other.runtimeType == Message) { - return jsonrpc == other.jsonrpc && - clientRequestTime == other.clientRequestTime && + return clientRequestTime == other.clientRequestTime && + jsonrpc == other.jsonrpc && true; } return false; @@ -24487,8 +24487,8 @@ class Message implements ToJsonable { @override int get hashCode => Object.hash( - jsonrpc, clientRequestTime, + jsonrpc, ); @override @@ -24924,26 +24924,26 @@ class Moniker implements ToJsonable { ); Moniker({ - required this.scheme, required this.identifier, - required this.unique, this.kind, + required this.scheme, + required this.unique, }); static Moniker fromJson(Map json) { - final schemeJson = json['scheme']; - final scheme = schemeJson as String; final identifierJson = json['identifier']; final identifier = identifierJson as String; - final uniqueJson = json['unique']; - final unique = UniquenessLevel.fromJson(uniqueJson as String); final kindJson = json['kind']; final kind = kindJson != null ? MonikerKind.fromJson(kindJson as String) : null; + final schemeJson = json['scheme']; + final scheme = schemeJson as String; + final uniqueJson = json['unique']; + final unique = UniquenessLevel.fromJson(uniqueJson as String); return Moniker( - scheme: scheme, identifier: identifier, - unique: unique, kind: kind, + scheme: scheme, + unique: unique, ); } @@ -24962,35 +24962,17 @@ class Moniker implements ToJsonable { Map toJson() { var __result = {}; - __result['scheme'] = scheme; __result['identifier'] = identifier; - __result['unique'] = unique.toJson(); if (kind != null) { __result['kind'] = kind?.toJson(); } + __result['scheme'] = scheme; + __result['unique'] = unique.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('scheme'); - try { - if (!obj.containsKey('scheme')) { - reporter.reportError('must not be undefined'); - return false; - } - final scheme = obj['scheme']; - if (scheme == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(scheme is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('identifier'); try { if (!obj.containsKey('identifier')) { @@ -25009,6 +24991,34 @@ class Moniker implements ToJsonable { } finally { reporter.pop(); } + reporter.push('kind'); + try { + final kind = obj['kind']; + if (kind != null && !(MonikerKind.canParse(kind, reporter))) { + reporter.reportError('must be of type MonikerKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('scheme'); + try { + if (!obj.containsKey('scheme')) { + reporter.reportError('must not be undefined'); + return false; + } + final scheme = obj['scheme']; + if (scheme == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(scheme is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('unique'); try { if (!obj.containsKey('unique')) { @@ -25027,16 +25037,6 @@ class Moniker implements ToJsonable { } finally { reporter.pop(); } - reporter.push('kind'); - try { - final kind = obj['kind']; - if (kind != null && !(MonikerKind.canParse(kind, reporter))) { - reporter.reportError('must be of type MonikerKind'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type Moniker'); @@ -25047,10 +25047,10 @@ class Moniker implements ToJsonable { @override bool operator ==(Object other) { if (other is Moniker && other.runtimeType == Moniker) { - return scheme == other.scheme && - identifier == other.identifier && - unique == other.unique && + return identifier == other.identifier && kind == other.kind && + scheme == other.scheme && + unique == other.unique && true; } return false; @@ -25058,10 +25058,10 @@ class Moniker implements ToJsonable { @override int get hashCode => Object.hash( - scheme, identifier, - unique, kind, + scheme, + unique, ); @override @@ -25242,25 +25242,12 @@ class MonikerParams ); MonikerParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static MonikerParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -25269,11 +25256,24 @@ class MonikerParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return MonikerParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -25292,32 +25292,25 @@ class MonikerParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -25341,22 +25334,29 @@ class MonikerParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -25373,10 +25373,10 @@ class MonikerParams @override bool operator ==(Object other) { if (other is MonikerParams && other.runtimeType == MonikerParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -25384,10 +25384,10 @@ class MonikerParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -25503,28 +25503,28 @@ class NotebookCell implements ToJsonable { ); NotebookCell({ - required this.kind, required this.document, - this.metadata, this.executionSummary, + required this.kind, + this.metadata, }); static NotebookCell fromJson(Map json) { - final kindJson = json['kind']; - final kind = NotebookCellKind.fromJson(kindJson as int); final documentJson = json['document']; final document = documentJson as String; - final metadataJson = json['metadata']; - final metadata = metadataJson; final executionSummaryJson = json['executionSummary']; final executionSummary = executionSummaryJson != null ? ExecutionSummary.fromJson( executionSummaryJson as Map) : null; + final kindJson = json['kind']; + final kind = NotebookCellKind.fromJson(kindJson as int); + final metadataJson = json['metadata']; + final metadata = metadataJson; return NotebookCell( - kind: kind, document: document, - metadata: metadata, executionSummary: executionSummary, + kind: kind, + metadata: metadata, ); } @@ -25542,37 +25542,19 @@ class NotebookCell implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind.toJson(); __result['document'] = document; - if (metadata != null) { - __result['metadata'] = metadata; - } if (executionSummary != null) { __result['executionSummary'] = executionSummary?.toJson(); } + __result['kind'] = kind.toJson(); + if (metadata != null) { + __result['metadata'] = metadata; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('kind'); - try { - if (!obj.containsKey('kind')) { - reporter.reportError('must not be undefined'); - return false; - } - final kind = obj['kind']; - if (kind == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(NotebookCellKind.canParse(kind, reporter))) { - reporter.reportError('must be of type NotebookCellKind'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('document'); try { if (!obj.containsKey('document')) { @@ -25602,6 +25584,24 @@ class NotebookCell implements ToJsonable { } finally { reporter.pop(); } + reporter.push('kind'); + try { + if (!obj.containsKey('kind')) { + reporter.reportError('must not be undefined'); + return false; + } + final kind = obj['kind']; + if (kind == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(NotebookCellKind.canParse(kind, reporter))) { + reporter.reportError('must be of type NotebookCellKind'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type NotebookCell'); @@ -25612,10 +25612,10 @@ class NotebookCell implements ToJsonable { @override bool operator ==(Object other) { if (other is NotebookCell && other.runtimeType == NotebookCell) { - return kind == other.kind && - document == other.document && - metadata == other.metadata && + return document == other.document && executionSummary == other.executionSummary && + kind == other.kind && + metadata == other.metadata && true; } return false; @@ -25623,10 +25623,10 @@ class NotebookCell implements ToJsonable { @override int get hashCode => Object.hash( - kind, document, - metadata, executionSummary, + kind, + metadata, ); @override @@ -25642,23 +25642,23 @@ class NotebookCellArrayChange implements ToJsonable { ); NotebookCellArrayChange({ - required this.start, - required this.deleteCount, this.cells, + required this.deleteCount, + required this.start, }); static NotebookCellArrayChange fromJson(Map json) { - final startJson = json['start']; - final start = startJson as int; - final deleteCountJson = json['deleteCount']; - final deleteCount = deleteCountJson as int; final cellsJson = json['cells']; final cells = (cellsJson as List?) ?.map((item) => NotebookCell.fromJson(item as Map)) .toList(); + final deleteCountJson = json['deleteCount']; + final deleteCount = deleteCountJson as int; + final startJson = json['start']; + final start = startJson as int; return NotebookCellArrayChange( - start: start, - deleteCount: deleteCount, cells: cells, + deleteCount: deleteCount, + start: start, ); } @@ -25673,29 +25673,24 @@ class NotebookCellArrayChange implements ToJsonable { Map toJson() { var __result = {}; - __result['start'] = start; - __result['deleteCount'] = deleteCount; if (cells != null) { __result['cells'] = cells?.map((item) => item.toJson()).toList(); } + __result['deleteCount'] = deleteCount; + __result['start'] = start; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('start'); + reporter.push('cells'); try { - if (!obj.containsKey('start')) { - reporter.reportError('must not be undefined'); - return false; - } - final start = obj['start']; - if (start == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(start is int)) { - reporter.reportError('must be of type int'); + final cells = obj['cells']; + if (cells != null && + !((cells is List && + (cells.every( + (item) => NotebookCell.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -25719,14 +25714,19 @@ class NotebookCellArrayChange implements ToJsonable { } finally { reporter.pop(); } - reporter.push('cells'); + reporter.push('start'); try { - final cells = obj['cells']; - if (cells != null && - !((cells is List && - (cells.every( - (item) => NotebookCell.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('start')) { + reporter.reportError('must not be undefined'); + return false; + } + final start = obj['start']; + if (start == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(start is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -25743,10 +25743,10 @@ class NotebookCellArrayChange implements ToJsonable { bool operator ==(Object other) { if (other is NotebookCellArrayChange && other.runtimeType == NotebookCellArrayChange) { - return start == other.start && - deleteCount == other.deleteCount && - listEqual( + return listEqual( cells, other.cells, (NotebookCell a, NotebookCell b) => a == b) && + deleteCount == other.deleteCount && + start == other.start && true; } return false; @@ -25754,9 +25754,9 @@ class NotebookCellArrayChange implements ToJsonable { @override int get hashCode => Object.hash( - start, - deleteCount, lspHashCode(cells), + deleteCount, + start, ); @override @@ -25802,10 +25802,12 @@ class NotebookCellTextDocumentFilter implements ToJsonable { ); NotebookCellTextDocumentFilter({ - required this.notebook, this.language, + required this.notebook, }); static NotebookCellTextDocumentFilter fromJson(Map json) { + final languageJson = json['language']; + final language = languageJson as String?; final notebookJson = json['notebook']; final notebook = (NotebookDocumentFilter1.canParse(notebookJson, nullLspJsonReporter) || NotebookDocumentFilter2.canParse( @@ -25822,11 +25824,9 @@ class NotebookCellTextDocumentFilter implements ToJsonable { ? Either3.t3(NotebookDocumentFilter3.fromJson(notebookJson as Map)) : (throw '''$notebookJson was not one of (NotebookDocumentFilter1, NotebookDocumentFilter2, NotebookDocumentFilter3)''')))) : (notebookJson is String ? Either2, String>.t2(notebookJson) : (throw '''$notebookJson was not one of (Either3, String)''')); - final languageJson = json['language']; - final language = languageJson as String?; return NotebookCellTextDocumentFilter( - notebook: notebook, language: language, + notebook: notebook, ); } @@ -25846,15 +25846,25 @@ class NotebookCellTextDocumentFilter implements ToJsonable { Map toJson() { var __result = {}; - __result['notebook'] = notebook; if (language != null) { __result['language'] = language; } + __result['notebook'] = notebook; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('language'); + try { + final language = obj['language']; + if (language != null && !(language is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('notebook'); try { if (!obj.containsKey('notebook')) { @@ -25877,16 +25887,6 @@ class NotebookCellTextDocumentFilter implements ToJsonable { } finally { reporter.pop(); } - reporter.push('language'); - try { - final language = obj['language']; - if (language != null && !(language is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type NotebookCellTextDocumentFilter'); @@ -25898,15 +25898,15 @@ class NotebookCellTextDocumentFilter implements ToJsonable { bool operator ==(Object other) { if (other is NotebookCellTextDocumentFilter && other.runtimeType == NotebookCellTextDocumentFilter) { - return notebook == other.notebook && language == other.language && true; + return language == other.language && notebook == other.notebook && true; } return false; } @override int get hashCode => Object.hash( - notebook, language, + notebook, ); @override @@ -25922,31 +25922,31 @@ class NotebookDocument implements ToJsonable { ); NotebookDocument({ - required this.uri, - required this.notebookType, - required this.version, - this.metadata, required this.cells, + this.metadata, + required this.notebookType, + required this.uri, + required this.version, }); static NotebookDocument fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final notebookTypeJson = json['notebookType']; - final notebookType = notebookTypeJson as String; - final versionJson = json['version']; - final version = versionJson as int; - final metadataJson = json['metadata']; - final metadata = metadataJson; final cellsJson = json['cells']; final cells = (cellsJson as List) .map((item) => NotebookCell.fromJson(item as Map)) .toList(); + final metadataJson = json['metadata']; + final metadata = metadataJson; + final notebookTypeJson = json['notebookType']; + final notebookType = notebookTypeJson as String; + final uriJson = json['uri']; + final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int; return NotebookDocument( - uri: uri, - notebookType: notebookType, - version: version, - metadata: metadata, cells: cells, + metadata: metadata, + notebookType: notebookType, + uri: uri, + version: version, ); } @@ -25968,31 +25968,32 @@ class NotebookDocument implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; - __result['notebookType'] = notebookType; - __result['version'] = version; + __result['cells'] = cells.map((item) => item.toJson()).toList(); if (metadata != null) { __result['metadata'] = metadata; } - __result['cells'] = cells.map((item) => item.toJson()).toList(); + __result['notebookType'] = notebookType; + __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); + reporter.push('cells'); try { - if (!obj.containsKey('uri')) { + if (!obj.containsKey('cells')) { reporter.reportError('must not be undefined'); return false; } - final uri = obj['uri']; - if (uri == null) { + final cells = obj['cells']; + if (cells == null) { reporter.reportError('must not be null'); return false; } - if (!(uri is String)) { - reporter.reportError('must be of type String'); + if (!((cells is List && + (cells.every((item) => NotebookCell.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -26016,6 +26017,24 @@ class NotebookDocument implements ToJsonable { } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('version'); try { if (!obj.containsKey('version')) { @@ -26034,25 +26053,6 @@ class NotebookDocument implements ToJsonable { } finally { reporter.pop(); } - reporter.push('cells'); - try { - if (!obj.containsKey('cells')) { - reporter.reportError('must not be undefined'); - return false; - } - final cells = obj['cells']; - if (cells == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((cells is List && - (cells.every((item) => NotebookCell.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type NotebookDocument'); @@ -26063,12 +26063,12 @@ class NotebookDocument implements ToJsonable { @override bool operator ==(Object other) { if (other is NotebookDocument && other.runtimeType == NotebookDocument) { - return uri == other.uri && - notebookType == other.notebookType && - version == other.version && - metadata == other.metadata && - listEqual( + return listEqual( cells, other.cells, (NotebookCell a, NotebookCell b) => a == b) && + metadata == other.metadata && + notebookType == other.notebookType && + uri == other.uri && + version == other.version && true; } return false; @@ -26076,11 +26076,11 @@ class NotebookDocument implements ToJsonable { @override int get hashCode => Object.hash( - uri, - notebookType, - version, - metadata, lspHashCode(cells), + metadata, + notebookType, + uri, + version, ); @override @@ -26096,20 +26096,20 @@ class NotebookDocumentChangeEvent implements ToJsonable { ); NotebookDocumentChangeEvent({ - this.metadata, this.cells, + this.metadata, }); static NotebookDocumentChangeEvent fromJson(Map json) { - final metadataJson = json['metadata']; - final metadata = metadataJson; final cellsJson = json['cells']; final cells = cellsJson != null ? NotebookDocumentChangeEventCells.fromJson( cellsJson as Map) : null; + final metadataJson = json['metadata']; + final metadata = metadataJson; return NotebookDocumentChangeEvent( - metadata: metadata, cells: cells, + metadata: metadata, ); } @@ -26121,12 +26121,12 @@ class NotebookDocumentChangeEvent implements ToJsonable { Map toJson() { var __result = {}; - if (metadata != null) { - __result['metadata'] = metadata; - } if (cells != null) { __result['cells'] = cells?.toJson(); } + if (metadata != null) { + __result['metadata'] = metadata; + } return __result; } @@ -26155,15 +26155,15 @@ class NotebookDocumentChangeEvent implements ToJsonable { bool operator ==(Object other) { if (other is NotebookDocumentChangeEvent && other.runtimeType == NotebookDocumentChangeEvent) { - return metadata == other.metadata && cells == other.cells && true; + return cells == other.cells && metadata == other.metadata && true; } return false; } @override int get hashCode => Object.hash( - metadata, cells, + metadata, ); @override @@ -26177,28 +26177,28 @@ class NotebookDocumentChangeEventCells implements ToJsonable { ); NotebookDocumentChangeEventCells({ - this.structure, this.data, + this.structure, this.textContent, }); static NotebookDocumentChangeEventCells fromJson(Map json) { + final dataJson = json['data']; + final data = (dataJson as List?) + ?.map((item) => NotebookCell.fromJson(item as Map)) + .toList(); final structureJson = json['structure']; final structure = structureJson != null ? NotebookDocumentChangeEventStructure.fromJson( structureJson as Map) : null; - final dataJson = json['data']; - final data = (dataJson as List?) - ?.map((item) => NotebookCell.fromJson(item as Map)) - .toList(); final textContentJson = json['textContent']; final textContent = (textContentJson as List?) ?.map((item) => NotebookDocumentChangeEventTextContent.fromJson( item as Map)) .toList(); return NotebookDocumentChangeEventCells( - structure: structure, data: data, + structure: structure, textContent: textContent, ); } @@ -26215,12 +26215,12 @@ class NotebookDocumentChangeEventCells implements ToJsonable { Map toJson() { var __result = {}; - if (structure != null) { - __result['structure'] = structure?.toJson(); - } if (data != null) { __result['data'] = data?.map((item) => item.toJson()).toList(); } + if (structure != null) { + __result['structure'] = structure?.toJson(); + } if (textContent != null) { __result['textContent'] = textContent?.map((item) => item.toJson()).toList(); @@ -26230,19 +26230,6 @@ class NotebookDocumentChangeEventCells implements ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('structure'); - try { - final structure = obj['structure']; - if (structure != null && - !(NotebookDocumentChangeEventStructure.canParse( - structure, reporter))) { - reporter.reportError( - 'must be of type NotebookDocumentChangeEventStructure'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('data'); try { final data = obj['data']; @@ -26256,6 +26243,19 @@ class NotebookDocumentChangeEventCells implements ToJsonable { } finally { reporter.pop(); } + reporter.push('structure'); + try { + final structure = obj['structure']; + if (structure != null && + !(NotebookDocumentChangeEventStructure.canParse( + structure, reporter))) { + reporter.reportError( + 'must be of type NotebookDocumentChangeEventStructure'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textContent'); try { final textContent = obj['textContent']; @@ -26282,9 +26282,9 @@ class NotebookDocumentChangeEventCells implements ToJsonable { bool operator ==(Object other) { if (other is NotebookDocumentChangeEventCells && other.runtimeType == NotebookDocumentChangeEventCells) { - return structure == other.structure && - listEqual( + return listEqual( data, other.data, (NotebookCell a, NotebookCell b) => a == b) && + structure == other.structure && listEqual( textContent, other.textContent, @@ -26298,8 +26298,8 @@ class NotebookDocumentChangeEventCells implements ToJsonable { @override int get hashCode => Object.hash( - structure, lspHashCode(data), + structure, lspHashCode(textContent), ); @@ -26315,27 +26315,27 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { NotebookDocumentChangeEventStructure({ required this.array, - this.didOpen, this.didClose, + this.didOpen, }); static NotebookDocumentChangeEventStructure fromJson( Map json) { final arrayJson = json['array']; final array = NotebookCellArrayChange.fromJson(arrayJson as Map); - final didOpenJson = json['didOpen']; - final didOpen = (didOpenJson as List?) - ?.map((item) => TextDocumentItem.fromJson(item as Map)) - .toList(); final didCloseJson = json['didClose']; final didClose = (didCloseJson as List?) ?.map((item) => TextDocumentIdentifier.fromJson(item as Map)) .toList(); + final didOpenJson = json['didOpen']; + final didOpen = (didOpenJson as List?) + ?.map((item) => TextDocumentItem.fromJson(item as Map)) + .toList(); return NotebookDocumentChangeEventStructure( array: array, - didOpen: didOpen, didClose: didClose, + didOpen: didOpen, ); } @@ -26351,12 +26351,12 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { Map toJson() { var __result = {}; __result['array'] = array.toJson(); - if (didOpen != null) { - __result['didOpen'] = didOpen?.map((item) => item.toJson()).toList(); - } if (didClose != null) { __result['didClose'] = didClose?.map((item) => item.toJson()).toList(); } + if (didOpen != null) { + __result['didOpen'] = didOpen?.map((item) => item.toJson()).toList(); + } return __result; } @@ -26380,19 +26380,6 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { } finally { reporter.pop(); } - reporter.push('didOpen'); - try { - final didOpen = obj['didOpen']; - if (didOpen != null && - !((didOpen is List && - (didOpen.every( - (item) => TextDocumentItem.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('didClose'); try { final didClose = obj['didClose']; @@ -26406,6 +26393,19 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { } finally { reporter.pop(); } + reporter.push('didOpen'); + try { + final didOpen = obj['didOpen']; + if (didOpen != null && + !((didOpen is List && + (didOpen.every( + (item) => TextDocumentItem.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter @@ -26419,10 +26419,10 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { if (other is NotebookDocumentChangeEventStructure && other.runtimeType == NotebookDocumentChangeEventStructure) { return array == other.array && - listEqual(didOpen, other.didOpen, - (TextDocumentItem a, TextDocumentItem b) => a == b) && listEqual(didClose, other.didClose, (TextDocumentIdentifier a, TextDocumentIdentifier b) => a == b) && + listEqual(didOpen, other.didOpen, + (TextDocumentItem a, TextDocumentItem b) => a == b) && true; } return false; @@ -26431,8 +26431,8 @@ class NotebookDocumentChangeEventStructure implements ToJsonable { @override int get hashCode => Object.hash( array, - lspHashCode(didOpen), lspHashCode(didClose), + lspHashCode(didOpen), ); @override @@ -26446,14 +26446,11 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { ); NotebookDocumentChangeEventTextContent({ - required this.document, required this.changes, + required this.document, }); static NotebookDocumentChangeEventTextContent fromJson( Map json) { - final documentJson = json['document']; - final document = VersionedTextDocumentIdentifier.fromJson( - documentJson as Map); final changesJson = json['changes']; final changes = (changesJson as List) .map((item) => TextDocumentContentChangeEvent1.canParse( @@ -26467,9 +26464,12 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { TextDocumentContentChangeEvent2.fromJson(item as Map)) : (throw '''$item was not one of (TextDocumentContentChangeEvent1, TextDocumentContentChangeEvent2)'''))) .toList(); + final documentJson = json['document']; + final document = VersionedTextDocumentIdentifier.fromJson( + documentJson as Map); return NotebookDocumentChangeEventTextContent( - document: document, changes: changes, + document: document, ); } @@ -26480,32 +26480,13 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { Map toJson() { var __result = {}; - __result['document'] = document.toJson(); __result['changes'] = changes; + __result['document'] = document.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('document'); - try { - if (!obj.containsKey('document')) { - reporter.reportError('must not be undefined'); - return false; - } - final document = obj['document']; - if (document == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(VersionedTextDocumentIdentifier.canParse(document, reporter))) { - reporter - .reportError('must be of type VersionedTextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('changes'); try { if (!obj.containsKey('changes')) { @@ -26528,6 +26509,25 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { } finally { reporter.pop(); } + reporter.push('document'); + try { + if (!obj.containsKey('document')) { + reporter.reportError('must not be undefined'); + return false; + } + final document = obj['document']; + if (document == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(VersionedTextDocumentIdentifier.canParse(document, reporter))) { + reporter + .reportError('must be of type VersionedTextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -26540,8 +26540,7 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { bool operator ==(Object other) { if (other is NotebookDocumentChangeEventTextContent && other.runtimeType == NotebookDocumentChangeEventTextContent) { - return document == other.document && - listEqual( + return listEqual( changes, other.changes, (Either2 b) => a == b) && + document == other.document && true; } return false; @@ -26558,8 +26558,8 @@ class NotebookDocumentChangeEventTextContent implements ToJsonable { @override int get hashCode => Object.hash( - document, lspHashCode(changes), + document, ); @override @@ -26651,20 +26651,20 @@ class NotebookDocumentFilter1 implements ToJsonable { NotebookDocumentFilter1({ required this.notebookType, - this.scheme, this.pattern, + this.scheme, }); static NotebookDocumentFilter1 fromJson(Map json) { final notebookTypeJson = json['notebookType']; final notebookType = notebookTypeJson as String; - final schemeJson = json['scheme']; - final scheme = schemeJson as String?; final patternJson = json['pattern']; final pattern = patternJson as String?; + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; return NotebookDocumentFilter1( notebookType: notebookType, - scheme: scheme, pattern: pattern, + scheme: scheme, ); } @@ -26680,12 +26680,12 @@ class NotebookDocumentFilter1 implements ToJsonable { Map toJson() { var __result = {}; __result['notebookType'] = notebookType; - if (scheme != null) { - __result['scheme'] = scheme; - } if (pattern != null) { __result['pattern'] = pattern; } + if (scheme != null) { + __result['scheme'] = scheme; + } return __result; } @@ -26709,20 +26709,20 @@ class NotebookDocumentFilter1 implements ToJsonable { } finally { reporter.pop(); } - reporter.push('scheme'); + reporter.push('pattern'); try { - final scheme = obj['scheme']; - if (scheme != null && !(scheme is String)) { + final pattern = obj['pattern']; + if (pattern != null && !(pattern is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } - reporter.push('pattern'); + reporter.push('scheme'); try { - final pattern = obj['pattern']; - if (pattern != null && !(pattern is String)) { + final scheme = obj['scheme']; + if (scheme != null && !(scheme is String)) { reporter.reportError('must be of type String'); return false; } @@ -26741,8 +26741,8 @@ class NotebookDocumentFilter1 implements ToJsonable { if (other is NotebookDocumentFilter1 && other.runtimeType == NotebookDocumentFilter1) { return notebookType == other.notebookType && - scheme == other.scheme && pattern == other.pattern && + scheme == other.scheme && true; } return false; @@ -26751,8 +26751,8 @@ class NotebookDocumentFilter1 implements ToJsonable { @override int get hashCode => Object.hash( notebookType, - scheme, pattern, + scheme, ); @override @@ -26767,20 +26767,20 @@ class NotebookDocumentFilter2 implements ToJsonable { NotebookDocumentFilter2({ this.notebookType, - required this.scheme, this.pattern, + required this.scheme, }); static NotebookDocumentFilter2 fromJson(Map json) { final notebookTypeJson = json['notebookType']; final notebookType = notebookTypeJson as String?; - final schemeJson = json['scheme']; - final scheme = schemeJson as String; final patternJson = json['pattern']; final pattern = patternJson as String?; + final schemeJson = json['scheme']; + final scheme = schemeJson as String; return NotebookDocumentFilter2( notebookType: notebookType, - scheme: scheme, pattern: pattern, + scheme: scheme, ); } @@ -26798,10 +26798,10 @@ class NotebookDocumentFilter2 implements ToJsonable { if (notebookType != null) { __result['notebookType'] = notebookType; } - __result['scheme'] = scheme; if (pattern != null) { __result['pattern'] = pattern; } + __result['scheme'] = scheme; return __result; } @@ -26817,6 +26817,16 @@ class NotebookDocumentFilter2 implements ToJsonable { } finally { reporter.pop(); } + reporter.push('pattern'); + try { + final pattern = obj['pattern']; + if (pattern != null && !(pattern is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('scheme'); try { if (!obj.containsKey('scheme')) { @@ -26835,16 +26845,6 @@ class NotebookDocumentFilter2 implements ToJsonable { } finally { reporter.pop(); } - reporter.push('pattern'); - try { - final pattern = obj['pattern']; - if (pattern != null && !(pattern is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type NotebookDocumentFilter2'); @@ -26857,8 +26857,8 @@ class NotebookDocumentFilter2 implements ToJsonable { if (other is NotebookDocumentFilter2 && other.runtimeType == NotebookDocumentFilter2) { return notebookType == other.notebookType && - scheme == other.scheme && pattern == other.pattern && + scheme == other.scheme && true; } return false; @@ -26867,8 +26867,8 @@ class NotebookDocumentFilter2 implements ToJsonable { @override int get hashCode => Object.hash( notebookType, - scheme, pattern, + scheme, ); @override @@ -26883,20 +26883,20 @@ class NotebookDocumentFilter3 implements ToJsonable { NotebookDocumentFilter3({ this.notebookType, - this.scheme, required this.pattern, + this.scheme, }); static NotebookDocumentFilter3 fromJson(Map json) { final notebookTypeJson = json['notebookType']; final notebookType = notebookTypeJson as String?; - final schemeJson = json['scheme']; - final scheme = schemeJson as String?; final patternJson = json['pattern']; final pattern = patternJson as String; + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; return NotebookDocumentFilter3( notebookType: notebookType, - scheme: scheme, pattern: pattern, + scheme: scheme, ); } @@ -26914,10 +26914,10 @@ class NotebookDocumentFilter3 implements ToJsonable { if (notebookType != null) { __result['notebookType'] = notebookType; } + __result['pattern'] = pattern; if (scheme != null) { __result['scheme'] = scheme; } - __result['pattern'] = pattern; return __result; } @@ -26933,16 +26933,6 @@ class NotebookDocumentFilter3 implements ToJsonable { } finally { reporter.pop(); } - reporter.push('scheme'); - try { - final scheme = obj['scheme']; - if (scheme != null && !(scheme is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('pattern'); try { if (!obj.containsKey('pattern')) { @@ -26961,6 +26951,16 @@ class NotebookDocumentFilter3 implements ToJsonable { } finally { reporter.pop(); } + reporter.push('scheme'); + try { + final scheme = obj['scheme']; + if (scheme != null && !(scheme is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type NotebookDocumentFilter3'); @@ -26973,8 +26973,8 @@ class NotebookDocumentFilter3 implements ToJsonable { if (other is NotebookDocumentFilter3 && other.runtimeType == NotebookDocumentFilter3) { return notebookType == other.notebookType && - scheme == other.scheme && pattern == other.pattern && + scheme == other.scheme && true; } return false; @@ -26983,8 +26983,8 @@ class NotebookDocumentFilter3 implements ToJsonable { @override int get hashCode => Object.hash( notebookType, - scheme, pattern, + scheme, ); @override @@ -27328,11 +27328,16 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { ); NotebookDocumentSyncOptionsNotebookSelector({ - this.notebookDocument, required this.cells, + this.notebookDocument, }); static NotebookDocumentSyncOptionsNotebookSelector fromJson( Map json) { + final cellsJson = json['cells']; + final cells = (cellsJson as List) + .map((item) => NotebookDocumentSyncOptionsCells.fromJson( + item as Map)) + .toList(); final notebookDocumentJson = json['notebookDocument']; final notebookDocument = notebookDocumentJson == null ? null @@ -27351,14 +27356,9 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { NotebookDocumentFilter2.fromJson(notebookDocumentJson as Map)) : (NotebookDocumentFilter3.canParse(notebookDocumentJson, nullLspJsonReporter) ? Either3.t3(NotebookDocumentFilter3.fromJson(notebookDocumentJson as Map)) : (throw '''$notebookDocumentJson was not one of (NotebookDocumentFilter1, NotebookDocumentFilter2, NotebookDocumentFilter3)''')))) : (notebookDocumentJson is String ? Either2, String>.t2(notebookDocumentJson) : (throw '''$notebookDocumentJson was not one of (Either3, String)'''))); - final cellsJson = json['cells']; - final cells = (cellsJson as List) - .map((item) => NotebookDocumentSyncOptionsCells.fromJson( - item as Map)) - .toList(); return NotebookDocumentSyncOptionsNotebookSelector( - notebookDocument: notebookDocument, cells: cells, + notebookDocument: notebookDocument, ); } @@ -27374,32 +27374,15 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { Map toJson() { var __result = {}; + __result['cells'] = cells.map((item) => item.toJson()).toList(); if (notebookDocument != null) { __result['notebookDocument'] = notebookDocument; } - __result['cells'] = cells.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('notebookDocument'); - try { - final notebookDocument = obj['notebookDocument']; - if (notebookDocument != null && - !(((NotebookDocumentFilter1.canParse(notebookDocument, reporter) || - NotebookDocumentFilter2.canParse( - notebookDocument, reporter) || - NotebookDocumentFilter3.canParse( - notebookDocument, reporter)) || - notebookDocument is String))) { - reporter.reportError( - 'must be of type Either2, String>'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('cells'); try { if (!obj.containsKey('cells')) { @@ -27421,6 +27404,23 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { } finally { reporter.pop(); } + reporter.push('notebookDocument'); + try { + final notebookDocument = obj['notebookDocument']; + if (notebookDocument != null && + !(((NotebookDocumentFilter1.canParse(notebookDocument, reporter) || + NotebookDocumentFilter2.canParse( + notebookDocument, reporter) || + NotebookDocumentFilter3.canParse( + notebookDocument, reporter)) || + notebookDocument is String))) { + reporter.reportError( + 'must be of type Either2, String>'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -27433,13 +27433,13 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { bool operator ==(Object other) { if (other is NotebookDocumentSyncOptionsNotebookSelector && other.runtimeType == NotebookDocumentSyncOptionsNotebookSelector) { - return notebookDocument == other.notebookDocument && - listEqual( + return listEqual( cells, other.cells, (NotebookDocumentSyncOptionsCells a, NotebookDocumentSyncOptionsCells b) => a == b) && + notebookDocument == other.notebookDocument && true; } return false; @@ -27447,8 +27447,8 @@ class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { @override int get hashCode => Object.hash( - notebookDocument, lspHashCode(cells), + notebookDocument, ); @override @@ -27468,12 +27468,14 @@ class NotebookDocumentSyncRegistrationOptions ); NotebookDocumentSyncRegistrationOptions({ + this.id, required this.notebookSelector, this.save, - this.id, }); static NotebookDocumentSyncRegistrationOptions fromJson( Map json) { + final idJson = json['id']; + final id = idJson as String?; final notebookSelectorJson = json['notebookSelector']; final notebookSelector = (notebookSelectorJson as List) .map((item) => NotebookDocumentSyncOptionsNotebookSelector.fromJson( @@ -27481,12 +27483,10 @@ class NotebookDocumentSyncRegistrationOptions .toList(); final saveJson = json['save']; final save = saveJson as bool?; - final idJson = json['id']; - final id = idJson as String?; return NotebookDocumentSyncRegistrationOptions( + id: id, notebookSelector: notebookSelector, save: save, - id: id, ); } @@ -27503,19 +27503,29 @@ class NotebookDocumentSyncRegistrationOptions Map toJson() { var __result = {}; + if (id != null) { + __result['id'] = id; + } __result['notebookSelector'] = notebookSelector.map((item) => item.toJson()).toList(); if (save != null) { __result['save'] = save; } - if (id != null) { - __result['id'] = id; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('id'); + try { + final id = obj['id']; + if (id != null && !(id is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('notebookSelector'); try { if (!obj.containsKey('notebookSelector')) { @@ -27548,16 +27558,6 @@ class NotebookDocumentSyncRegistrationOptions } finally { reporter.pop(); } - reporter.push('id'); - try { - final id = obj['id']; - if (id != null && !(id is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError( @@ -27570,14 +27570,14 @@ class NotebookDocumentSyncRegistrationOptions bool operator ==(Object other) { if (other is NotebookDocumentSyncRegistrationOptions && other.runtimeType == NotebookDocumentSyncRegistrationOptions) { - return listEqual( + return id == other.id && + listEqual( notebookSelector, other.notebookSelector, (NotebookDocumentSyncOptionsNotebookSelector a, NotebookDocumentSyncOptionsNotebookSelector b) => a == b) && save == other.save && - id == other.id && true; } return false; @@ -27585,9 +27585,9 @@ class NotebookDocumentSyncRegistrationOptions @override int get hashCode => Object.hash( + id, lspHashCode(notebookSelector), save, - id, ); @override @@ -27601,25 +27601,25 @@ class NotificationMessage implements Message, IncomingMessage, ToJsonable { ); NotificationMessage({ + this.clientRequestTime, + required this.jsonrpc, required this.method, this.params, - required this.jsonrpc, - this.clientRequestTime, }); static NotificationMessage fromJson(Map json) { + final clientRequestTimeJson = json['clientRequestTime']; + final clientRequestTime = clientRequestTimeJson as int?; + final jsonrpcJson = json['jsonrpc']; + final jsonrpc = jsonrpcJson as String; final methodJson = json['method']; final method = Method.fromJson(methodJson as String); final paramsJson = json['params']; final params = paramsJson; - final jsonrpcJson = json['jsonrpc']; - final jsonrpc = jsonrpcJson as String; - final clientRequestTimeJson = json['clientRequestTime']; - final clientRequestTime = clientRequestTimeJson as int?; return NotificationMessage( + clientRequestTime: clientRequestTime, + jsonrpc: jsonrpc, method: method, params: params, - jsonrpc: jsonrpc, - clientRequestTime: clientRequestTime, ); } @@ -27634,32 +27634,24 @@ class NotificationMessage implements Message, IncomingMessage, ToJsonable { Map toJson() { var __result = {}; + if (clientRequestTime != null) { + __result['clientRequestTime'] = clientRequestTime; + } + __result['jsonrpc'] = jsonrpc; __result['method'] = method.toJson(); if (params != null) { __result['params'] = params; } - __result['jsonrpc'] = jsonrpc; - if (clientRequestTime != null) { - __result['clientRequestTime'] = clientRequestTime; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('method'); + reporter.push('clientRequestTime'); try { - if (!obj.containsKey('method')) { - reporter.reportError('must not be undefined'); - return false; - } - final method = obj['method']; - if (method == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Method.canParse(method, reporter))) { - reporter.reportError('must be of type Method'); + final clientRequestTime = obj['clientRequestTime']; + if (clientRequestTime != null && !(clientRequestTime is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -27683,11 +27675,19 @@ class NotificationMessage implements Message, IncomingMessage, ToJsonable { } finally { reporter.pop(); } - reporter.push('clientRequestTime'); + reporter.push('method'); try { - final clientRequestTime = obj['clientRequestTime']; - if (clientRequestTime != null && !(clientRequestTime is int)) { - reporter.reportError('must be of type int'); + if (!obj.containsKey('method')) { + reporter.reportError('must not be undefined'); + return false; + } + final method = obj['method']; + if (method == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Method.canParse(method, reporter))) { + reporter.reportError('must be of type Method'); return false; } } finally { @@ -27704,10 +27704,10 @@ class NotificationMessage implements Message, IncomingMessage, ToJsonable { bool operator ==(Object other) { if (other is NotificationMessage && other.runtimeType == NotificationMessage) { - return method == other.method && - params == other.params && + return clientRequestTime == other.clientRequestTime && jsonrpc == other.jsonrpc && - clientRequestTime == other.clientRequestTime && + method == other.method && + params == other.params && true; } return false; @@ -27715,10 +27715,10 @@ class NotificationMessage implements Message, IncomingMessage, ToJsonable { @override int get hashCode => Object.hash( + clientRequestTime, + jsonrpc, method, params, - jsonrpc, - clientRequestTime, ); @override @@ -27733,18 +27733,18 @@ class OptionalVersionedTextDocumentIdentifier ); OptionalVersionedTextDocumentIdentifier({ - this.version, required this.uri, + this.version, }); static OptionalVersionedTextDocumentIdentifier fromJson( Map json) { - final versionJson = json['version']; - final version = versionJson as int?; final uriJson = json['uri']; final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int?; return OptionalVersionedTextDocumentIdentifier( - version: version, uri: uri, + version: version, ); } @@ -27764,27 +27764,13 @@ class OptionalVersionedTextDocumentIdentifier Map toJson() { var __result = {}; - __result['version'] = version; __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('version'); - try { - if (!obj.containsKey('version')) { - reporter.reportError('must not be undefined'); - return false; - } - final version = obj['version']; - if (version != null && !(version is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -27803,6 +27789,20 @@ class OptionalVersionedTextDocumentIdentifier } finally { reporter.pop(); } + reporter.push('version'); + try { + if (!obj.containsKey('version')) { + reporter.reportError('must not be undefined'); + return false; + } + final version = obj['version']; + if (version != null && !(version is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -27815,15 +27815,15 @@ class OptionalVersionedTextDocumentIdentifier bool operator ==(Object other) { if (other is OptionalVersionedTextDocumentIdentifier && other.runtimeType == OptionalVersionedTextDocumentIdentifier) { - return version == other.version && uri == other.uri && true; + return uri == other.uri && version == other.version && true; } return false; } @override int get hashCode => Object.hash( - version, uri, + version, ); @override @@ -27839,12 +27839,10 @@ class ParameterInformation implements ToJsonable { ); ParameterInformation({ - required this.label, this.documentation, + required this.label, }); static ParameterInformation fromJson(Map json) { - final labelJson = json['label']; - final label = labelJson as String; final documentationJson = json['documentation']; final documentation = documentationJson == null ? null @@ -27854,9 +27852,11 @@ class ParameterInformation implements ToJsonable { : (documentationJson is String ? Either2.t2(documentationJson) : (throw '''$documentationJson was not one of (MarkupContent, String)'''))); + final labelJson = json['label']; + final label = labelJson as String; return ParameterInformation( - label: label, documentation: documentation, + label: label, ); } @@ -27878,15 +27878,28 @@ class ParameterInformation implements ToJsonable { Map toJson() { var __result = {}; - __result['label'] = label; if (documentation != null) { __result['documentation'] = documentation; } + __result['label'] = label; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('documentation'); + try { + final documentation = obj['documentation']; + if (documentation != null && + !((MarkupContent.canParse(documentation, reporter) || + documentation is String))) { + reporter + .reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('label'); try { if (!obj.containsKey('label')) { @@ -27905,19 +27918,6 @@ class ParameterInformation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('documentation'); - try { - final documentation = obj['documentation']; - if (documentation != null && - !((MarkupContent.canParse(documentation, reporter) || - documentation is String))) { - reporter - .reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ParameterInformation'); @@ -27929,8 +27929,8 @@ class ParameterInformation implements ToJsonable { bool operator ==(Object other) { if (other is ParameterInformation && other.runtimeType == ParameterInformation) { - return label == other.label && - documentation == other.documentation && + return documentation == other.documentation && + label == other.label && true; } return false; @@ -27938,8 +27938,8 @@ class ParameterInformation implements ToJsonable { @override int get hashCode => Object.hash( - label, documentation, + label, ); @override @@ -28102,17 +28102,17 @@ class Position implements ToJsonable { ); Position({ - required this.line, required this.character, + required this.line, }); static Position fromJson(Map json) { - final lineJson = json['line']; - final line = lineJson as int; final characterJson = json['character']; final character = characterJson as int; + final lineJson = json['line']; + final line = lineJson as int; return Position( - line: line, character: character, + line: line, ); } @@ -28128,31 +28128,13 @@ class Position implements ToJsonable { Map toJson() { var __result = {}; - __result['line'] = line; __result['character'] = character; + __result['line'] = line; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('line'); - try { - if (!obj.containsKey('line')) { - reporter.reportError('must not be undefined'); - return false; - } - final line = obj['line']; - if (line == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(line is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('character'); try { if (!obj.containsKey('character')) { @@ -28171,6 +28153,24 @@ class Position implements ToJsonable { } finally { reporter.pop(); } + reporter.push('line'); + try { + if (!obj.containsKey('line')) { + reporter.reportError('must not be undefined'); + return false; + } + final line = obj['line']; + if (line == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(line is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type Position'); @@ -28181,15 +28181,15 @@ class Position implements ToJsonable { @override bool operator ==(Object other) { if (other is Position && other.runtimeType == Position) { - return line == other.line && character == other.character && true; + return character == other.character && line == other.line && true; } return false; } @override int get hashCode => Object.hash( - line, character, + line, ); @override @@ -28241,18 +28241,18 @@ class PrepareRenameParams implements TextDocumentPositionParams, ToJsonable { ); PrepareRenameParams({ - required this.textDocument, required this.position, + required this.textDocument, }); static PrepareRenameParams fromJson(Map json) { + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); return PrepareRenameParams( - textDocument: textDocument, position: position, + textDocument: textDocument, ); } @@ -28264,31 +28264,13 @@ class PrepareRenameParams implements TextDocumentPositionParams, ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -28307,6 +28289,24 @@ class PrepareRenameParams implements TextDocumentPositionParams, ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type PrepareRenameParams'); @@ -28318,8 +28318,8 @@ class PrepareRenameParams implements TextDocumentPositionParams, ToJsonable { bool operator ==(Object other) { if (other is PrepareRenameParams && other.runtimeType == PrepareRenameParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && true; } return false; @@ -28327,8 +28327,8 @@ class PrepareRenameParams implements TextDocumentPositionParams, ToJsonable { @override int get hashCode => Object.hash( - textDocument, position, + textDocument, ); @override @@ -28550,14 +28550,18 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { ); PublishDiagnosticsClientCapabilities({ + this.codeDescriptionSupport, + this.dataSupport, this.relatedInformation, this.tagSupport, this.versionSupport, - this.codeDescriptionSupport, - this.dataSupport, }); static PublishDiagnosticsClientCapabilities fromJson( Map json) { + final codeDescriptionSupportJson = json['codeDescriptionSupport']; + final codeDescriptionSupport = codeDescriptionSupportJson as bool?; + final dataSupportJson = json['dataSupport']; + final dataSupport = dataSupportJson as bool?; final relatedInformationJson = json['relatedInformation']; final relatedInformation = relatedInformationJson as bool?; final tagSupportJson = json['tagSupport']; @@ -28567,16 +28571,12 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { : null; final versionSupportJson = json['versionSupport']; final versionSupport = versionSupportJson as bool?; - final codeDescriptionSupportJson = json['codeDescriptionSupport']; - final codeDescriptionSupport = codeDescriptionSupportJson as bool?; - final dataSupportJson = json['dataSupport']; - final dataSupport = dataSupportJson as bool?; return PublishDiagnosticsClientCapabilities( + codeDescriptionSupport: codeDescriptionSupport, + dataSupport: dataSupport, relatedInformation: relatedInformation, tagSupport: tagSupport, versionSupport: versionSupport, - codeDescriptionSupport: codeDescriptionSupport, - dataSupport: dataSupport, ); } @@ -28605,6 +28605,12 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; + if (codeDescriptionSupport != null) { + __result['codeDescriptionSupport'] = codeDescriptionSupport; + } + if (dataSupport != null) { + __result['dataSupport'] = dataSupport; + } if (relatedInformation != null) { __result['relatedInformation'] = relatedInformation; } @@ -28614,17 +28620,32 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { if (versionSupport != null) { __result['versionSupport'] = versionSupport; } - if (codeDescriptionSupport != null) { - __result['codeDescriptionSupport'] = codeDescriptionSupport; - } - if (dataSupport != null) { - __result['dataSupport'] = dataSupport; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('codeDescriptionSupport'); + try { + final codeDescriptionSupport = obj['codeDescriptionSupport']; + if (codeDescriptionSupport != null && + !(codeDescriptionSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('dataSupport'); + try { + final dataSupport = obj['dataSupport']; + if (dataSupport != null && !(dataSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('relatedInformation'); try { final relatedInformation = obj['relatedInformation']; @@ -28658,27 +28679,6 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('codeDescriptionSupport'); - try { - final codeDescriptionSupport = obj['codeDescriptionSupport']; - if (codeDescriptionSupport != null && - !(codeDescriptionSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('dataSupport'); - try { - final dataSupport = obj['dataSupport']; - if (dataSupport != null && !(dataSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter @@ -28691,11 +28691,11 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is PublishDiagnosticsClientCapabilities && other.runtimeType == PublishDiagnosticsClientCapabilities) { - return relatedInformation == other.relatedInformation && + return codeDescriptionSupport == other.codeDescriptionSupport && + dataSupport == other.dataSupport && + relatedInformation == other.relatedInformation && tagSupport == other.tagSupport && versionSupport == other.versionSupport && - codeDescriptionSupport == other.codeDescriptionSupport && - dataSupport == other.dataSupport && true; } return false; @@ -28703,11 +28703,11 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( + codeDescriptionSupport, + dataSupport, relatedInformation, tagSupport, versionSupport, - codeDescriptionSupport, - dataSupport, ); @override @@ -28798,23 +28798,23 @@ class PublishDiagnosticsParams implements ToJsonable { ); PublishDiagnosticsParams({ + required this.diagnostics, required this.uri, this.version, - required this.diagnostics, }); static PublishDiagnosticsParams fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final versionJson = json['version']; - final version = versionJson as int?; final diagnosticsJson = json['diagnostics']; final diagnostics = (diagnosticsJson as List) .map((item) => Diagnostic.fromJson(item as Map)) .toList(); + final uriJson = json['uri']; + final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int?; return PublishDiagnosticsParams( + diagnostics: diagnostics, uri: uri, version: version, - diagnostics: diagnostics, ); } @@ -28831,16 +28831,36 @@ class PublishDiagnosticsParams implements ToJsonable { Map toJson() { var __result = {}; + __result['diagnostics'] = diagnostics.map((item) => item.toJson()).toList(); __result['uri'] = uri; if (version != null) { __result['version'] = version; } - __result['diagnostics'] = diagnostics.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('diagnostics'); + try { + if (!obj.containsKey('diagnostics')) { + reporter.reportError('must not be undefined'); + return false; + } + final diagnostics = obj['diagnostics']; + if (diagnostics == null) { + reporter.reportError('must not be null'); + return false; + } + if (!((diagnostics is List && + (diagnostics + .every((item) => Diagnostic.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -28869,26 +28889,6 @@ class PublishDiagnosticsParams implements ToJsonable { } finally { reporter.pop(); } - reporter.push('diagnostics'); - try { - if (!obj.containsKey('diagnostics')) { - reporter.reportError('must not be undefined'); - return false; - } - final diagnostics = obj['diagnostics']; - if (diagnostics == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((diagnostics is List && - (diagnostics - .every((item) => Diagnostic.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type PublishDiagnosticsParams'); @@ -28900,10 +28900,10 @@ class PublishDiagnosticsParams implements ToJsonable { bool operator ==(Object other) { if (other is PublishDiagnosticsParams && other.runtimeType == PublishDiagnosticsParams) { - return uri == other.uri && - version == other.version && - listEqual(diagnostics, other.diagnostics, + return listEqual(diagnostics, other.diagnostics, (Diagnostic a, Diagnostic b) => a == b) && + uri == other.uri && + version == other.version && true; } return false; @@ -28911,9 +28911,9 @@ class PublishDiagnosticsParams implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(diagnostics), uri, version, - lspHashCode(diagnostics), ); @override @@ -28927,17 +28927,17 @@ class Range implements ToJsonable { ); Range({ - required this.start, required this.end, + required this.start, }); static Range fromJson(Map json) { - final startJson = json['start']; - final start = Position.fromJson(startJson as Map); final endJson = json['end']; final end = Position.fromJson(endJson as Map); + final startJson = json['start']; + final start = Position.fromJson(startJson as Map); return Range( - start: start, end: end, + start: start, ); } @@ -28949,31 +28949,13 @@ class Range implements ToJsonable { Map toJson() { var __result = {}; - __result['start'] = start.toJson(); __result['end'] = end.toJson(); + __result['start'] = start.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('start'); - try { - if (!obj.containsKey('start')) { - reporter.reportError('must not be undefined'); - return false; - } - final start = obj['start']; - if (start == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Position.canParse(start, reporter))) { - reporter.reportError('must be of type Position'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('end'); try { if (!obj.containsKey('end')) { @@ -28992,6 +28974,24 @@ class Range implements ToJsonable { } finally { reporter.pop(); } + reporter.push('start'); + try { + if (!obj.containsKey('start')) { + reporter.reportError('must not be undefined'); + return false; + } + final start = obj['start']; + if (start == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Position.canParse(start, reporter))) { + reporter.reportError('must be of type Position'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type Range'); @@ -29002,15 +29002,15 @@ class Range implements ToJsonable { @override bool operator ==(Object other) { if (other is Range && other.runtimeType == Range) { - return start == other.start && end == other.end && true; + return end == other.end && start == other.start && true; } return false; } @override int get hashCode => Object.hash( - start, end, + start, ); @override @@ -29024,17 +29024,17 @@ class RangeAndPlaceholder implements ToJsonable { ); RangeAndPlaceholder({ - required this.range, required this.placeholder, + required this.range, }); static RangeAndPlaceholder fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final placeholderJson = json['placeholder']; final placeholder = placeholderJson as String; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return RangeAndPlaceholder( - range: range, placeholder: placeholder, + range: range, ); } @@ -29043,31 +29043,13 @@ class RangeAndPlaceholder implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); __result['placeholder'] = placeholder; + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('placeholder'); try { if (!obj.containsKey('placeholder')) { @@ -29086,6 +29068,24 @@ class RangeAndPlaceholder implements ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type RangeAndPlaceholder'); @@ -29097,15 +29097,15 @@ class RangeAndPlaceholder implements ToJsonable { bool operator ==(Object other) { if (other is RangeAndPlaceholder && other.runtimeType == RangeAndPlaceholder) { - return range == other.range && placeholder == other.placeholder && true; + return placeholder == other.placeholder && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, placeholder, + range, ); @override @@ -29320,28 +29320,15 @@ class ReferenceParams ReferenceParams({ required this.context, - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static ReferenceParams fromJson(Map json) { final contextJson = json['context']; final context = ReferenceContext.fromJson(contextJson as Map); - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -29350,12 +29337,25 @@ class ReferenceParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return ReferenceParams( context: context, - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -29377,14 +29377,14 @@ class ReferenceParams Map toJson() { var __result = {}; __result['context'] = context.toJson(); - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -29408,19 +29408,12 @@ class ReferenceParams } finally { reporter.pop(); } - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -29444,22 +29437,29 @@ class ReferenceParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -29477,10 +29477,10 @@ class ReferenceParams bool operator ==(Object other) { if (other is ReferenceParams && other.runtimeType == ReferenceParams) { return context == other.context && - textDocument == other.textDocument && - position == other.position && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + position == other.position && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken && true; } return false; @@ -29489,10 +29489,10 @@ class ReferenceParams @override int get hashCode => Object.hash( context, - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -29888,10 +29888,10 @@ class RelatedFullDocumentDiagnosticReport ); RelatedFullDocumentDiagnosticReport({ - this.relatedDocuments, - this.kind = 'full', - this.resultId, required this.items, + this.kind = 'full', + this.relatedDocuments, + this.resultId, }) { if (kind != 'full') { throw 'kind may only be the literal \'full\''; @@ -29899,6 +29899,12 @@ class RelatedFullDocumentDiagnosticReport } static RelatedFullDocumentDiagnosticReport fromJson( Map json) { + final itemsJson = json['items']; + final items = (itemsJson as List) + .map((item) => Diagnostic.fromJson(item as Map)) + .toList(); + final kindJson = json['kind']; + final kind = kindJson as String; final relatedDocumentsJson = json['relatedDocuments']; final relatedDocuments = (relatedDocumentsJson as Map?) ?.map((key, value) => MapEntry( @@ -29913,19 +29919,13 @@ class RelatedFullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport.fromJson( value as Map)) : (throw '''$value was not one of (FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport)''')))); - final kindJson = json['kind']; - final kind = kindJson as String; final resultIdJson = json['resultId']; final resultId = resultIdJson as String?; - final itemsJson = json['items']; - final items = (itemsJson as List) - .map((item) => Diagnostic.fromJson(item as Map)) - .toList(); return RelatedFullDocumentDiagnosticReport( - relatedDocuments: relatedDocuments, - kind: kind, - resultId: resultId, items: items, + kind: kind, + relatedDocuments: relatedDocuments, + resultId: resultId, ); } @@ -29952,33 +29952,33 @@ class RelatedFullDocumentDiagnosticReport Map toJson() { var __result = {}; + __result['items'] = items.map((item) => item.toJson()).toList(); + __result['kind'] = kind; if (relatedDocuments != null) { __result['relatedDocuments'] = relatedDocuments; } - __result['kind'] = kind; if (resultId != null) { __result['resultId'] = resultId; } - __result['items'] = items.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('relatedDocuments'); + reporter.push('items'); try { - final relatedDocuments = obj['relatedDocuments']; - if (relatedDocuments != null && - !((relatedDocuments is Map && - (relatedDocuments.keys.every((item) => - item is String && - relatedDocuments.values.every((item) => - (FullDocumentDiagnosticReport.canParse( - item, reporter) || - UnchangedDocumentDiagnosticReport.canParse( - item, reporter)))))))) { - reporter.reportError( - 'must be of type Map>'); + if (!obj.containsKey('items')) { + reporter.reportError('must not be undefined'); + return false; + } + final items = obj['items']; + if (items == null) { + reporter.reportError('must not be null'); + return false; + } + if (!((items is List && + (items.every((item) => Diagnostic.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -30002,30 +30002,30 @@ class RelatedFullDocumentDiagnosticReport } finally { reporter.pop(); } - reporter.push('resultId'); + reporter.push('relatedDocuments'); try { - final resultId = obj['resultId']; - if (resultId != null && !(resultId is String)) { - reporter.reportError('must be of type String'); + final relatedDocuments = obj['relatedDocuments']; + if (relatedDocuments != null && + !((relatedDocuments is Map && + (relatedDocuments.keys.every((item) => + item is String && + relatedDocuments.values.every((item) => + (FullDocumentDiagnosticReport.canParse( + item, reporter) || + UnchangedDocumentDiagnosticReport.canParse( + item, reporter)))))))) { + reporter.reportError( + 'must be of type Map>'); return false; } } finally { reporter.pop(); } - reporter.push('items'); + reporter.push('resultId'); try { - if (!obj.containsKey('items')) { - reporter.reportError('must not be undefined'); - return false; - } - final items = obj['items']; - if (items == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((items is List && - (items.every((item) => Diagnostic.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + final resultId = obj['resultId']; + if (resultId != null && !(resultId is String)) { + reporter.reportError('must be of type String'); return false; } } finally { @@ -30043,7 +30043,10 @@ class RelatedFullDocumentDiagnosticReport bool operator ==(Object other) { if (other is RelatedFullDocumentDiagnosticReport && other.runtimeType == RelatedFullDocumentDiagnosticReport) { - return mapEqual( + return listEqual( + items, other.items, (Diagnostic a, Diagnostic b) => a == b) && + kind == other.kind && + mapEqual( relatedDocuments, other.relatedDocuments, (Either2 b) => a == b) && - kind == other.kind && resultId == other.resultId && - listEqual( - items, other.items, (Diagnostic a, Diagnostic b) => a == b) && true; } return false; @@ -30064,10 +30064,10 @@ class RelatedFullDocumentDiagnosticReport @override int get hashCode => Object.hash( - lspHashCode(relatedDocuments), - kind, - resultId, lspHashCode(items), + kind, + lspHashCode(relatedDocuments), + resultId, ); @override @@ -30084,8 +30084,8 @@ class RelatedUnchangedDocumentDiagnosticReport ); RelatedUnchangedDocumentDiagnosticReport({ - this.relatedDocuments, this.kind = 'unchanged', + this.relatedDocuments, required this.resultId, }) { if (kind != 'unchanged') { @@ -30094,6 +30094,8 @@ class RelatedUnchangedDocumentDiagnosticReport } static RelatedUnchangedDocumentDiagnosticReport fromJson( Map json) { + final kindJson = json['kind']; + final kind = kindJson as String; final relatedDocumentsJson = json['relatedDocuments']; final relatedDocuments = (relatedDocumentsJson as Map?) ?.map((key, value) => MapEntry( @@ -30108,13 +30110,11 @@ class RelatedUnchangedDocumentDiagnosticReport UnchangedDocumentDiagnosticReport.fromJson( value as Map)) : (throw '''$value was not one of (FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport)''')))); - final kindJson = json['kind']; - final kind = kindJson as String; final resultIdJson = json['resultId']; final resultId = resultIdJson as String; return RelatedUnchangedDocumentDiagnosticReport( - relatedDocuments: relatedDocuments, kind: kind, + relatedDocuments: relatedDocuments, resultId: resultId, ); } @@ -30140,16 +30140,34 @@ class RelatedUnchangedDocumentDiagnosticReport Map toJson() { var __result = {}; + __result['kind'] = kind; if (relatedDocuments != null) { __result['relatedDocuments'] = relatedDocuments; } - __result['kind'] = kind; __result['resultId'] = resultId; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('kind'); + try { + if (!obj.containsKey('kind')) { + reporter.reportError('must not be undefined'); + return false; + } + final kind = obj['kind']; + if (kind == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(kind == 'unchanged')) { + reporter.reportError('must be the literal \'unchanged\''); + return false; + } + } finally { + reporter.pop(); + } reporter.push('relatedDocuments'); try { final relatedDocuments = obj['relatedDocuments']; @@ -30169,24 +30187,6 @@ class RelatedUnchangedDocumentDiagnosticReport } finally { reporter.pop(); } - reporter.push('kind'); - try { - if (!obj.containsKey('kind')) { - reporter.reportError('must not be undefined'); - return false; - } - final kind = obj['kind']; - if (kind == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(kind == 'unchanged')) { - reporter.reportError('must be the literal \'unchanged\''); - return false; - } - } finally { - reporter.pop(); - } reporter.push('resultId'); try { if (!obj.containsKey('resultId')) { @@ -30217,7 +30217,8 @@ class RelatedUnchangedDocumentDiagnosticReport bool operator ==(Object other) { if (other is RelatedUnchangedDocumentDiagnosticReport && other.runtimeType == RelatedUnchangedDocumentDiagnosticReport) { - return mapEqual( + return kind == other.kind && + mapEqual( relatedDocuments, other.relatedDocuments, (Either2 b) => a == b) && - kind == other.kind && resultId == other.resultId && true; } @@ -30236,8 +30236,8 @@ class RelatedUnchangedDocumentDiagnosticReport @override int get hashCode => Object.hash( - lspHashCode(relatedDocuments), kind, + lspHashCode(relatedDocuments), resultId, ); @@ -30362,13 +30362,15 @@ class RenameClientCapabilities implements ToJsonable { RenameClientCapabilities({ this.dynamicRegistration, + this.honorsChangeAnnotations, this.prepareSupport, this.prepareSupportDefaultBehavior, - this.honorsChangeAnnotations, }); static RenameClientCapabilities fromJson(Map json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final honorsChangeAnnotationsJson = json['honorsChangeAnnotations']; + final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?; final prepareSupportJson = json['prepareSupport']; final prepareSupport = prepareSupportJson as bool?; final prepareSupportDefaultBehaviorJson = @@ -30378,13 +30380,11 @@ class RenameClientCapabilities implements ToJsonable { ? PrepareSupportDefaultBehavior.fromJson( prepareSupportDefaultBehaviorJson as int) : null; - final honorsChangeAnnotationsJson = json['honorsChangeAnnotations']; - final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?; return RenameClientCapabilities( dynamicRegistration: dynamicRegistration, + honorsChangeAnnotations: honorsChangeAnnotations, prepareSupport: prepareSupport, prepareSupportDefaultBehavior: prepareSupportDefaultBehavior, - honorsChangeAnnotations: honorsChangeAnnotations, ); } @@ -30415,6 +30415,9 @@ class RenameClientCapabilities implements ToJsonable { if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } + if (honorsChangeAnnotations != null) { + __result['honorsChangeAnnotations'] = honorsChangeAnnotations; + } if (prepareSupport != null) { __result['prepareSupport'] = prepareSupport; } @@ -30422,9 +30425,6 @@ class RenameClientCapabilities implements ToJsonable { __result['prepareSupportDefaultBehavior'] = prepareSupportDefaultBehavior?.toJson(); } - if (honorsChangeAnnotations != null) { - __result['honorsChangeAnnotations'] = honorsChangeAnnotations; - } return __result; } @@ -30440,6 +30440,17 @@ class RenameClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('honorsChangeAnnotations'); + try { + final honorsChangeAnnotations = obj['honorsChangeAnnotations']; + if (honorsChangeAnnotations != null && + !(honorsChangeAnnotations is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('prepareSupport'); try { final prepareSupport = obj['prepareSupport']; @@ -30463,17 +30474,6 @@ class RenameClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('honorsChangeAnnotations'); - try { - final honorsChangeAnnotations = obj['honorsChangeAnnotations']; - if (honorsChangeAnnotations != null && - !(honorsChangeAnnotations is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type RenameClientCapabilities'); @@ -30486,10 +30486,10 @@ class RenameClientCapabilities implements ToJsonable { if (other is RenameClientCapabilities && other.runtimeType == RenameClientCapabilities) { return dynamicRegistration == other.dynamicRegistration && + honorsChangeAnnotations == other.honorsChangeAnnotations && prepareSupport == other.prepareSupport && prepareSupportDefaultBehavior == other.prepareSupportDefaultBehavior && - honorsChangeAnnotations == other.honorsChangeAnnotations && true; } return false; @@ -30498,9 +30498,9 @@ class RenameClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( dynamicRegistration, + honorsChangeAnnotations, prepareSupport, prepareSupportDefaultBehavior, - honorsChangeAnnotations, ); @override @@ -30515,35 +30515,35 @@ class RenameFile implements ToJsonable { ); RenameFile({ - this.kind = 'rename', - required this.oldUri, - required this.newUri, - this.options, this.annotationId, + this.kind = 'rename', + required this.newUri, + required this.oldUri, + this.options, }) { if (kind != 'rename') { throw 'kind may only be the literal \'rename\''; } } static RenameFile fromJson(Map json) { + final annotationIdJson = json['annotationId']; + final annotationId = annotationIdJson as String?; final kindJson = json['kind']; final kind = kindJson as String; - final oldUriJson = json['oldUri']; - final oldUri = oldUriJson as String; final newUriJson = json['newUri']; final newUri = newUriJson as String; + final oldUriJson = json['oldUri']; + final oldUri = oldUriJson as String; final optionsJson = json['options']; final options = optionsJson != null ? RenameFileOptions.fromJson(optionsJson as Map) : null; - final annotationIdJson = json['annotationId']; - final annotationId = annotationIdJson as String?; return RenameFile( - kind: kind, - oldUri: oldUri, - newUri: newUri, - options: options, annotationId: annotationId, + kind: kind, + newUri: newUri, + oldUri: oldUri, + options: options, ); } @@ -30565,20 +30565,30 @@ class RenameFile implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; - __result['oldUri'] = oldUri; - __result['newUri'] = newUri; - if (options != null) { - __result['options'] = options?.toJson(); - } if (annotationId != null) { __result['annotationId'] = annotationId; } + __result['kind'] = kind; + __result['newUri'] = newUri; + __result['oldUri'] = oldUri; + if (options != null) { + __result['options'] = options?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('annotationId'); + try { + final annotationId = obj['annotationId']; + if (annotationId != null && !(annotationId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -30597,24 +30607,6 @@ class RenameFile implements ToJsonable { } finally { reporter.pop(); } - reporter.push('oldUri'); - try { - if (!obj.containsKey('oldUri')) { - reporter.reportError('must not be undefined'); - return false; - } - final oldUri = obj['oldUri']; - if (oldUri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(oldUri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('newUri'); try { if (!obj.containsKey('newUri')) { @@ -30633,6 +30625,24 @@ class RenameFile implements ToJsonable { } finally { reporter.pop(); } + reporter.push('oldUri'); + try { + if (!obj.containsKey('oldUri')) { + reporter.reportError('must not be undefined'); + return false; + } + final oldUri = obj['oldUri']; + if (oldUri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(oldUri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('options'); try { final options = obj['options']; @@ -30644,16 +30654,6 @@ class RenameFile implements ToJsonable { } finally { reporter.pop(); } - reporter.push('annotationId'); - try { - final annotationId = obj['annotationId']; - if (annotationId != null && !(annotationId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type RenameFile'); @@ -30664,11 +30664,11 @@ class RenameFile implements ToJsonable { @override bool operator ==(Object other) { if (other is RenameFile && other.runtimeType == RenameFile) { - return kind == other.kind && - oldUri == other.oldUri && + return annotationId == other.annotationId && + kind == other.kind && newUri == other.newUri && + oldUri == other.oldUri && options == other.options && - annotationId == other.annotationId && true; } return false; @@ -30676,11 +30676,11 @@ class RenameFile implements ToJsonable { @override int get hashCode => Object.hash( - kind, - oldUri, - newUri, - options, annotationId, + kind, + newUri, + oldUri, + options, ); @override @@ -30695,17 +30695,17 @@ class RenameFileOptions implements ToJsonable { ); RenameFileOptions({ - this.overwrite, this.ignoreIfExists, + this.overwrite, }); static RenameFileOptions fromJson(Map json) { - final overwriteJson = json['overwrite']; - final overwrite = overwriteJson as bool?; final ignoreIfExistsJson = json['ignoreIfExists']; final ignoreIfExists = ignoreIfExistsJson as bool?; + final overwriteJson = json['overwrite']; + final overwrite = overwriteJson as bool?; return RenameFileOptions( - overwrite: overwrite, ignoreIfExists: ignoreIfExists, + overwrite: overwrite, ); } @@ -30717,31 +30717,31 @@ class RenameFileOptions implements ToJsonable { Map toJson() { var __result = {}; - if (overwrite != null) { - __result['overwrite'] = overwrite; - } if (ignoreIfExists != null) { __result['ignoreIfExists'] = ignoreIfExists; } + if (overwrite != null) { + __result['overwrite'] = overwrite; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('overwrite'); + reporter.push('ignoreIfExists'); try { - final overwrite = obj['overwrite']; - if (overwrite != null && !(overwrite is bool)) { + final ignoreIfExists = obj['ignoreIfExists']; + if (ignoreIfExists != null && !(ignoreIfExists is bool)) { reporter.reportError('must be of type bool'); return false; } } finally { reporter.pop(); } - reporter.push('ignoreIfExists'); + reporter.push('overwrite'); try { - final ignoreIfExists = obj['ignoreIfExists']; - if (ignoreIfExists != null && !(ignoreIfExists is bool)) { + final overwrite = obj['overwrite']; + if (overwrite != null && !(overwrite is bool)) { reporter.reportError('must be of type bool'); return false; } @@ -30758,8 +30758,8 @@ class RenameFileOptions implements ToJsonable { @override bool operator ==(Object other) { if (other is RenameFileOptions && other.runtimeType == RenameFileOptions) { - return overwrite == other.overwrite && - ignoreIfExists == other.ignoreIfExists && + return ignoreIfExists == other.ignoreIfExists && + overwrite == other.overwrite && true; } return false; @@ -30767,8 +30767,8 @@ class RenameFileOptions implements ToJsonable { @override int get hashCode => Object.hash( - overwrite, ignoreIfExists, + overwrite, ); @override @@ -30949,18 +30949,18 @@ class RenameParams RenameParams({ required this.newName, - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static RenameParams fromJson(Map json) { final newNameJson = json['newName']; final newName = newNameJson as String; + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -30971,8 +30971,8 @@ class RenameParams : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return RenameParams( newName: newName, - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -30993,8 +30993,8 @@ class RenameParams Map toJson() { var __result = {}; __result['newName'] = newName; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -31021,24 +31021,6 @@ class RenameParams } finally { reporter.pop(); } - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -31057,6 +31039,24 @@ class RenameParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -31079,8 +31079,8 @@ class RenameParams bool operator ==(Object other) { if (other is RenameParams && other.runtimeType == RenameParams) { return newName == other.newName && - textDocument == other.textDocument && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -31090,8 +31090,8 @@ class RenameParams @override int get hashCode => Object.hash( newName, - textDocument, position, + textDocument, workDoneToken, ); @@ -31224,33 +31224,33 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { ); RequestMessage({ + this.clientRequestTime, required this.id, + required this.jsonrpc, required this.method, this.params, - required this.jsonrpc, - this.clientRequestTime, }); static RequestMessage fromJson(Map json) { + final clientRequestTimeJson = json['clientRequestTime']; + final clientRequestTime = clientRequestTimeJson as int?; final idJson = json['id']; final id = idJson is int ? Either2.t1(idJson) : (idJson is String ? Either2.t2(idJson) : (throw '''$idJson was not one of (int, String)''')); + final jsonrpcJson = json['jsonrpc']; + final jsonrpc = jsonrpcJson as String; final methodJson = json['method']; final method = Method.fromJson(methodJson as String); final paramsJson = json['params']; final params = paramsJson; - final jsonrpcJson = json['jsonrpc']; - final jsonrpc = jsonrpcJson as String; - final clientRequestTimeJson = json['clientRequestTime']; - final clientRequestTime = clientRequestTimeJson as int?; return RequestMessage( + clientRequestTime: clientRequestTime, id: id, + jsonrpc: jsonrpc, method: method, params: params, - jsonrpc: jsonrpc, - clientRequestTime: clientRequestTime, ); } @@ -31268,20 +31268,30 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { Map toJson() { var __result = {}; + if (clientRequestTime != null) { + __result['clientRequestTime'] = clientRequestTime; + } __result['id'] = id; + __result['jsonrpc'] = jsonrpc; __result['method'] = method.toJson(); if (params != null) { __result['params'] = params; } - __result['jsonrpc'] = jsonrpc; - if (clientRequestTime != null) { - __result['clientRequestTime'] = clientRequestTime; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('clientRequestTime'); + try { + final clientRequestTime = obj['clientRequestTime']; + if (clientRequestTime != null && !(clientRequestTime is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('id'); try { if (!obj.containsKey('id')) { @@ -31300,24 +31310,6 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { } finally { reporter.pop(); } - reporter.push('method'); - try { - if (!obj.containsKey('method')) { - reporter.reportError('must not be undefined'); - return false; - } - final method = obj['method']; - if (method == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Method.canParse(method, reporter))) { - reporter.reportError('must be of type Method'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('jsonrpc'); try { if (!obj.containsKey('jsonrpc')) { @@ -31336,11 +31328,19 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { } finally { reporter.pop(); } - reporter.push('clientRequestTime'); + reporter.push('method'); try { - final clientRequestTime = obj['clientRequestTime']; - if (clientRequestTime != null && !(clientRequestTime is int)) { - reporter.reportError('must be of type int'); + if (!obj.containsKey('method')) { + reporter.reportError('must not be undefined'); + return false; + } + final method = obj['method']; + if (method == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Method.canParse(method, reporter))) { + reporter.reportError('must be of type Method'); return false; } } finally { @@ -31356,11 +31356,11 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { @override bool operator ==(Object other) { if (other is RequestMessage && other.runtimeType == RequestMessage) { - return id == other.id && + return clientRequestTime == other.clientRequestTime && + id == other.id && + jsonrpc == other.jsonrpc && method == other.method && params == other.params && - jsonrpc == other.jsonrpc && - clientRequestTime == other.clientRequestTime && true; } return false; @@ -31368,11 +31368,11 @@ class RequestMessage implements Message, IncomingMessage, ToJsonable { @override int get hashCode => Object.hash( + clientRequestTime, id, + jsonrpc, method, params, - jsonrpc, - clientRequestTime, ); @override @@ -31424,20 +31424,20 @@ class ResponseError implements ToJsonable { ResponseError({ required this.code, - required this.message, this.data, + required this.message, }); static ResponseError fromJson(Map json) { final codeJson = json['code']; final code = ErrorCodes.fromJson(codeJson as int); - final messageJson = json['message']; - final message = messageJson as String; final dataJson = json['data']; final data = dataJson as String?; + final messageJson = json['message']; + final message = messageJson as String; return ResponseError( code: code, - message: message, data: data, + message: message, ); } @@ -31454,10 +31454,10 @@ class ResponseError implements ToJsonable { Map toJson() { var __result = {}; __result['code'] = code.toJson(); - __result['message'] = message; if (data != null) { __result['data'] = data; } + __result['message'] = message; return __result; } @@ -31481,6 +31481,16 @@ class ResponseError implements ToJsonable { } finally { reporter.pop(); } + reporter.push('data'); + try { + final data = obj['data']; + if (data != null && !(data is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('message'); try { if (!obj.containsKey('message')) { @@ -31499,16 +31509,6 @@ class ResponseError implements ToJsonable { } finally { reporter.pop(); } - reporter.push('data'); - try { - final data = obj['data']; - if (data != null && !(data is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ResponseError'); @@ -31520,8 +31520,8 @@ class ResponseError implements ToJsonable { bool operator ==(Object other) { if (other is ResponseError && other.runtimeType == ResponseError) { return code == other.code && - message == other.message && data == other.data && + message == other.message && true; } return false; @@ -31530,8 +31530,8 @@ class ResponseError implements ToJsonable { @override int get hashCode => Object.hash( code, - message, data, + message, ); @override @@ -31545,13 +31545,19 @@ class ResponseMessage implements Message, ToJsonable { ); ResponseMessage({ - this.id, - this.result, - this.error, - required this.jsonrpc, this.clientRequestTime, + this.error, + this.id, + required this.jsonrpc, + this.result, }); static ResponseMessage fromJson(Map json) { + final clientRequestTimeJson = json['clientRequestTime']; + final clientRequestTime = clientRequestTimeJson as int?; + final errorJson = json['error']; + final error = errorJson != null + ? ResponseError.fromJson(errorJson as Map) + : null; final idJson = json['id']; final id = idJson == null ? null @@ -31560,22 +31566,16 @@ class ResponseMessage implements Message, ToJsonable { : (idJson is String ? Either2.t2(idJson) : (throw '''$idJson was not one of (int, String)'''))); - final resultJson = json['result']; - final result = resultJson; - final errorJson = json['error']; - final error = errorJson != null - ? ResponseError.fromJson(errorJson as Map) - : null; final jsonrpcJson = json['jsonrpc']; final jsonrpc = jsonrpcJson as String; - final clientRequestTimeJson = json['clientRequestTime']; - final clientRequestTime = clientRequestTimeJson as int?; + final resultJson = json['result']; + final result = resultJson; return ResponseMessage( - id: id, - result: result, - error: error, - jsonrpc: jsonrpc, clientRequestTime: clientRequestTime, + error: error, + id: id, + jsonrpc: jsonrpc, + result: result, ); } @@ -31594,11 +31594,11 @@ class ResponseMessage implements Message, ToJsonable { Map toJson() { var __result = {}; - __result['id'] = id; - __result['jsonrpc'] = jsonrpc; if (clientRequestTime != null) { __result['clientRequestTime'] = clientRequestTime; } + __result['id'] = id; + __result['jsonrpc'] = jsonrpc; if (error != null && result != null) { throw 'result and error cannot both be set'; } else if (error != null) { @@ -31611,15 +31611,11 @@ class ResponseMessage implements Message, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('id'); + reporter.push('clientRequestTime'); try { - if (!obj.containsKey('id')) { - reporter.reportError('must not be undefined'); - return false; - } - final id = obj['id']; - if (id != null && !((id is int || id is String))) { - reporter.reportError('must be of type Either2'); + final clientRequestTime = obj['clientRequestTime']; + if (clientRequestTime != null && !(clientRequestTime is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -31635,6 +31631,20 @@ class ResponseMessage implements Message, ToJsonable { } finally { reporter.pop(); } + reporter.push('id'); + try { + if (!obj.containsKey('id')) { + reporter.reportError('must not be undefined'); + return false; + } + final id = obj['id']; + if (id != null && !((id is int || id is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('jsonrpc'); try { if (!obj.containsKey('jsonrpc')) { @@ -31653,16 +31663,6 @@ class ResponseMessage implements Message, ToJsonable { } finally { reporter.pop(); } - reporter.push('clientRequestTime'); - try { - final clientRequestTime = obj['clientRequestTime']; - if (clientRequestTime != null && !(clientRequestTime is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ResponseMessage'); @@ -31673,11 +31673,11 @@ class ResponseMessage implements Message, ToJsonable { @override bool operator ==(Object other) { if (other is ResponseMessage && other.runtimeType == ResponseMessage) { - return id == other.id && - result == other.result && + return clientRequestTime == other.clientRequestTime && error == other.error && + id == other.id && jsonrpc == other.jsonrpc && - clientRequestTime == other.clientRequestTime && + result == other.result && true; } return false; @@ -31685,11 +31685,11 @@ class ResponseMessage implements Message, ToJsonable { @override int get hashCode => Object.hash( - id, - result, - error, - jsonrpc, clientRequestTime, + error, + id, + jsonrpc, + result, ); @override @@ -31765,19 +31765,19 @@ class SelectionRange implements ToJsonable { ); SelectionRange({ - required this.range, this.parent, + required this.range, }); static SelectionRange fromJson(Map json) { - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final parentJson = json['parent']; final parent = parentJson != null ? SelectionRange.fromJson(parentJson as Map) : null; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return SelectionRange( - range: range, parent: parent, + range: range, ); } @@ -31790,15 +31790,25 @@ class SelectionRange implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); if (parent != null) { __result['parent'] = parent?.toJson(); } + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('parent'); + try { + final parent = obj['parent']; + if (parent != null && !(SelectionRange.canParse(parent, reporter))) { + reporter.reportError('must be of type SelectionRange'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('range'); try { if (!obj.containsKey('range')) { @@ -31817,16 +31827,6 @@ class SelectionRange implements ToJsonable { } finally { reporter.pop(); } - reporter.push('parent'); - try { - final parent = obj['parent']; - if (parent != null && !(SelectionRange.canParse(parent, reporter))) { - reporter.reportError('must be of type SelectionRange'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SelectionRange'); @@ -31837,15 +31837,15 @@ class SelectionRange implements ToJsonable { @override bool operator ==(Object other) { if (other is SelectionRange && other.runtimeType == SelectionRange) { - return range == other.range && parent == other.parent && true; + return parent == other.parent && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, parent, + range, ); @override @@ -31991,27 +31991,12 @@ class SelectionRangeParams ); SelectionRangeParams({ - required this.textDocument, - required this.positions, - this.workDoneToken, this.partialResultToken, + required this.positions, + required this.textDocument, + this.workDoneToken, }); static SelectionRangeParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionsJson = json['positions']; - final positions = (positionsJson as List) - .map((item) => Position.fromJson(item as Map)) - .toList(); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -32020,11 +32005,26 @@ class SelectionRangeParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionsJson = json['positions']; + final positions = (positionsJson as List) + .map((item) => Position.fromJson(item as Map)) + .toList(); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return SelectionRangeParams( - textDocument: textDocument, - positions: positions, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + positions: positions, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -32043,32 +32043,25 @@ class SelectionRangeParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['positions'] = positions.map((item) => item.toJson()).toList(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['positions'] = positions.map((item) => item.toJson()).toList(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -32093,22 +32086,29 @@ class SelectionRangeParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -32126,11 +32126,11 @@ class SelectionRangeParams bool operator ==(Object other) { if (other is SelectionRangeParams && other.runtimeType == SelectionRangeParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && listEqual( positions, other.positions, (Position a, Position b) => a == b) && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -32138,10 +32138,10 @@ class SelectionRangeParams @override int get hashCode => Object.hash( - textDocument, - lspHashCode(positions), - workDoneToken, partialResultToken, + lspHashCode(positions), + textDocument, + workDoneToken, ); @override @@ -32160,23 +32160,23 @@ class SelectionRangeRegistrationOptions ); SelectionRangeRegistrationOptions({ - this.workDoneProgress, this.documentSelector, this.id, + this.workDoneProgress, }); static SelectionRangeRegistrationOptions fromJson(Map json) { - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return SelectionRangeRegistrationOptions( - workDoneProgress: workDoneProgress, documentSelector: documentSelector, id: id, + workDoneProgress: workDoneProgress, ); } @@ -32191,28 +32191,18 @@ class SelectionRangeRegistrationOptions Map toJson() { var __result = {}; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } __result['documentSelector'] = documentSelector; if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -32240,6 +32230,16 @@ class SelectionRangeRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SelectionRangeRegistrationOptions'); @@ -32251,10 +32251,10 @@ class SelectionRangeRegistrationOptions bool operator ==(Object other) { if (other is SelectionRangeRegistrationOptions && other.runtimeType == SelectionRangeRegistrationOptions) { - return workDoneProgress == other.workDoneProgress && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -32262,9 +32262,9 @@ class SelectionRangeRegistrationOptions @override int get hashCode => Object.hash( - workDoneProgress, lspHashCode(documentSelector), id, + workDoneProgress, ); @override @@ -32358,18 +32358,18 @@ class SemanticTokens implements ToJsonable { ); SemanticTokens({ - this.resultId, required this.data, + this.resultId, }); static SemanticTokens fromJson(Map json) { - final resultIdJson = json['resultId']; - final resultId = resultIdJson as String?; final dataJson = json['data']; final data = (dataJson as List).map((item) => item as int).toList(); + final resultIdJson = json['resultId']; + final resultId = resultIdJson as String?; return SemanticTokens( - resultId: resultId, data: data, + resultId: resultId, ); } @@ -32384,25 +32384,15 @@ class SemanticTokens implements ToJsonable { Map toJson() { var __result = {}; + __result['data'] = data; if (resultId != null) { __result['resultId'] = resultId; } - __result['data'] = data; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('resultId'); - try { - final resultId = obj['resultId']; - if (resultId != null && !(resultId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('data'); try { if (!obj.containsKey('data')) { @@ -32421,6 +32411,16 @@ class SemanticTokens implements ToJsonable { } finally { reporter.pop(); } + reporter.push('resultId'); + try { + final resultId = obj['resultId']; + if (resultId != null && !(resultId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SemanticTokens'); @@ -32431,8 +32431,8 @@ class SemanticTokens implements ToJsonable { @override bool operator ==(Object other) { if (other is SemanticTokens && other.runtimeType == SemanticTokens) { - return resultId == other.resultId && - listEqual(data, other.data, (int a, int b) => a == b) && + return listEqual(data, other.data, (int a, int b) => a == b) && + resultId == other.resultId && true; } return false; @@ -32440,8 +32440,8 @@ class SemanticTokens implements ToJsonable { @override int get hashCode => Object.hash( - resultId, lspHashCode(data), + resultId, ); @override @@ -32455,52 +32455,52 @@ class SemanticTokensClientCapabilities implements ToJsonable { ); SemanticTokensClientCapabilities({ - this.dynamicRegistration, - required this.requests, - required this.tokenTypes, - required this.tokenModifiers, - required this.formats, - this.overlappingTokenSupport, - this.multilineTokenSupport, - this.serverCancelSupport, this.augmentsSyntaxTokens, + this.dynamicRegistration, + required this.formats, + this.multilineTokenSupport, + this.overlappingTokenSupport, + required this.requests, + this.serverCancelSupport, + required this.tokenModifiers, + required this.tokenTypes, }); static SemanticTokensClientCapabilities fromJson(Map json) { + final augmentsSyntaxTokensJson = json['augmentsSyntaxTokens']; + final augmentsSyntaxTokens = augmentsSyntaxTokensJson as bool?; final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; - final requestsJson = json['requests']; - final requests = SemanticTokensClientCapabilitiesRequests.fromJson( - requestsJson as Map); - final tokenTypesJson = json['tokenTypes']; - final tokenTypes = (tokenTypesJson as List) - .map((item) => item as String) - .toList(); - final tokenModifiersJson = json['tokenModifiers']; - final tokenModifiers = (tokenModifiersJson as List) - .map((item) => item as String) - .toList(); final formatsJson = json['formats']; final formats = (formatsJson as List) .map((item) => TokenFormat.fromJson(item as String)) .toList(); - final overlappingTokenSupportJson = json['overlappingTokenSupport']; - final overlappingTokenSupport = overlappingTokenSupportJson as bool?; final multilineTokenSupportJson = json['multilineTokenSupport']; final multilineTokenSupport = multilineTokenSupportJson as bool?; + final overlappingTokenSupportJson = json['overlappingTokenSupport']; + final overlappingTokenSupport = overlappingTokenSupportJson as bool?; + final requestsJson = json['requests']; + final requests = SemanticTokensClientCapabilitiesRequests.fromJson( + requestsJson as Map); final serverCancelSupportJson = json['serverCancelSupport']; final serverCancelSupport = serverCancelSupportJson as bool?; - final augmentsSyntaxTokensJson = json['augmentsSyntaxTokens']; - final augmentsSyntaxTokens = augmentsSyntaxTokensJson as bool?; + final tokenModifiersJson = json['tokenModifiers']; + final tokenModifiers = (tokenModifiersJson as List) + .map((item) => item as String) + .toList(); + final tokenTypesJson = json['tokenTypes']; + final tokenTypes = (tokenTypesJson as List) + .map((item) => item as String) + .toList(); return SemanticTokensClientCapabilities( - dynamicRegistration: dynamicRegistration, - requests: requests, - tokenTypes: tokenTypes, - tokenModifiers: tokenModifiers, - formats: formats, - overlappingTokenSupport: overlappingTokenSupport, - multilineTokenSupport: multilineTokenSupport, - serverCancelSupport: serverCancelSupport, augmentsSyntaxTokens: augmentsSyntaxTokens, + dynamicRegistration: dynamicRegistration, + formats: formats, + multilineTokenSupport: multilineTokenSupport, + overlappingTokenSupport: overlappingTokenSupport, + requests: requests, + serverCancelSupport: serverCancelSupport, + tokenModifiers: tokenModifiers, + tokenTypes: tokenTypes, ); } @@ -32552,30 +32552,40 @@ class SemanticTokensClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (dynamicRegistration != null) { - __result['dynamicRegistration'] = dynamicRegistration; - } - __result['requests'] = requests.toJson(); - __result['tokenTypes'] = tokenTypes; - __result['tokenModifiers'] = tokenModifiers; - __result['formats'] = formats.map((item) => item.toJson()).toList(); - if (overlappingTokenSupport != null) { - __result['overlappingTokenSupport'] = overlappingTokenSupport; - } - if (multilineTokenSupport != null) { - __result['multilineTokenSupport'] = multilineTokenSupport; - } - if (serverCancelSupport != null) { - __result['serverCancelSupport'] = serverCancelSupport; - } if (augmentsSyntaxTokens != null) { __result['augmentsSyntaxTokens'] = augmentsSyntaxTokens; } + if (dynamicRegistration != null) { + __result['dynamicRegistration'] = dynamicRegistration; + } + __result['formats'] = formats.map((item) => item.toJson()).toList(); + if (multilineTokenSupport != null) { + __result['multilineTokenSupport'] = multilineTokenSupport; + } + if (overlappingTokenSupport != null) { + __result['overlappingTokenSupport'] = overlappingTokenSupport; + } + __result['requests'] = requests.toJson(); + if (serverCancelSupport != null) { + __result['serverCancelSupport'] = serverCancelSupport; + } + __result['tokenModifiers'] = tokenModifiers; + __result['tokenTypes'] = tokenTypes; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('augmentsSyntaxTokens'); + try { + final augmentsSyntaxTokens = obj['augmentsSyntaxTokens']; + if (augmentsSyntaxTokens != null && !(augmentsSyntaxTokens is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('dynamicRegistration'); try { final dynamicRegistration = obj['dynamicRegistration']; @@ -32586,6 +32596,46 @@ class SemanticTokensClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('formats'); + try { + if (!obj.containsKey('formats')) { + reporter.reportError('must not be undefined'); + return false; + } + final formats = obj['formats']; + if (formats == null) { + reporter.reportError('must not be null'); + return false; + } + if (!((formats is List && + (formats.every((item) => TokenFormat.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('multilineTokenSupport'); + try { + final multilineTokenSupport = obj['multilineTokenSupport']; + if (multilineTokenSupport != null && !(multilineTokenSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('overlappingTokenSupport'); + try { + final overlappingTokenSupport = obj['overlappingTokenSupport']; + if (overlappingTokenSupport != null && + !(overlappingTokenSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('requests'); try { if (!obj.containsKey('requests')) { @@ -32606,20 +32656,11 @@ class SemanticTokensClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tokenTypes'); + reporter.push('serverCancelSupport'); try { - if (!obj.containsKey('tokenTypes')) { - reporter.reportError('must not be undefined'); - return false; - } - final tokenTypes = obj['tokenTypes']; - if (tokenTypes == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((tokenTypes is List && - (tokenTypes.every((item) => item is String))))) { - reporter.reportError('must be of type List'); + final serverCancelSupport = obj['serverCancelSupport']; + if (serverCancelSupport != null && !(serverCancelSupport is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -32644,61 +32685,20 @@ class SemanticTokensClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('formats'); + reporter.push('tokenTypes'); try { - if (!obj.containsKey('formats')) { + if (!obj.containsKey('tokenTypes')) { reporter.reportError('must not be undefined'); return false; } - final formats = obj['formats']; - if (formats == null) { + final tokenTypes = obj['tokenTypes']; + if (tokenTypes == null) { reporter.reportError('must not be null'); return false; } - if (!((formats is List && - (formats.every((item) => TokenFormat.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('overlappingTokenSupport'); - try { - final overlappingTokenSupport = obj['overlappingTokenSupport']; - if (overlappingTokenSupport != null && - !(overlappingTokenSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('multilineTokenSupport'); - try { - final multilineTokenSupport = obj['multilineTokenSupport']; - if (multilineTokenSupport != null && !(multilineTokenSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('serverCancelSupport'); - try { - final serverCancelSupport = obj['serverCancelSupport']; - if (serverCancelSupport != null && !(serverCancelSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('augmentsSyntaxTokens'); - try { - final augmentsSyntaxTokens = obj['augmentsSyntaxTokens']; - if (augmentsSyntaxTokens != null && !(augmentsSyntaxTokens is bool)) { - reporter.reportError('must be of type bool'); + if (!((tokenTypes is List && + (tokenTypes.every((item) => item is String))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -32715,18 +32715,18 @@ class SemanticTokensClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensClientCapabilities && other.runtimeType == SemanticTokensClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && - requests == other.requests && - listEqual( - tokenTypes, other.tokenTypes, (String a, String b) => a == b) && - listEqual(tokenModifiers, other.tokenModifiers, - (String a, String b) => a == b) && + return augmentsSyntaxTokens == other.augmentsSyntaxTokens && + dynamicRegistration == other.dynamicRegistration && listEqual(formats, other.formats, (TokenFormat a, TokenFormat b) => a == b) && - overlappingTokenSupport == other.overlappingTokenSupport && multilineTokenSupport == other.multilineTokenSupport && + overlappingTokenSupport == other.overlappingTokenSupport && + requests == other.requests && serverCancelSupport == other.serverCancelSupport && - augmentsSyntaxTokens == other.augmentsSyntaxTokens && + listEqual(tokenModifiers, other.tokenModifiers, + (String a, String b) => a == b) && + listEqual( + tokenTypes, other.tokenTypes, (String a, String b) => a == b) && true; } return false; @@ -32734,15 +32734,15 @@ class SemanticTokensClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - dynamicRegistration, - requests, - lspHashCode(tokenTypes), - lspHashCode(tokenModifiers), - lspHashCode(formats), - overlappingTokenSupport, - multilineTokenSupport, - serverCancelSupport, augmentsSyntaxTokens, + dynamicRegistration, + lspHashCode(formats), + multilineTokenSupport, + overlappingTokenSupport, + requests, + serverCancelSupport, + lspHashCode(tokenModifiers), + lspHashCode(tokenTypes), ); @override @@ -32864,22 +32864,11 @@ class SemanticTokensClientCapabilitiesRequests implements ToJsonable { ); SemanticTokensClientCapabilitiesRequests({ - this.range, this.full, + this.range, }); static SemanticTokensClientCapabilitiesRequests fromJson( Map json) { - final rangeJson = json['range']; - final range = rangeJson == null - ? null - : (rangeJson is bool - ? Either2.t1(rangeJson) - : (SemanticTokensClientCapabilitiesRange.canParse( - rangeJson, nullLspJsonReporter) - ? Either2.t2( - SemanticTokensClientCapabilitiesRange.fromJson( - rangeJson as Map)) - : (throw '''$rangeJson was not one of (bool, SemanticTokensClientCapabilitiesRange)'''))); final fullJson = json['full']; final full = fullJson == null ? null @@ -32891,9 +32880,20 @@ class SemanticTokensClientCapabilitiesRequests implements ToJsonable { SemanticTokensClientCapabilitiesFull.fromJson( fullJson as Map)) : (throw '''$fullJson was not one of (bool, SemanticTokensClientCapabilitiesFull)'''))); + final rangeJson = json['range']; + final range = rangeJson == null + ? null + : (rangeJson is bool + ? Either2.t1(rangeJson) + : (SemanticTokensClientCapabilitiesRange.canParse( + rangeJson, nullLspJsonReporter) + ? Either2.t2( + SemanticTokensClientCapabilitiesRange.fromJson( + rangeJson as Map)) + : (throw '''$rangeJson was not one of (bool, SemanticTokensClientCapabilitiesRange)'''))); return SemanticTokensClientCapabilitiesRequests( - range: range, full: full, + range: range, ); } @@ -32907,31 +32907,17 @@ class SemanticTokensClientCapabilitiesRequests implements ToJsonable { Map toJson() { var __result = {}; - if (range != null) { - __result['range'] = range; - } if (full != null) { __result['full'] = full; } + if (range != null) { + __result['range'] = range; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - final range = obj['range']; - if (range != null && - !((range is bool || - SemanticTokensClientCapabilitiesRange.canParse( - range, reporter)))) { - reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('full'); try { final full = obj['full']; @@ -32946,6 +32932,20 @@ class SemanticTokensClientCapabilitiesRequests implements ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + final range = obj['range']; + if (range != null && + !((range is bool || + SemanticTokensClientCapabilitiesRange.canParse( + range, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -32958,15 +32958,15 @@ class SemanticTokensClientCapabilitiesRequests implements ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensClientCapabilitiesRequests && other.runtimeType == SemanticTokensClientCapabilitiesRequests) { - return range == other.range && full == other.full && true; + return full == other.full && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, full, + range, ); @override @@ -32980,20 +32980,20 @@ class SemanticTokensDelta implements ToJsonable { ); SemanticTokensDelta({ - this.resultId, required this.edits, + this.resultId, }); static SemanticTokensDelta fromJson(Map json) { - final resultIdJson = json['resultId']; - final resultId = resultIdJson as String?; final editsJson = json['edits']; final edits = (editsJson as List) .map( (item) => SemanticTokensEdit.fromJson(item as Map)) .toList(); + final resultIdJson = json['resultId']; + final resultId = resultIdJson as String?; return SemanticTokensDelta( - resultId: resultId, edits: edits, + resultId: resultId, ); } @@ -33003,25 +33003,15 @@ class SemanticTokensDelta implements ToJsonable { Map toJson() { var __result = {}; + __result['edits'] = edits.map((item) => item.toJson()).toList(); if (resultId != null) { __result['resultId'] = resultId; } - __result['edits'] = edits.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('resultId'); - try { - final resultId = obj['resultId']; - if (resultId != null && !(resultId is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('edits'); try { if (!obj.containsKey('edits')) { @@ -33042,6 +33032,16 @@ class SemanticTokensDelta implements ToJsonable { } finally { reporter.pop(); } + reporter.push('resultId'); + try { + final resultId = obj['resultId']; + if (resultId != null && !(resultId is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SemanticTokensDelta'); @@ -33053,9 +33053,9 @@ class SemanticTokensDelta implements ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensDelta && other.runtimeType == SemanticTokensDelta) { - return resultId == other.resultId && - listEqual(edits, other.edits, + return listEqual(edits, other.edits, (SemanticTokensEdit a, SemanticTokensEdit b) => a == b) && + resultId == other.resultId && true; } return false; @@ -33063,8 +33063,8 @@ class SemanticTokensDelta implements ToJsonable { @override int get hashCode => Object.hash( - resultId, lspHashCode(edits), + resultId, ); @override @@ -33079,25 +33079,12 @@ class SemanticTokensDeltaParams ); SemanticTokensDeltaParams({ - required this.textDocument, - required this.previousResultId, - this.workDoneToken, this.partialResultToken, + required this.previousResultId, + required this.textDocument, + this.workDoneToken, }); static SemanticTokensDeltaParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final previousResultIdJson = json['previousResultId']; - final previousResultId = previousResultIdJson as String; - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -33106,11 +33093,24 @@ class SemanticTokensDeltaParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final previousResultIdJson = json['previousResultId']; + final previousResultId = previousResultIdJson as String; + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return SemanticTokensDeltaParams( - textDocument: textDocument, - previousResultId: previousResultId, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + previousResultId: previousResultId, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -33130,32 +33130,25 @@ class SemanticTokensDeltaParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['previousResultId'] = previousResultId; - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['previousResultId'] = previousResultId; + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -33179,22 +33172,29 @@ class SemanticTokensDeltaParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -33212,10 +33212,10 @@ class SemanticTokensDeltaParams bool operator ==(Object other) { if (other is SemanticTokensDeltaParams && other.runtimeType == SemanticTokensDeltaParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && previousResultId == other.previousResultId && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -33223,10 +33223,10 @@ class SemanticTokensDeltaParams @override int get hashCode => Object.hash( - textDocument, - previousResultId, - workDoneToken, partialResultToken, + previousResultId, + textDocument, + workDoneToken, ); @override @@ -33315,22 +33315,22 @@ class SemanticTokensEdit implements ToJsonable { ); SemanticTokensEdit({ - required this.start, - required this.deleteCount, this.data, + required this.deleteCount, + required this.start, }); static SemanticTokensEdit fromJson(Map json) { - final startJson = json['start']; - final start = startJson as int; - final deleteCountJson = json['deleteCount']; - final deleteCount = deleteCountJson as int; final dataJson = json['data']; final data = (dataJson as List?)?.map((item) => item as int).toList(); + final deleteCountJson = json['deleteCount']; + final deleteCount = deleteCountJson as int; + final startJson = json['start']; + final start = startJson as int; return SemanticTokensEdit( - start: start, - deleteCount: deleteCount, data: data, + deleteCount: deleteCount, + start: start, ); } @@ -33345,29 +33345,22 @@ class SemanticTokensEdit implements ToJsonable { Map toJson() { var __result = {}; - __result['start'] = start; - __result['deleteCount'] = deleteCount; if (data != null) { __result['data'] = data; } + __result['deleteCount'] = deleteCount; + __result['start'] = start; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('start'); + reporter.push('data'); try { - if (!obj.containsKey('start')) { - reporter.reportError('must not be undefined'); - return false; - } - final start = obj['start']; - if (start == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(start is int)) { - reporter.reportError('must be of type int'); + final data = obj['data']; + if (data != null && + !((data is List && (data.every((item) => item is int))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -33391,12 +33384,19 @@ class SemanticTokensEdit implements ToJsonable { } finally { reporter.pop(); } - reporter.push('data'); + reporter.push('start'); try { - final data = obj['data']; - if (data != null && - !((data is List && (data.every((item) => item is int))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('start')) { + reporter.reportError('must not be undefined'); + return false; + } + final start = obj['start']; + if (start == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(start is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -33413,9 +33413,9 @@ class SemanticTokensEdit implements ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensEdit && other.runtimeType == SemanticTokensEdit) { - return start == other.start && + return listEqual(data, other.data, (int a, int b) => a == b) && deleteCount == other.deleteCount && - listEqual(data, other.data, (int a, int b) => a == b) && + start == other.start && true; } return false; @@ -33423,9 +33423,9 @@ class SemanticTokensEdit implements ToJsonable { @override int get hashCode => Object.hash( - start, - deleteCount, lspHashCode(data), + deleteCount, + start, ); @override @@ -33439,21 +33439,21 @@ class SemanticTokensLegend implements ToJsonable { ); SemanticTokensLegend({ - required this.tokenTypes, required this.tokenModifiers, + required this.tokenTypes, }); static SemanticTokensLegend fromJson(Map json) { - final tokenTypesJson = json['tokenTypes']; - final tokenTypes = (tokenTypesJson as List) - .map((item) => item as String) - .toList(); final tokenModifiersJson = json['tokenModifiers']; final tokenModifiers = (tokenModifiersJson as List) .map((item) => item as String) .toList(); + final tokenTypesJson = json['tokenTypes']; + final tokenTypes = (tokenTypesJson as List) + .map((item) => item as String) + .toList(); return SemanticTokensLegend( - tokenTypes: tokenTypes, tokenModifiers: tokenModifiers, + tokenTypes: tokenTypes, ); } @@ -33465,32 +33465,13 @@ class SemanticTokensLegend implements ToJsonable { Map toJson() { var __result = {}; - __result['tokenTypes'] = tokenTypes; __result['tokenModifiers'] = tokenModifiers; + __result['tokenTypes'] = tokenTypes; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('tokenTypes'); - try { - if (!obj.containsKey('tokenTypes')) { - reporter.reportError('must not be undefined'); - return false; - } - final tokenTypes = obj['tokenTypes']; - if (tokenTypes == null) { - reporter.reportError('must not be null'); - return false; - } - if (!((tokenTypes is List && - (tokenTypes.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('tokenModifiers'); try { if (!obj.containsKey('tokenModifiers')) { @@ -33510,6 +33491,25 @@ class SemanticTokensLegend implements ToJsonable { } finally { reporter.pop(); } + reporter.push('tokenTypes'); + try { + if (!obj.containsKey('tokenTypes')) { + reporter.reportError('must not be undefined'); + return false; + } + final tokenTypes = obj['tokenTypes']; + if (tokenTypes == null) { + reporter.reportError('must not be null'); + return false; + } + if (!((tokenTypes is List && + (tokenTypes.every((item) => item is String))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SemanticTokensLegend'); @@ -33521,10 +33521,10 @@ class SemanticTokensLegend implements ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensLegend && other.runtimeType == SemanticTokensLegend) { - return listEqual( - tokenTypes, other.tokenTypes, (String a, String b) => a == b) && - listEqual(tokenModifiers, other.tokenModifiers, + return listEqual(tokenModifiers, other.tokenModifiers, (String a, String b) => a == b) && + listEqual( + tokenTypes, other.tokenTypes, (String a, String b) => a == b) && true; } return false; @@ -33532,8 +33532,8 @@ class SemanticTokensLegend implements ToJsonable { @override int get hashCode => Object.hash( - lspHashCode(tokenTypes), lspHashCode(tokenModifiers), + lspHashCode(tokenTypes), ); @override @@ -33547,15 +33547,25 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { ); SemanticTokensOptions({ + this.full, required this.legend, this.range, - this.full, this.workDoneProgress, }); static SemanticTokensOptions fromJson(Map json) { if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) { return SemanticTokensRegistrationOptions.fromJson(json); } + final fullJson = json['full']; + final full = fullJson == null + ? null + : (fullJson is bool + ? Either2.t1(fullJson) + : (SemanticTokensOptionsFull.canParse(fullJson, nullLspJsonReporter) + ? Either2.t2( + SemanticTokensOptionsFull.fromJson( + fullJson as Map)) + : (throw '''$fullJson was not one of (bool, SemanticTokensOptionsFull)'''))); final legendJson = json['legend']; final legend = SemanticTokensLegend.fromJson(legendJson as Map); @@ -33570,22 +33580,12 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { SemanticTokensOptionsRange.fromJson( rangeJson as Map)) : (throw '''$rangeJson was not one of (bool, SemanticTokensOptionsRange)'''))); - final fullJson = json['full']; - final full = fullJson == null - ? null - : (fullJson is bool - ? Either2.t1(fullJson) - : (SemanticTokensOptionsFull.canParse(fullJson, nullLspJsonReporter) - ? Either2.t2( - SemanticTokensOptionsFull.fromJson( - fullJson as Map)) - : (throw '''$fullJson was not one of (bool, SemanticTokensOptionsFull)'''))); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return SemanticTokensOptions( + full: full, legend: legend, range: range, - full: full, workDoneProgress: workDoneProgress, ); } @@ -33603,13 +33603,13 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { Map toJson() { var __result = {}; + if (full != null) { + __result['full'] = full; + } __result['legend'] = legend.toJson(); if (range != null) { __result['range'] = range; } - if (full != null) { - __result['full'] = full; - } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } @@ -33618,6 +33618,19 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('full'); + try { + final full = obj['full']; + if (full != null && + !((full is bool || + SemanticTokensOptionsFull.canParse(full, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('legend'); try { if (!obj.containsKey('legend')) { @@ -33649,19 +33662,6 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } - reporter.push('full'); - try { - final full = obj['full']; - if (full != null && - !((full is bool || - SemanticTokensOptionsFull.canParse(full, reporter)))) { - reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('workDoneProgress'); try { final workDoneProgress = obj['workDoneProgress']; @@ -33683,9 +33683,9 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { bool operator ==(Object other) { if (other is SemanticTokensOptions && other.runtimeType == SemanticTokensOptions) { - return legend == other.legend && + return full == other.full && + legend == other.legend && range == other.range && - full == other.full && workDoneProgress == other.workDoneProgress && true; } @@ -33694,9 +33694,9 @@ class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { @override int get hashCode => Object.hash( + full, legend, range, - full, workDoneProgress, ); @@ -33815,11 +33815,19 @@ class SemanticTokensParams ); SemanticTokensParams({ + this.partialResultToken, required this.textDocument, this.workDoneToken, - this.partialResultToken, }); static SemanticTokensParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); @@ -33831,18 +33839,10 @@ class SemanticTokensParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return SemanticTokensParams( + partialResultToken: partialResultToken, textDocument: textDocument, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -33858,18 +33858,29 @@ class SemanticTokensParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('textDocument'); try { if (!obj.containsKey('textDocument')) { @@ -33899,17 +33910,6 @@ class SemanticTokensParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SemanticTokensParams'); @@ -33921,9 +33921,9 @@ class SemanticTokensParams bool operator ==(Object other) { if (other is SemanticTokensParams && other.runtimeType == SemanticTokensParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -33931,9 +33931,9 @@ class SemanticTokensParams @override int get hashCode => Object.hash( + partialResultToken, textDocument, workDoneToken, - partialResultToken, ); @override @@ -34017,25 +34017,12 @@ class SemanticTokensRangeParams ); SemanticTokensRangeParams({ - required this.textDocument, - required this.range, - this.workDoneToken, this.partialResultToken, + required this.range, + required this.textDocument, + this.workDoneToken, }); static SemanticTokensRangeParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -34044,11 +34031,24 @@ class SemanticTokensRangeParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return SemanticTokensRangeParams( - textDocument: textDocument, - range: range, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + range: range, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -34067,32 +34067,25 @@ class SemanticTokensRangeParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['range'] = range.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['range'] = range.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -34116,22 +34109,29 @@ class SemanticTokensRangeParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -34149,10 +34149,10 @@ class SemanticTokensRangeParams bool operator ==(Object other) { if (other is SemanticTokensRangeParams && other.runtimeType == SemanticTokensRangeParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && range == other.range && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -34160,10 +34160,10 @@ class SemanticTokensRangeParams @override int get hashCode => Object.hash( - textDocument, - range, - workDoneToken, partialResultToken, + range, + textDocument, + workDoneToken, ); @override @@ -34183,17 +34183,29 @@ class SemanticTokensRegistrationOptions SemanticTokensRegistrationOptions({ this.documentSelector, + this.full, + this.id, required this.legend, this.range, - this.full, this.workDoneProgress, - this.id, }); static SemanticTokensRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); + final fullJson = json['full']; + final full = fullJson == null + ? null + : (fullJson is bool + ? Either2.t1(fullJson) + : (SemanticTokensOptionsFull.canParse(fullJson, nullLspJsonReporter) + ? Either2.t2( + SemanticTokensOptionsFull.fromJson( + fullJson as Map)) + : (throw '''$fullJson was not one of (bool, SemanticTokensOptionsFull)'''))); + final idJson = json['id']; + final id = idJson as String?; final legendJson = json['legend']; final legend = SemanticTokensLegend.fromJson(legendJson as Map); @@ -34208,27 +34220,15 @@ class SemanticTokensRegistrationOptions SemanticTokensOptionsRange.fromJson( rangeJson as Map)) : (throw '''$rangeJson was not one of (bool, SemanticTokensOptionsRange)'''))); - final fullJson = json['full']; - final full = fullJson == null - ? null - : (fullJson is bool - ? Either2.t1(fullJson) - : (SemanticTokensOptionsFull.canParse(fullJson, nullLspJsonReporter) - ? Either2.t2( - SemanticTokensOptionsFull.fromJson( - fullJson as Map)) - : (throw '''$fullJson was not one of (bool, SemanticTokensOptionsFull)'''))); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; - final idJson = json['id']; - final id = idJson as String?; return SemanticTokensRegistrationOptions( documentSelector: documentSelector, + full: full, + id: id, legend: legend, range: range, - full: full, workDoneProgress: workDoneProgress, - id: id, ); } @@ -34254,19 +34254,19 @@ class SemanticTokensRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; + if (full != null) { + __result['full'] = full; + } + if (id != null) { + __result['id'] = id; + } __result['legend'] = legend.toJson(); if (range != null) { __result['range'] = range; } - if (full != null) { - __result['full'] = full; - } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } - if (id != null) { - __result['id'] = id; - } return __result; } @@ -34289,6 +34289,29 @@ class SemanticTokensRegistrationOptions } finally { reporter.pop(); } + reporter.push('full'); + try { + final full = obj['full']; + if (full != null && + !((full is bool || + SemanticTokensOptionsFull.canParse(full, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('id'); + try { + final id = obj['id']; + if (id != null && !(id is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('legend'); try { if (!obj.containsKey('legend')) { @@ -34320,19 +34343,6 @@ class SemanticTokensRegistrationOptions } finally { reporter.pop(); } - reporter.push('full'); - try { - final full = obj['full']; - if (full != null && - !((full is bool || - SemanticTokensOptionsFull.canParse(full, reporter)))) { - reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('workDoneProgress'); try { final workDoneProgress = obj['workDoneProgress']; @@ -34343,16 +34353,6 @@ class SemanticTokensRegistrationOptions } finally { reporter.pop(); } - reporter.push('id'); - try { - final id = obj['id']; - if (id != null && !(id is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SemanticTokensRegistrationOptions'); @@ -34366,11 +34366,11 @@ class SemanticTokensRegistrationOptions other.runtimeType == SemanticTokensRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && + full == other.full && + id == other.id && legend == other.legend && range == other.range && - full == other.full && workDoneProgress == other.workDoneProgress && - id == other.id && true; } return false; @@ -34379,11 +34379,11 @@ class SemanticTokensRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), + full, + id, legend, range, - full, workDoneProgress, - id, ); @override @@ -34468,93 +34468,96 @@ class ServerCapabilities implements ToJsonable { ); ServerCapabilities({ - this.positionEncoding, - this.textDocumentSync, - this.notebookDocumentSync, - this.completionProvider, - this.hoverProvider, - this.signatureHelpProvider, - this.declarationProvider, - this.definitionProvider, - this.typeDefinitionProvider, - this.implementationProvider, - this.referencesProvider, - this.documentHighlightProvider, - this.documentSymbolProvider, + this.callHierarchyProvider, this.codeActionProvider, this.codeLensProvider, - this.documentLinkProvider, this.colorProvider, - this.documentFormattingProvider, - this.documentRangeFormattingProvider, - this.documentOnTypeFormattingProvider, - this.renameProvider, - this.foldingRangeProvider, - this.executeCommandProvider, - this.selectionRangeProvider, - this.linkedEditingRangeProvider, - this.callHierarchyProvider, - this.semanticTokensProvider, - this.monikerProvider, - this.typeHierarchyProvider, - this.inlineValueProvider, - this.inlayHintProvider, + this.completionProvider, + this.declarationProvider, + this.definitionProvider, this.diagnosticProvider, - this.workspaceSymbolProvider, - this.workspace, + this.documentFormattingProvider, + this.documentHighlightProvider, + this.documentLinkProvider, + this.documentOnTypeFormattingProvider, + this.documentRangeFormattingProvider, + this.documentSymbolProvider, + this.executeCommandProvider, this.experimental, + this.foldingRangeProvider, + this.hoverProvider, + this.implementationProvider, + this.inlayHintProvider, + this.inlineValueProvider, + this.linkedEditingRangeProvider, + this.monikerProvider, + this.notebookDocumentSync, + this.positionEncoding, + this.referencesProvider, + this.renameProvider, + this.selectionRangeProvider, + this.semanticTokensProvider, + this.signatureHelpProvider, + this.textDocumentSync, + this.typeDefinitionProvider, + this.typeHierarchyProvider, + this.workspace, + this.workspaceSymbolProvider, }); static ServerCapabilities fromJson(Map json) { - final positionEncodingJson = json['positionEncoding']; - final positionEncoding = positionEncodingJson != null - ? PositionEncodingKind.fromJson(positionEncodingJson as String) + final callHierarchyProviderJson = json['callHierarchyProvider']; + final callHierarchyProvider = callHierarchyProviderJson == null + ? null + : (callHierarchyProviderJson is bool + ? Either3.t1( + callHierarchyProviderJson) + : (CallHierarchyOptions.canParse( + callHierarchyProviderJson, nullLspJsonReporter) + ? Either3.t2( + CallHierarchyOptions.fromJson( + callHierarchyProviderJson as Map)) + : (CallHierarchyRegistrationOptions.canParse( + callHierarchyProviderJson, nullLspJsonReporter) + ? Either3.t3( + CallHierarchyRegistrationOptions.fromJson( + callHierarchyProviderJson as Map)) + : (throw '''$callHierarchyProviderJson was not one of (bool, CallHierarchyOptions, CallHierarchyRegistrationOptions)''')))); + final codeActionProviderJson = json['codeActionProvider']; + final codeActionProvider = codeActionProviderJson == null + ? null + : (codeActionProviderJson is bool + ? Either2.t1(codeActionProviderJson) + : (CodeActionOptions.canParse( + codeActionProviderJson, nullLspJsonReporter) + ? Either2.t2( + CodeActionOptions.fromJson( + codeActionProviderJson as Map)) + : (throw '''$codeActionProviderJson was not one of (bool, CodeActionOptions)'''))); + final codeLensProviderJson = json['codeLensProvider']; + final codeLensProvider = codeLensProviderJson != null + ? CodeLensOptions.fromJson(codeLensProviderJson as Map) : null; - final textDocumentSyncJson = json['textDocumentSync']; - final textDocumentSync = textDocumentSyncJson == null + final colorProviderJson = json['colorProvider']; + final colorProvider = colorProviderJson == null ? null - : (TextDocumentSyncKind.canParse( - textDocumentSyncJson, nullLspJsonReporter) - ? Either2.t1( - TextDocumentSyncKind.fromJson(textDocumentSyncJson as int)) - : (TextDocumentSyncOptions.canParse( - textDocumentSyncJson, nullLspJsonReporter) - ? Either2.t2( - TextDocumentSyncOptions.fromJson( - textDocumentSyncJson as Map)) - : (throw '''$textDocumentSyncJson was not one of (TextDocumentSyncKind, TextDocumentSyncOptions)'''))); - final notebookDocumentSyncJson = json['notebookDocumentSync']; - final notebookDocumentSync = notebookDocumentSyncJson == null - ? null - : (NotebookDocumentSyncOptions.canParse(notebookDocumentSyncJson, nullLspJsonReporter) - ? Either2.t1( - NotebookDocumentSyncOptions.fromJson( - notebookDocumentSyncJson as Map)) - : (NotebookDocumentSyncRegistrationOptions.canParse( - notebookDocumentSyncJson, nullLspJsonReporter) - ? Either2.t2( - NotebookDocumentSyncRegistrationOptions.fromJson( - notebookDocumentSyncJson as Map)) - : (throw '''$notebookDocumentSyncJson was not one of (NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions)'''))); + : (colorProviderJson is bool + ? Either3.t1(colorProviderJson) + : (DocumentColorOptions.canParse(colorProviderJson, nullLspJsonReporter) + ? Either3.t2( + DocumentColorOptions.fromJson( + colorProviderJson as Map)) + : (DocumentColorRegistrationOptions.canParse( + colorProviderJson, nullLspJsonReporter) + ? Either3.t3( + DocumentColorRegistrationOptions.fromJson( + colorProviderJson as Map)) + : (throw '''$colorProviderJson was not one of (bool, DocumentColorOptions, DocumentColorRegistrationOptions)''')))); final completionProviderJson = json['completionProvider']; final completionProvider = completionProviderJson != null ? CompletionOptions.fromJson( completionProviderJson as Map) : null; - final hoverProviderJson = json['hoverProvider']; - final hoverProvider = hoverProviderJson == null - ? null - : (hoverProviderJson is bool - ? Either2.t1(hoverProviderJson) - : (HoverOptions.canParse(hoverProviderJson, nullLspJsonReporter) - ? Either2.t2(HoverOptions.fromJson( - hoverProviderJson as Map)) - : (throw '''$hoverProviderJson was not one of (bool, HoverOptions)'''))); - final signatureHelpProviderJson = json['signatureHelpProvider']; - final signatureHelpProvider = signatureHelpProviderJson != null - ? SignatureHelpOptions.fromJson( - signatureHelpProviderJson as Map) - : null; final declarationProviderJson = json['declarationProvider']; final declarationProvider = declarationProviderJson == null ? null @@ -34583,110 +34586,20 @@ class ServerCapabilities implements ToJsonable { DefinitionOptions.fromJson( definitionProviderJson as Map)) : (throw '''$definitionProviderJson was not one of (bool, DefinitionOptions)'''))); - final typeDefinitionProviderJson = json['typeDefinitionProvider']; - final typeDefinitionProvider = typeDefinitionProviderJson == null + final diagnosticProviderJson = json['diagnosticProvider']; + final diagnosticProvider = diagnosticProviderJson == null ? null - : (typeDefinitionProviderJson is bool - ? Either3.t1( - typeDefinitionProviderJson) - : (TypeDefinitionOptions.canParse( - typeDefinitionProviderJson, nullLspJsonReporter) - ? Either3.t2( - TypeDefinitionOptions.fromJson( - typeDefinitionProviderJson as Map)) - : (TypeDefinitionRegistrationOptions.canParse( - typeDefinitionProviderJson, nullLspJsonReporter) - ? Either3.t3( - TypeDefinitionRegistrationOptions.fromJson( - typeDefinitionProviderJson as Map)) - : (throw '''$typeDefinitionProviderJson was not one of (bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions)''')))); - final implementationProviderJson = json['implementationProvider']; - final implementationProvider = implementationProviderJson == null - ? null - : (implementationProviderJson is bool - ? Either3.t1( - implementationProviderJson) - : (ImplementationOptions.canParse( - implementationProviderJson, nullLspJsonReporter) - ? Either3.t2( - ImplementationOptions.fromJson( - implementationProviderJson as Map)) - : (ImplementationRegistrationOptions.canParse( - implementationProviderJson, nullLspJsonReporter) - ? Either3.t3( - ImplementationRegistrationOptions.fromJson( - implementationProviderJson as Map)) - : (throw '''$implementationProviderJson was not one of (bool, ImplementationOptions, ImplementationRegistrationOptions)''')))); - final referencesProviderJson = json['referencesProvider']; - final referencesProvider = referencesProviderJson == null - ? null - : (referencesProviderJson is bool - ? Either2.t1(referencesProviderJson) - : (ReferenceOptions.canParse( - referencesProviderJson, nullLspJsonReporter) - ? Either2.t2(ReferenceOptions.fromJson( - referencesProviderJson as Map)) - : (throw '''$referencesProviderJson was not one of (bool, ReferenceOptions)'''))); - final documentHighlightProviderJson = json['documentHighlightProvider']; - final documentHighlightProvider = documentHighlightProviderJson == null - ? null - : (documentHighlightProviderJson is bool - ? Either2.t1( - documentHighlightProviderJson) - : (DocumentHighlightOptions.canParse( - documentHighlightProviderJson, nullLspJsonReporter) - ? Either2.t2( - DocumentHighlightOptions.fromJson( - documentHighlightProviderJson as Map)) - : (throw '''$documentHighlightProviderJson was not one of (bool, DocumentHighlightOptions)'''))); - final documentSymbolProviderJson = json['documentSymbolProvider']; - final documentSymbolProvider = documentSymbolProviderJson == null - ? null - : (documentSymbolProviderJson is bool - ? Either2.t1( - documentSymbolProviderJson) - : (DocumentSymbolOptions.canParse( - documentSymbolProviderJson, nullLspJsonReporter) - ? Either2.t2( - DocumentSymbolOptions.fromJson( - documentSymbolProviderJson as Map)) - : (throw '''$documentSymbolProviderJson was not one of (bool, DocumentSymbolOptions)'''))); - final codeActionProviderJson = json['codeActionProvider']; - final codeActionProvider = codeActionProviderJson == null - ? null - : (codeActionProviderJson is bool - ? Either2.t1(codeActionProviderJson) - : (CodeActionOptions.canParse( - codeActionProviderJson, nullLspJsonReporter) - ? Either2.t2( - CodeActionOptions.fromJson( - codeActionProviderJson as Map)) - : (throw '''$codeActionProviderJson was not one of (bool, CodeActionOptions)'''))); - final codeLensProviderJson = json['codeLensProvider']; - final codeLensProvider = codeLensProviderJson != null - ? CodeLensOptions.fromJson(codeLensProviderJson as Map) - : null; - final documentLinkProviderJson = json['documentLinkProvider']; - final documentLinkProvider = documentLinkProviderJson != null - ? DocumentLinkOptions.fromJson( - documentLinkProviderJson as Map) - : null; - final colorProviderJson = json['colorProvider']; - final colorProvider = colorProviderJson == null - ? null - : (colorProviderJson is bool - ? Either3.t1(colorProviderJson) - : (DocumentColorOptions.canParse(colorProviderJson, nullLspJsonReporter) - ? Either3.t2( - DocumentColorOptions.fromJson( - colorProviderJson as Map)) - : (DocumentColorRegistrationOptions.canParse( - colorProviderJson, nullLspJsonReporter) - ? Either3.t3( - DocumentColorRegistrationOptions.fromJson( - colorProviderJson as Map)) - : (throw '''$colorProviderJson was not one of (bool, DocumentColorOptions, DocumentColorRegistrationOptions)''')))); + : (DiagnosticOptions.canParse( + diagnosticProviderJson, nullLspJsonReporter) + ? Either2.t1( + DiagnosticOptions.fromJson( + diagnosticProviderJson as Map)) + : (DiagnosticRegistrationOptions.canParse( + diagnosticProviderJson, nullLspJsonReporter) + ? Either2.t2( + DiagnosticRegistrationOptions.fromJson( + diagnosticProviderJson as Map)) + : (throw '''$diagnosticProviderJson was not one of (DiagnosticOptions, DiagnosticRegistrationOptions)'''))); final documentFormattingProviderJson = json['documentFormattingProvider']; final documentFormattingProvider = documentFormattingProviderJson == null ? null @@ -34699,6 +34612,30 @@ class ServerCapabilities implements ToJsonable { DocumentFormattingOptions.fromJson( documentFormattingProviderJson as Map)) : (throw '''$documentFormattingProviderJson was not one of (bool, DocumentFormattingOptions)'''))); + final documentHighlightProviderJson = json['documentHighlightProvider']; + final documentHighlightProvider = documentHighlightProviderJson == null + ? null + : (documentHighlightProviderJson is bool + ? Either2.t1( + documentHighlightProviderJson) + : (DocumentHighlightOptions.canParse( + documentHighlightProviderJson, nullLspJsonReporter) + ? Either2.t2( + DocumentHighlightOptions.fromJson( + documentHighlightProviderJson as Map)) + : (throw '''$documentHighlightProviderJson was not one of (bool, DocumentHighlightOptions)'''))); + final documentLinkProviderJson = json['documentLinkProvider']; + final documentLinkProvider = documentLinkProviderJson != null + ? DocumentLinkOptions.fromJson( + documentLinkProviderJson as Map) + : null; + final documentOnTypeFormattingProviderJson = + json['documentOnTypeFormattingProvider']; + final documentOnTypeFormattingProvider = + documentOnTypeFormattingProviderJson != null + ? DocumentOnTypeFormattingOptions.fromJson( + documentOnTypeFormattingProviderJson as Map) + : null; final documentRangeFormattingProviderJson = json['documentRangeFormattingProvider']; final documentRangeFormattingProvider = documentRangeFormattingProviderJson == @@ -34714,22 +34651,25 @@ class ServerCapabilities implements ToJsonable { documentRangeFormattingProviderJson as Map)) : (throw '''$documentRangeFormattingProviderJson was not one of (bool, DocumentRangeFormattingOptions)'''))); - final documentOnTypeFormattingProviderJson = - json['documentOnTypeFormattingProvider']; - final documentOnTypeFormattingProvider = - documentOnTypeFormattingProviderJson != null - ? DocumentOnTypeFormattingOptions.fromJson( - documentOnTypeFormattingProviderJson as Map) - : null; - final renameProviderJson = json['renameProvider']; - final renameProvider = renameProviderJson == null + final documentSymbolProviderJson = json['documentSymbolProvider']; + final documentSymbolProvider = documentSymbolProviderJson == null ? null - : (renameProviderJson is bool - ? Either2.t1(renameProviderJson) - : (RenameOptions.canParse(renameProviderJson, nullLspJsonReporter) - ? Either2.t2(RenameOptions.fromJson( - renameProviderJson as Map)) - : (throw '''$renameProviderJson was not one of (bool, RenameOptions)'''))); + : (documentSymbolProviderJson is bool + ? Either2.t1( + documentSymbolProviderJson) + : (DocumentSymbolOptions.canParse( + documentSymbolProviderJson, nullLspJsonReporter) + ? Either2.t2( + DocumentSymbolOptions.fromJson( + documentSymbolProviderJson as Map)) + : (throw '''$documentSymbolProviderJson was not one of (bool, DocumentSymbolOptions)'''))); + final executeCommandProviderJson = json['executeCommandProvider']; + final executeCommandProvider = executeCommandProviderJson != null + ? ExecuteCommandOptions.fromJson( + executeCommandProviderJson as Map) + : null; + final experimentalJson = json['experimental']; + final experimental = experimentalJson; final foldingRangeProviderJson = json['foldingRangeProvider']; final foldingRangeProvider = foldingRangeProviderJson == null ? null @@ -34747,127 +34687,32 @@ class ServerCapabilities implements ToJsonable { FoldingRangeRegistrationOptions.fromJson( foldingRangeProviderJson as Map)) : (throw '''$foldingRangeProviderJson was not one of (bool, FoldingRangeOptions, FoldingRangeRegistrationOptions)''')))); - final executeCommandProviderJson = json['executeCommandProvider']; - final executeCommandProvider = executeCommandProviderJson != null - ? ExecuteCommandOptions.fromJson( - executeCommandProviderJson as Map) - : null; - final selectionRangeProviderJson = json['selectionRangeProvider']; - final selectionRangeProvider = selectionRangeProviderJson == null + final hoverProviderJson = json['hoverProvider']; + final hoverProvider = hoverProviderJson == null ? null - : (selectionRangeProviderJson is bool - ? Either3.t1( - selectionRangeProviderJson) - : (SelectionRangeOptions.canParse( - selectionRangeProviderJson, nullLspJsonReporter) - ? Either3.t2( - SelectionRangeOptions.fromJson( - selectionRangeProviderJson as Map)) - : (SelectionRangeRegistrationOptions.canParse( - selectionRangeProviderJson, nullLspJsonReporter) - ? Either3.t3( - SelectionRangeRegistrationOptions.fromJson( - selectionRangeProviderJson as Map)) - : (throw '''$selectionRangeProviderJson was not one of (bool, SelectionRangeOptions, SelectionRangeRegistrationOptions)''')))); - final linkedEditingRangeProviderJson = json['linkedEditingRangeProvider']; - final linkedEditingRangeProvider = linkedEditingRangeProviderJson == null + : (hoverProviderJson is bool + ? Either2.t1(hoverProviderJson) + : (HoverOptions.canParse(hoverProviderJson, nullLspJsonReporter) + ? Either2.t2(HoverOptions.fromJson( + hoverProviderJson as Map)) + : (throw '''$hoverProviderJson was not one of (bool, HoverOptions)'''))); + final implementationProviderJson = json['implementationProvider']; + final implementationProvider = implementationProviderJson == null ? null - : (linkedEditingRangeProviderJson is bool - ? Either3.t1( - linkedEditingRangeProviderJson) - : (LinkedEditingRangeOptions.canParse( - linkedEditingRangeProviderJson, nullLspJsonReporter) - ? Either3.t2( - LinkedEditingRangeOptions.fromJson( - linkedEditingRangeProviderJson as Map)) - : (LinkedEditingRangeRegistrationOptions.canParse( - linkedEditingRangeProviderJson, nullLspJsonReporter) - ? Either3.t3( - LinkedEditingRangeRegistrationOptions.fromJson( - linkedEditingRangeProviderJson as Map)) - : (throw '''$linkedEditingRangeProviderJson was not one of (bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions)''')))); - final callHierarchyProviderJson = json['callHierarchyProvider']; - final callHierarchyProvider = callHierarchyProviderJson == null - ? null - : (callHierarchyProviderJson is bool - ? Either3.t1( - callHierarchyProviderJson) - : (CallHierarchyOptions.canParse( - callHierarchyProviderJson, nullLspJsonReporter) - ? Either3.t2( - CallHierarchyOptions.fromJson( - callHierarchyProviderJson as Map)) - : (CallHierarchyRegistrationOptions.canParse( - callHierarchyProviderJson, nullLspJsonReporter) - ? Either3.t3( - CallHierarchyRegistrationOptions.fromJson( - callHierarchyProviderJson as Map)) - : (throw '''$callHierarchyProviderJson was not one of (bool, CallHierarchyOptions, CallHierarchyRegistrationOptions)''')))); - final semanticTokensProviderJson = json['semanticTokensProvider']; - final semanticTokensProvider = semanticTokensProviderJson == null - ? null - : (SemanticTokensOptions.canParse( - semanticTokensProviderJson, nullLspJsonReporter) - ? Either2.t1( - SemanticTokensOptions.fromJson( - semanticTokensProviderJson as Map)) - : (SemanticTokensRegistrationOptions.canParse( - semanticTokensProviderJson, nullLspJsonReporter) - ? Either2.t2( - SemanticTokensRegistrationOptions.fromJson( - semanticTokensProviderJson as Map)) - : (throw '''$semanticTokensProviderJson was not one of (SemanticTokensOptions, SemanticTokensRegistrationOptions)'''))); - final monikerProviderJson = json['monikerProvider']; - final monikerProvider = monikerProviderJson == null - ? null - : (monikerProviderJson is bool - ? Either3.t1( - monikerProviderJson) - : (MonikerOptions.canParse(monikerProviderJson, nullLspJsonReporter) - ? Either3.t2( - MonikerOptions.fromJson( - monikerProviderJson as Map)) - : (MonikerRegistrationOptions.canParse( - monikerProviderJson, nullLspJsonReporter) - ? Either3.t3( - MonikerRegistrationOptions.fromJson( - monikerProviderJson as Map)) - : (throw '''$monikerProviderJson was not one of (bool, MonikerOptions, MonikerRegistrationOptions)''')))); - final typeHierarchyProviderJson = json['typeHierarchyProvider']; - final typeHierarchyProvider = typeHierarchyProviderJson == null - ? null - : (typeHierarchyProviderJson is bool - ? Either3.t1( - typeHierarchyProviderJson) - : (TypeHierarchyOptions.canParse( - typeHierarchyProviderJson, nullLspJsonReporter) - ? Either3.t2( - TypeHierarchyOptions.fromJson( - typeHierarchyProviderJson as Map)) - : (TypeHierarchyRegistrationOptions.canParse( - typeHierarchyProviderJson, nullLspJsonReporter) - ? Either3.t3( - TypeHierarchyRegistrationOptions.fromJson( - typeHierarchyProviderJson as Map)) - : (throw '''$typeHierarchyProviderJson was not one of (bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions)''')))); - final inlineValueProviderJson = json['inlineValueProvider']; - final inlineValueProvider = inlineValueProviderJson == null - ? null - : (inlineValueProviderJson is bool - ? Either3.t1( - inlineValueProviderJson) - : (InlineValueOptions.canParse( - inlineValueProviderJson, nullLspJsonReporter) - ? Either3.t2( - InlineValueOptions.fromJson( - inlineValueProviderJson as Map)) - : (InlineValueRegistrationOptions.canParse( - inlineValueProviderJson, nullLspJsonReporter) - ? Either3.t3( - InlineValueRegistrationOptions.fromJson( - inlineValueProviderJson as Map)) - : (throw '''$inlineValueProviderJson was not one of (bool, InlineValueOptions, InlineValueRegistrationOptions)''')))); + : (implementationProviderJson is bool + ? Either3.t1( + implementationProviderJson) + : (ImplementationOptions.canParse( + implementationProviderJson, nullLspJsonReporter) + ? Either3.t2( + ImplementationOptions.fromJson( + implementationProviderJson as Map)) + : (ImplementationRegistrationOptions.canParse( + implementationProviderJson, nullLspJsonReporter) + ? Either3.t3( + ImplementationRegistrationOptions.fromJson( + implementationProviderJson as Map)) + : (throw '''$implementationProviderJson was not one of (bool, ImplementationOptions, ImplementationRegistrationOptions)''')))); final inlayHintProviderJson = json['inlayHintProvider']; final inlayHintProvider = inlayHintProviderJson == null ? null @@ -34885,20 +34730,182 @@ class ServerCapabilities implements ToJsonable { InlayHintRegistrationOptions.fromJson( inlayHintProviderJson as Map)) : (throw '''$inlayHintProviderJson was not one of (bool, InlayHintOptions, InlayHintRegistrationOptions)''')))); - final diagnosticProviderJson = json['diagnosticProvider']; - final diagnosticProvider = diagnosticProviderJson == null + final inlineValueProviderJson = json['inlineValueProvider']; + final inlineValueProvider = inlineValueProviderJson == null ? null - : (DiagnosticOptions.canParse( - diagnosticProviderJson, nullLspJsonReporter) - ? Either2.t1( - DiagnosticOptions.fromJson( - diagnosticProviderJson as Map)) - : (DiagnosticRegistrationOptions.canParse( - diagnosticProviderJson, nullLspJsonReporter) - ? Either2.t2( - DiagnosticRegistrationOptions.fromJson( - diagnosticProviderJson as Map)) - : (throw '''$diagnosticProviderJson was not one of (DiagnosticOptions, DiagnosticRegistrationOptions)'''))); + : (inlineValueProviderJson is bool + ? Either3.t1( + inlineValueProviderJson) + : (InlineValueOptions.canParse( + inlineValueProviderJson, nullLspJsonReporter) + ? Either3.t2( + InlineValueOptions.fromJson( + inlineValueProviderJson as Map)) + : (InlineValueRegistrationOptions.canParse( + inlineValueProviderJson, nullLspJsonReporter) + ? Either3.t3( + InlineValueRegistrationOptions.fromJson( + inlineValueProviderJson as Map)) + : (throw '''$inlineValueProviderJson was not one of (bool, InlineValueOptions, InlineValueRegistrationOptions)''')))); + final linkedEditingRangeProviderJson = json['linkedEditingRangeProvider']; + final linkedEditingRangeProvider = linkedEditingRangeProviderJson == null + ? null + : (linkedEditingRangeProviderJson is bool + ? Either3.t1( + linkedEditingRangeProviderJson) + : (LinkedEditingRangeOptions.canParse( + linkedEditingRangeProviderJson, nullLspJsonReporter) + ? Either3.t2( + LinkedEditingRangeOptions.fromJson( + linkedEditingRangeProviderJson as Map)) + : (LinkedEditingRangeRegistrationOptions.canParse( + linkedEditingRangeProviderJson, nullLspJsonReporter) + ? Either3.t3( + LinkedEditingRangeRegistrationOptions.fromJson( + linkedEditingRangeProviderJson as Map)) + : (throw '''$linkedEditingRangeProviderJson was not one of (bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions)''')))); + final monikerProviderJson = json['monikerProvider']; + final monikerProvider = monikerProviderJson == null + ? null + : (monikerProviderJson is bool + ? Either3.t1( + monikerProviderJson) + : (MonikerOptions.canParse(monikerProviderJson, nullLspJsonReporter) + ? Either3.t2( + MonikerOptions.fromJson( + monikerProviderJson as Map)) + : (MonikerRegistrationOptions.canParse( + monikerProviderJson, nullLspJsonReporter) + ? Either3.t3( + MonikerRegistrationOptions.fromJson( + monikerProviderJson as Map)) + : (throw '''$monikerProviderJson was not one of (bool, MonikerOptions, MonikerRegistrationOptions)''')))); + final notebookDocumentSyncJson = json['notebookDocumentSync']; + final notebookDocumentSync = notebookDocumentSyncJson == null + ? null + : (NotebookDocumentSyncOptions.canParse(notebookDocumentSyncJson, nullLspJsonReporter) + ? Either2.t1( + NotebookDocumentSyncOptions.fromJson( + notebookDocumentSyncJson as Map)) + : (NotebookDocumentSyncRegistrationOptions.canParse( + notebookDocumentSyncJson, nullLspJsonReporter) + ? Either2.t2( + NotebookDocumentSyncRegistrationOptions.fromJson( + notebookDocumentSyncJson as Map)) + : (throw '''$notebookDocumentSyncJson was not one of (NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions)'''))); + final positionEncodingJson = json['positionEncoding']; + final positionEncoding = positionEncodingJson != null + ? PositionEncodingKind.fromJson(positionEncodingJson as String) + : null; + final referencesProviderJson = json['referencesProvider']; + final referencesProvider = referencesProviderJson == null + ? null + : (referencesProviderJson is bool + ? Either2.t1(referencesProviderJson) + : (ReferenceOptions.canParse( + referencesProviderJson, nullLspJsonReporter) + ? Either2.t2(ReferenceOptions.fromJson( + referencesProviderJson as Map)) + : (throw '''$referencesProviderJson was not one of (bool, ReferenceOptions)'''))); + final renameProviderJson = json['renameProvider']; + final renameProvider = renameProviderJson == null + ? null + : (renameProviderJson is bool + ? Either2.t1(renameProviderJson) + : (RenameOptions.canParse(renameProviderJson, nullLspJsonReporter) + ? Either2.t2(RenameOptions.fromJson( + renameProviderJson as Map)) + : (throw '''$renameProviderJson was not one of (bool, RenameOptions)'''))); + final selectionRangeProviderJson = json['selectionRangeProvider']; + final selectionRangeProvider = selectionRangeProviderJson == null + ? null + : (selectionRangeProviderJson is bool + ? Either3.t1( + selectionRangeProviderJson) + : (SelectionRangeOptions.canParse( + selectionRangeProviderJson, nullLspJsonReporter) + ? Either3.t2( + SelectionRangeOptions.fromJson( + selectionRangeProviderJson as Map)) + : (SelectionRangeRegistrationOptions.canParse( + selectionRangeProviderJson, nullLspJsonReporter) + ? Either3.t3( + SelectionRangeRegistrationOptions.fromJson( + selectionRangeProviderJson as Map)) + : (throw '''$selectionRangeProviderJson was not one of (bool, SelectionRangeOptions, SelectionRangeRegistrationOptions)''')))); + final semanticTokensProviderJson = json['semanticTokensProvider']; + final semanticTokensProvider = semanticTokensProviderJson == null + ? null + : (SemanticTokensOptions.canParse( + semanticTokensProviderJson, nullLspJsonReporter) + ? Either2.t1( + SemanticTokensOptions.fromJson( + semanticTokensProviderJson as Map)) + : (SemanticTokensRegistrationOptions.canParse( + semanticTokensProviderJson, nullLspJsonReporter) + ? Either2.t2( + SemanticTokensRegistrationOptions.fromJson( + semanticTokensProviderJson as Map)) + : (throw '''$semanticTokensProviderJson was not one of (SemanticTokensOptions, SemanticTokensRegistrationOptions)'''))); + final signatureHelpProviderJson = json['signatureHelpProvider']; + final signatureHelpProvider = signatureHelpProviderJson != null + ? SignatureHelpOptions.fromJson( + signatureHelpProviderJson as Map) + : null; + final textDocumentSyncJson = json['textDocumentSync']; + final textDocumentSync = textDocumentSyncJson == null + ? null + : (TextDocumentSyncKind.canParse( + textDocumentSyncJson, nullLspJsonReporter) + ? Either2.t1( + TextDocumentSyncKind.fromJson(textDocumentSyncJson as int)) + : (TextDocumentSyncOptions.canParse( + textDocumentSyncJson, nullLspJsonReporter) + ? Either2.t2( + TextDocumentSyncOptions.fromJson( + textDocumentSyncJson as Map)) + : (throw '''$textDocumentSyncJson was not one of (TextDocumentSyncKind, TextDocumentSyncOptions)'''))); + final typeDefinitionProviderJson = json['typeDefinitionProvider']; + final typeDefinitionProvider = typeDefinitionProviderJson == null + ? null + : (typeDefinitionProviderJson is bool + ? Either3.t1( + typeDefinitionProviderJson) + : (TypeDefinitionOptions.canParse( + typeDefinitionProviderJson, nullLspJsonReporter) + ? Either3.t2( + TypeDefinitionOptions.fromJson( + typeDefinitionProviderJson as Map)) + : (TypeDefinitionRegistrationOptions.canParse( + typeDefinitionProviderJson, nullLspJsonReporter) + ? Either3.t3( + TypeDefinitionRegistrationOptions.fromJson( + typeDefinitionProviderJson as Map)) + : (throw '''$typeDefinitionProviderJson was not one of (bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions)''')))); + final typeHierarchyProviderJson = json['typeHierarchyProvider']; + final typeHierarchyProvider = typeHierarchyProviderJson == null + ? null + : (typeHierarchyProviderJson is bool + ? Either3.t1( + typeHierarchyProviderJson) + : (TypeHierarchyOptions.canParse( + typeHierarchyProviderJson, nullLspJsonReporter) + ? Either3.t2( + TypeHierarchyOptions.fromJson( + typeHierarchyProviderJson as Map)) + : (TypeHierarchyRegistrationOptions.canParse( + typeHierarchyProviderJson, nullLspJsonReporter) + ? Either3.t3( + TypeHierarchyRegistrationOptions.fromJson( + typeHierarchyProviderJson as Map)) + : (throw '''$typeHierarchyProviderJson was not one of (bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions)''')))); + final workspaceJson = json['workspace']; + final workspace = workspaceJson != null + ? ServerCapabilitiesWorkspace.fromJson( + workspaceJson as Map) + : null; final workspaceSymbolProviderJson = json['workspaceSymbolProvider']; final workspaceSymbolProvider = workspaceSymbolProviderJson == null ? null @@ -34911,49 +34918,42 @@ class ServerCapabilities implements ToJsonable { WorkspaceSymbolOptions.fromJson( workspaceSymbolProviderJson as Map)) : (throw '''$workspaceSymbolProviderJson was not one of (bool, WorkspaceSymbolOptions)'''))); - final workspaceJson = json['workspace']; - final workspace = workspaceJson != null - ? ServerCapabilitiesWorkspace.fromJson( - workspaceJson as Map) - : null; - final experimentalJson = json['experimental']; - final experimental = experimentalJson; return ServerCapabilities( - positionEncoding: positionEncoding, - textDocumentSync: textDocumentSync, - notebookDocumentSync: notebookDocumentSync, - completionProvider: completionProvider, - hoverProvider: hoverProvider, - signatureHelpProvider: signatureHelpProvider, - declarationProvider: declarationProvider, - definitionProvider: definitionProvider, - typeDefinitionProvider: typeDefinitionProvider, - implementationProvider: implementationProvider, - referencesProvider: referencesProvider, - documentHighlightProvider: documentHighlightProvider, - documentSymbolProvider: documentSymbolProvider, + callHierarchyProvider: callHierarchyProvider, codeActionProvider: codeActionProvider, codeLensProvider: codeLensProvider, - documentLinkProvider: documentLinkProvider, colorProvider: colorProvider, - documentFormattingProvider: documentFormattingProvider, - documentRangeFormattingProvider: documentRangeFormattingProvider, - documentOnTypeFormattingProvider: documentOnTypeFormattingProvider, - renameProvider: renameProvider, - foldingRangeProvider: foldingRangeProvider, - executeCommandProvider: executeCommandProvider, - selectionRangeProvider: selectionRangeProvider, - linkedEditingRangeProvider: linkedEditingRangeProvider, - callHierarchyProvider: callHierarchyProvider, - semanticTokensProvider: semanticTokensProvider, - monikerProvider: monikerProvider, - typeHierarchyProvider: typeHierarchyProvider, - inlineValueProvider: inlineValueProvider, - inlayHintProvider: inlayHintProvider, + completionProvider: completionProvider, + declarationProvider: declarationProvider, + definitionProvider: definitionProvider, diagnosticProvider: diagnosticProvider, - workspaceSymbolProvider: workspaceSymbolProvider, - workspace: workspace, + documentFormattingProvider: documentFormattingProvider, + documentHighlightProvider: documentHighlightProvider, + documentLinkProvider: documentLinkProvider, + documentOnTypeFormattingProvider: documentOnTypeFormattingProvider, + documentRangeFormattingProvider: documentRangeFormattingProvider, + documentSymbolProvider: documentSymbolProvider, + executeCommandProvider: executeCommandProvider, experimental: experimental, + foldingRangeProvider: foldingRangeProvider, + hoverProvider: hoverProvider, + implementationProvider: implementationProvider, + inlayHintProvider: inlayHintProvider, + inlineValueProvider: inlineValueProvider, + linkedEditingRangeProvider: linkedEditingRangeProvider, + monikerProvider: monikerProvider, + notebookDocumentSync: notebookDocumentSync, + positionEncoding: positionEncoding, + referencesProvider: referencesProvider, + renameProvider: renameProvider, + selectionRangeProvider: selectionRangeProvider, + semanticTokensProvider: semanticTokensProvider, + signatureHelpProvider: signatureHelpProvider, + textDocumentSync: textDocumentSync, + typeDefinitionProvider: typeDefinitionProvider, + typeHierarchyProvider: typeHierarchyProvider, + workspace: workspace, + workspaceSymbolProvider: workspaceSymbolProvider, ); } @@ -35110,44 +35110,8 @@ class ServerCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (positionEncoding != null) { - __result['positionEncoding'] = positionEncoding?.toJson(); - } - if (textDocumentSync != null) { - __result['textDocumentSync'] = textDocumentSync; - } - if (notebookDocumentSync != null) { - __result['notebookDocumentSync'] = notebookDocumentSync; - } - if (completionProvider != null) { - __result['completionProvider'] = completionProvider?.toJson(); - } - if (hoverProvider != null) { - __result['hoverProvider'] = hoverProvider; - } - if (signatureHelpProvider != null) { - __result['signatureHelpProvider'] = signatureHelpProvider?.toJson(); - } - if (declarationProvider != null) { - __result['declarationProvider'] = declarationProvider; - } - if (definitionProvider != null) { - __result['definitionProvider'] = definitionProvider; - } - if (typeDefinitionProvider != null) { - __result['typeDefinitionProvider'] = typeDefinitionProvider; - } - if (implementationProvider != null) { - __result['implementationProvider'] = implementationProvider; - } - if (referencesProvider != null) { - __result['referencesProvider'] = referencesProvider; - } - if (documentHighlightProvider != null) { - __result['documentHighlightProvider'] = documentHighlightProvider; - } - if (documentSymbolProvider != null) { - __result['documentSymbolProvider'] = documentSymbolProvider; + if (callHierarchyProvider != null) { + __result['callHierarchyProvider'] = callHierarchyProvider; } if (codeActionProvider != null) { __result['codeActionProvider'] = codeActionProvider; @@ -35155,108 +35119,159 @@ class ServerCapabilities implements ToJsonable { if (codeLensProvider != null) { __result['codeLensProvider'] = codeLensProvider?.toJson(); } - if (documentLinkProvider != null) { - __result['documentLinkProvider'] = documentLinkProvider?.toJson(); - } if (colorProvider != null) { __result['colorProvider'] = colorProvider; } + if (completionProvider != null) { + __result['completionProvider'] = completionProvider?.toJson(); + } + if (declarationProvider != null) { + __result['declarationProvider'] = declarationProvider; + } + if (definitionProvider != null) { + __result['definitionProvider'] = definitionProvider; + } + if (diagnosticProvider != null) { + __result['diagnosticProvider'] = diagnosticProvider; + } if (documentFormattingProvider != null) { __result['documentFormattingProvider'] = documentFormattingProvider; } - if (documentRangeFormattingProvider != null) { - __result['documentRangeFormattingProvider'] = - documentRangeFormattingProvider; + if (documentHighlightProvider != null) { + __result['documentHighlightProvider'] = documentHighlightProvider; + } + if (documentLinkProvider != null) { + __result['documentLinkProvider'] = documentLinkProvider?.toJson(); } if (documentOnTypeFormattingProvider != null) { __result['documentOnTypeFormattingProvider'] = documentOnTypeFormattingProvider?.toJson(); } - if (renameProvider != null) { - __result['renameProvider'] = renameProvider; + if (documentRangeFormattingProvider != null) { + __result['documentRangeFormattingProvider'] = + documentRangeFormattingProvider; } - if (foldingRangeProvider != null) { - __result['foldingRangeProvider'] = foldingRangeProvider; + if (documentSymbolProvider != null) { + __result['documentSymbolProvider'] = documentSymbolProvider; } if (executeCommandProvider != null) { __result['executeCommandProvider'] = executeCommandProvider?.toJson(); } - if (selectionRangeProvider != null) { - __result['selectionRangeProvider'] = selectionRangeProvider; + if (experimental != null) { + __result['experimental'] = experimental; } - if (linkedEditingRangeProvider != null) { - __result['linkedEditingRangeProvider'] = linkedEditingRangeProvider; + if (foldingRangeProvider != null) { + __result['foldingRangeProvider'] = foldingRangeProvider; } - if (callHierarchyProvider != null) { - __result['callHierarchyProvider'] = callHierarchyProvider; + if (hoverProvider != null) { + __result['hoverProvider'] = hoverProvider; } - if (semanticTokensProvider != null) { - __result['semanticTokensProvider'] = semanticTokensProvider; - } - if (monikerProvider != null) { - __result['monikerProvider'] = monikerProvider; - } - if (typeHierarchyProvider != null) { - __result['typeHierarchyProvider'] = typeHierarchyProvider; - } - if (inlineValueProvider != null) { - __result['inlineValueProvider'] = inlineValueProvider; + if (implementationProvider != null) { + __result['implementationProvider'] = implementationProvider; } if (inlayHintProvider != null) { __result['inlayHintProvider'] = inlayHintProvider; } - if (diagnosticProvider != null) { - __result['diagnosticProvider'] = diagnosticProvider; + if (inlineValueProvider != null) { + __result['inlineValueProvider'] = inlineValueProvider; } - if (workspaceSymbolProvider != null) { - __result['workspaceSymbolProvider'] = workspaceSymbolProvider; + if (linkedEditingRangeProvider != null) { + __result['linkedEditingRangeProvider'] = linkedEditingRangeProvider; + } + if (monikerProvider != null) { + __result['monikerProvider'] = monikerProvider; + } + if (notebookDocumentSync != null) { + __result['notebookDocumentSync'] = notebookDocumentSync; + } + if (positionEncoding != null) { + __result['positionEncoding'] = positionEncoding?.toJson(); + } + if (referencesProvider != null) { + __result['referencesProvider'] = referencesProvider; + } + if (renameProvider != null) { + __result['renameProvider'] = renameProvider; + } + if (selectionRangeProvider != null) { + __result['selectionRangeProvider'] = selectionRangeProvider; + } + if (semanticTokensProvider != null) { + __result['semanticTokensProvider'] = semanticTokensProvider; + } + if (signatureHelpProvider != null) { + __result['signatureHelpProvider'] = signatureHelpProvider?.toJson(); + } + if (textDocumentSync != null) { + __result['textDocumentSync'] = textDocumentSync; + } + if (typeDefinitionProvider != null) { + __result['typeDefinitionProvider'] = typeDefinitionProvider; + } + if (typeHierarchyProvider != null) { + __result['typeHierarchyProvider'] = typeHierarchyProvider; } if (workspace != null) { __result['workspace'] = workspace?.toJson(); } - if (experimental != null) { - __result['experimental'] = experimental; + if (workspaceSymbolProvider != null) { + __result['workspaceSymbolProvider'] = workspaceSymbolProvider; } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('positionEncoding'); + reporter.push('callHierarchyProvider'); try { - final positionEncoding = obj['positionEncoding']; - if (positionEncoding != null && - !(PositionEncodingKind.canParse(positionEncoding, reporter))) { - reporter.reportError('must be of type PositionEncodingKind'); + final callHierarchyProvider = obj['callHierarchyProvider']; + if (callHierarchyProvider != null && + !((callHierarchyProvider is bool || + CallHierarchyOptions.canParse( + callHierarchyProvider, reporter) || + CallHierarchyRegistrationOptions.canParse( + callHierarchyProvider, reporter)))) { + reporter.reportError( + 'must be of type Either3'); return false; } } finally { reporter.pop(); } - reporter.push('textDocumentSync'); + reporter.push('codeActionProvider'); try { - final textDocumentSync = obj['textDocumentSync']; - if (textDocumentSync != null && - !((TextDocumentSyncKind.canParse(textDocumentSync, reporter) || - TextDocumentSyncOptions.canParse( - textDocumentSync, reporter)))) { - reporter.reportError( - 'must be of type Either2'); + final codeActionProvider = obj['codeActionProvider']; + if (codeActionProvider != null && + !((codeActionProvider is bool || + CodeActionOptions.canParse(codeActionProvider, reporter)))) { + reporter + .reportError('must be of type Either2'); return false; } } finally { reporter.pop(); } - reporter.push('notebookDocumentSync'); + reporter.push('codeLensProvider'); try { - final notebookDocumentSync = obj['notebookDocumentSync']; - if (notebookDocumentSync != null && - !((NotebookDocumentSyncOptions.canParse( - notebookDocumentSync, reporter) || - NotebookDocumentSyncRegistrationOptions.canParse( - notebookDocumentSync, reporter)))) { + final codeLensProvider = obj['codeLensProvider']; + if (codeLensProvider != null && + !(CodeLensOptions.canParse(codeLensProvider, reporter))) { + reporter.reportError('must be of type CodeLensOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('colorProvider'); + try { + final colorProvider = obj['colorProvider']; + if (colorProvider != null && + !((colorProvider is bool || + DocumentColorOptions.canParse(colorProvider, reporter) || + DocumentColorRegistrationOptions.canParse( + colorProvider, reporter)))) { reporter.reportError( - 'must be of type Either2'); + 'must be of type Either3'); return false; } } finally { @@ -35273,29 +35288,6 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('hoverProvider'); - try { - final hoverProvider = obj['hoverProvider']; - if (hoverProvider != null && - !((hoverProvider is bool || - HoverOptions.canParse(hoverProvider, reporter)))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('signatureHelpProvider'); - try { - final signatureHelpProvider = obj['signatureHelpProvider']; - if (signatureHelpProvider != null && - !(SignatureHelpOptions.canParse(signatureHelpProvider, reporter))) { - reporter.reportError('must be of type SignatureHelpOptions'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('declarationProvider'); try { final declarationProvider = obj['declarationProvider']; @@ -35324,17 +35316,136 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('typeDefinitionProvider'); + reporter.push('diagnosticProvider'); try { - final typeDefinitionProvider = obj['typeDefinitionProvider']; - if (typeDefinitionProvider != null && - !((typeDefinitionProvider is bool || - TypeDefinitionOptions.canParse( - typeDefinitionProvider, reporter) || - TypeDefinitionRegistrationOptions.canParse( - typeDefinitionProvider, reporter)))) { + final diagnosticProvider = obj['diagnosticProvider']; + if (diagnosticProvider != null && + !((DiagnosticOptions.canParse(diagnosticProvider, reporter) || + DiagnosticRegistrationOptions.canParse( + diagnosticProvider, reporter)))) { reporter.reportError( - 'must be of type Either3'); + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentFormattingProvider'); + try { + final documentFormattingProvider = obj['documentFormattingProvider']; + if (documentFormattingProvider != null && + !((documentFormattingProvider is bool || + DocumentFormattingOptions.canParse( + documentFormattingProvider, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentHighlightProvider'); + try { + final documentHighlightProvider = obj['documentHighlightProvider']; + if (documentHighlightProvider != null && + !((documentHighlightProvider is bool || + DocumentHighlightOptions.canParse( + documentHighlightProvider, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentLinkProvider'); + try { + final documentLinkProvider = obj['documentLinkProvider']; + if (documentLinkProvider != null && + !(DocumentLinkOptions.canParse(documentLinkProvider, reporter))) { + reporter.reportError('must be of type DocumentLinkOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentOnTypeFormattingProvider'); + try { + final documentOnTypeFormattingProvider = + obj['documentOnTypeFormattingProvider']; + if (documentOnTypeFormattingProvider != null && + !(DocumentOnTypeFormattingOptions.canParse( + documentOnTypeFormattingProvider, reporter))) { + reporter + .reportError('must be of type DocumentOnTypeFormattingOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentRangeFormattingProvider'); + try { + final documentRangeFormattingProvider = + obj['documentRangeFormattingProvider']; + if (documentRangeFormattingProvider != null && + !((documentRangeFormattingProvider is bool || + DocumentRangeFormattingOptions.canParse( + documentRangeFormattingProvider, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentSymbolProvider'); + try { + final documentSymbolProvider = obj['documentSymbolProvider']; + if (documentSymbolProvider != null && + !((documentSymbolProvider is bool || + DocumentSymbolOptions.canParse( + documentSymbolProvider, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('executeCommandProvider'); + try { + final executeCommandProvider = obj['executeCommandProvider']; + if (executeCommandProvider != null && + !(ExecuteCommandOptions.canParse( + executeCommandProvider, reporter))) { + reporter.reportError('must be of type ExecuteCommandOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('foldingRangeProvider'); + try { + final foldingRangeProvider = obj['foldingRangeProvider']; + if (foldingRangeProvider != null && + !((foldingRangeProvider is bool || + FoldingRangeOptions.canParse(foldingRangeProvider, reporter) || + FoldingRangeRegistrationOptions.canParse( + foldingRangeProvider, reporter)))) { + reporter.reportError( + 'must be of type Either3'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('hoverProvider'); + try { + final hoverProvider = obj['hoverProvider']; + if (hoverProvider != null && + !((hoverProvider is bool || + HoverOptions.canParse(hoverProvider, reporter)))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -35356,190 +35467,31 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('referencesProvider'); + reporter.push('inlayHintProvider'); try { - final referencesProvider = obj['referencesProvider']; - if (referencesProvider != null && - !((referencesProvider is bool || - ReferenceOptions.canParse(referencesProvider, reporter)))) { - reporter - .reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentHighlightProvider'); - try { - final documentHighlightProvider = obj['documentHighlightProvider']; - if (documentHighlightProvider != null && - !((documentHighlightProvider is bool || - DocumentHighlightOptions.canParse( - documentHighlightProvider, reporter)))) { + final inlayHintProvider = obj['inlayHintProvider']; + if (inlayHintProvider != null && + !((inlayHintProvider is bool || + InlayHintOptions.canParse(inlayHintProvider, reporter) || + InlayHintRegistrationOptions.canParse( + inlayHintProvider, reporter)))) { reporter.reportError( - 'must be of type Either2'); + 'must be of type Either3'); return false; } } finally { reporter.pop(); } - reporter.push('documentSymbolProvider'); + reporter.push('inlineValueProvider'); try { - final documentSymbolProvider = obj['documentSymbolProvider']; - if (documentSymbolProvider != null && - !((documentSymbolProvider is bool || - DocumentSymbolOptions.canParse( - documentSymbolProvider, reporter)))) { + final inlineValueProvider = obj['inlineValueProvider']; + if (inlineValueProvider != null && + !((inlineValueProvider is bool || + InlineValueOptions.canParse(inlineValueProvider, reporter) || + InlineValueRegistrationOptions.canParse( + inlineValueProvider, reporter)))) { reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('codeActionProvider'); - try { - final codeActionProvider = obj['codeActionProvider']; - if (codeActionProvider != null && - !((codeActionProvider is bool || - CodeActionOptions.canParse(codeActionProvider, reporter)))) { - reporter - .reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('codeLensProvider'); - try { - final codeLensProvider = obj['codeLensProvider']; - if (codeLensProvider != null && - !(CodeLensOptions.canParse(codeLensProvider, reporter))) { - reporter.reportError('must be of type CodeLensOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentLinkProvider'); - try { - final documentLinkProvider = obj['documentLinkProvider']; - if (documentLinkProvider != null && - !(DocumentLinkOptions.canParse(documentLinkProvider, reporter))) { - reporter.reportError('must be of type DocumentLinkOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('colorProvider'); - try { - final colorProvider = obj['colorProvider']; - if (colorProvider != null && - !((colorProvider is bool || - DocumentColorOptions.canParse(colorProvider, reporter) || - DocumentColorRegistrationOptions.canParse( - colorProvider, reporter)))) { - reporter.reportError( - 'must be of type Either3'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentFormattingProvider'); - try { - final documentFormattingProvider = obj['documentFormattingProvider']; - if (documentFormattingProvider != null && - !((documentFormattingProvider is bool || - DocumentFormattingOptions.canParse( - documentFormattingProvider, reporter)))) { - reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentRangeFormattingProvider'); - try { - final documentRangeFormattingProvider = - obj['documentRangeFormattingProvider']; - if (documentRangeFormattingProvider != null && - !((documentRangeFormattingProvider is bool || - DocumentRangeFormattingOptions.canParse( - documentRangeFormattingProvider, reporter)))) { - reporter.reportError( - 'must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentOnTypeFormattingProvider'); - try { - final documentOnTypeFormattingProvider = - obj['documentOnTypeFormattingProvider']; - if (documentOnTypeFormattingProvider != null && - !(DocumentOnTypeFormattingOptions.canParse( - documentOnTypeFormattingProvider, reporter))) { - reporter - .reportError('must be of type DocumentOnTypeFormattingOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('renameProvider'); - try { - final renameProvider = obj['renameProvider']; - if (renameProvider != null && - !((renameProvider is bool || - RenameOptions.canParse(renameProvider, reporter)))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('foldingRangeProvider'); - try { - final foldingRangeProvider = obj['foldingRangeProvider']; - if (foldingRangeProvider != null && - !((foldingRangeProvider is bool || - FoldingRangeOptions.canParse(foldingRangeProvider, reporter) || - FoldingRangeRegistrationOptions.canParse( - foldingRangeProvider, reporter)))) { - reporter.reportError( - 'must be of type Either3'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('executeCommandProvider'); - try { - final executeCommandProvider = obj['executeCommandProvider']; - if (executeCommandProvider != null && - !(ExecuteCommandOptions.canParse( - executeCommandProvider, reporter))) { - reporter.reportError('must be of type ExecuteCommandOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('selectionRangeProvider'); - try { - final selectionRangeProvider = obj['selectionRangeProvider']; - if (selectionRangeProvider != null && - !((selectionRangeProvider is bool || - SelectionRangeOptions.canParse( - selectionRangeProvider, reporter) || - SelectionRangeRegistrationOptions.canParse( - selectionRangeProvider, reporter)))) { - reporter.reportError( - 'must be of type Either3'); + 'must be of type Either3'); return false; } } finally { @@ -35561,17 +35513,83 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('callHierarchyProvider'); + reporter.push('monikerProvider'); try { - final callHierarchyProvider = obj['callHierarchyProvider']; - if (callHierarchyProvider != null && - !((callHierarchyProvider is bool || - CallHierarchyOptions.canParse( - callHierarchyProvider, reporter) || - CallHierarchyRegistrationOptions.canParse( - callHierarchyProvider, reporter)))) { + final monikerProvider = obj['monikerProvider']; + if (monikerProvider != null && + !((monikerProvider is bool || + MonikerOptions.canParse(monikerProvider, reporter) || + MonikerRegistrationOptions.canParse( + monikerProvider, reporter)))) { reporter.reportError( - 'must be of type Either3'); + 'must be of type Either3'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('notebookDocumentSync'); + try { + final notebookDocumentSync = obj['notebookDocumentSync']; + if (notebookDocumentSync != null && + !((NotebookDocumentSyncOptions.canParse( + notebookDocumentSync, reporter) || + NotebookDocumentSyncRegistrationOptions.canParse( + notebookDocumentSync, reporter)))) { + reporter.reportError( + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('positionEncoding'); + try { + final positionEncoding = obj['positionEncoding']; + if (positionEncoding != null && + !(PositionEncodingKind.canParse(positionEncoding, reporter))) { + reporter.reportError('must be of type PositionEncodingKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('referencesProvider'); + try { + final referencesProvider = obj['referencesProvider']; + if (referencesProvider != null && + !((referencesProvider is bool || + ReferenceOptions.canParse(referencesProvider, reporter)))) { + reporter + .reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('renameProvider'); + try { + final renameProvider = obj['renameProvider']; + if (renameProvider != null && + !((renameProvider is bool || + RenameOptions.canParse(renameProvider, reporter)))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('selectionRangeProvider'); + try { + final selectionRangeProvider = obj['selectionRangeProvider']; + if (selectionRangeProvider != null && + !((selectionRangeProvider is bool || + SelectionRangeOptions.canParse( + selectionRangeProvider, reporter) || + SelectionRangeRegistrationOptions.canParse( + selectionRangeProvider, reporter)))) { + reporter.reportError( + 'must be of type Either3'); return false; } } finally { @@ -35592,16 +35610,42 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('monikerProvider'); + reporter.push('signatureHelpProvider'); try { - final monikerProvider = obj['monikerProvider']; - if (monikerProvider != null && - !((monikerProvider is bool || - MonikerOptions.canParse(monikerProvider, reporter) || - MonikerRegistrationOptions.canParse( - monikerProvider, reporter)))) { + final signatureHelpProvider = obj['signatureHelpProvider']; + if (signatureHelpProvider != null && + !(SignatureHelpOptions.canParse(signatureHelpProvider, reporter))) { + reporter.reportError('must be of type SignatureHelpOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('textDocumentSync'); + try { + final textDocumentSync = obj['textDocumentSync']; + if (textDocumentSync != null && + !((TextDocumentSyncKind.canParse(textDocumentSync, reporter) || + TextDocumentSyncOptions.canParse( + textDocumentSync, reporter)))) { reporter.reportError( - 'must be of type Either3'); + 'must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('typeDefinitionProvider'); + try { + final typeDefinitionProvider = obj['typeDefinitionProvider']; + if (typeDefinitionProvider != null && + !((typeDefinitionProvider is bool || + TypeDefinitionOptions.canParse( + typeDefinitionProvider, reporter) || + TypeDefinitionRegistrationOptions.canParse( + typeDefinitionProvider, reporter)))) { + reporter.reportError( + 'must be of type Either3'); return false; } } finally { @@ -35623,45 +35667,12 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('inlineValueProvider'); + reporter.push('workspace'); try { - final inlineValueProvider = obj['inlineValueProvider']; - if (inlineValueProvider != null && - !((inlineValueProvider is bool || - InlineValueOptions.canParse(inlineValueProvider, reporter) || - InlineValueRegistrationOptions.canParse( - inlineValueProvider, reporter)))) { - reporter.reportError( - 'must be of type Either3'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('inlayHintProvider'); - try { - final inlayHintProvider = obj['inlayHintProvider']; - if (inlayHintProvider != null && - !((inlayHintProvider is bool || - InlayHintOptions.canParse(inlayHintProvider, reporter) || - InlayHintRegistrationOptions.canParse( - inlayHintProvider, reporter)))) { - reporter.reportError( - 'must be of type Either3'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('diagnosticProvider'); - try { - final diagnosticProvider = obj['diagnosticProvider']; - if (diagnosticProvider != null && - !((DiagnosticOptions.canParse(diagnosticProvider, reporter) || - DiagnosticRegistrationOptions.canParse( - diagnosticProvider, reporter)))) { - reporter.reportError( - 'must be of type Either2'); + final workspace = obj['workspace']; + if (workspace != null && + !(ServerCapabilitiesWorkspace.canParse(workspace, reporter))) { + reporter.reportError('must be of type ServerCapabilitiesWorkspace'); return false; } } finally { @@ -35681,17 +35692,6 @@ class ServerCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('workspace'); - try { - final workspace = obj['workspace']; - if (workspace != null && - !(ServerCapabilitiesWorkspace.canParse(workspace, reporter))) { - reporter.reportError('must be of type ServerCapabilitiesWorkspace'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ServerCapabilities'); @@ -35703,43 +35703,43 @@ class ServerCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is ServerCapabilities && other.runtimeType == ServerCapabilities) { - return positionEncoding == other.positionEncoding && - textDocumentSync == other.textDocumentSync && - notebookDocumentSync == other.notebookDocumentSync && - completionProvider == other.completionProvider && - hoverProvider == other.hoverProvider && - signatureHelpProvider == other.signatureHelpProvider && - declarationProvider == other.declarationProvider && - definitionProvider == other.definitionProvider && - typeDefinitionProvider == other.typeDefinitionProvider && - implementationProvider == other.implementationProvider && - referencesProvider == other.referencesProvider && - documentHighlightProvider == other.documentHighlightProvider && - documentSymbolProvider == other.documentSymbolProvider && + return callHierarchyProvider == other.callHierarchyProvider && codeActionProvider == other.codeActionProvider && codeLensProvider == other.codeLensProvider && - documentLinkProvider == other.documentLinkProvider && colorProvider == other.colorProvider && + completionProvider == other.completionProvider && + declarationProvider == other.declarationProvider && + definitionProvider == other.definitionProvider && + diagnosticProvider == other.diagnosticProvider && documentFormattingProvider == other.documentFormattingProvider && - documentRangeFormattingProvider == - other.documentRangeFormattingProvider && + documentHighlightProvider == other.documentHighlightProvider && + documentLinkProvider == other.documentLinkProvider && documentOnTypeFormattingProvider == other.documentOnTypeFormattingProvider && - renameProvider == other.renameProvider && - foldingRangeProvider == other.foldingRangeProvider && + documentRangeFormattingProvider == + other.documentRangeFormattingProvider && + documentSymbolProvider == other.documentSymbolProvider && executeCommandProvider == other.executeCommandProvider && - selectionRangeProvider == other.selectionRangeProvider && - linkedEditingRangeProvider == other.linkedEditingRangeProvider && - callHierarchyProvider == other.callHierarchyProvider && - semanticTokensProvider == other.semanticTokensProvider && - monikerProvider == other.monikerProvider && - typeHierarchyProvider == other.typeHierarchyProvider && - inlineValueProvider == other.inlineValueProvider && - inlayHintProvider == other.inlayHintProvider && - diagnosticProvider == other.diagnosticProvider && - workspaceSymbolProvider == other.workspaceSymbolProvider && - workspace == other.workspace && experimental == other.experimental && + foldingRangeProvider == other.foldingRangeProvider && + hoverProvider == other.hoverProvider && + implementationProvider == other.implementationProvider && + inlayHintProvider == other.inlayHintProvider && + inlineValueProvider == other.inlineValueProvider && + linkedEditingRangeProvider == other.linkedEditingRangeProvider && + monikerProvider == other.monikerProvider && + notebookDocumentSync == other.notebookDocumentSync && + positionEncoding == other.positionEncoding && + referencesProvider == other.referencesProvider && + renameProvider == other.renameProvider && + selectionRangeProvider == other.selectionRangeProvider && + semanticTokensProvider == other.semanticTokensProvider && + signatureHelpProvider == other.signatureHelpProvider && + textDocumentSync == other.textDocumentSync && + typeDefinitionProvider == other.typeDefinitionProvider && + typeHierarchyProvider == other.typeHierarchyProvider && + workspace == other.workspace && + workspaceSymbolProvider == other.workspaceSymbolProvider && true; } return false; @@ -35747,41 +35747,41 @@ class ServerCapabilities implements ToJsonable { @override int get hashCode => Object.hashAll([ - positionEncoding, - textDocumentSync, - notebookDocumentSync, - completionProvider, - hoverProvider, - signatureHelpProvider, - declarationProvider, - definitionProvider, - typeDefinitionProvider, - implementationProvider, - referencesProvider, - documentHighlightProvider, - documentSymbolProvider, + callHierarchyProvider, codeActionProvider, codeLensProvider, - documentLinkProvider, colorProvider, - documentFormattingProvider, - documentRangeFormattingProvider, - documentOnTypeFormattingProvider, - renameProvider, - foldingRangeProvider, - executeCommandProvider, - selectionRangeProvider, - linkedEditingRangeProvider, - callHierarchyProvider, - semanticTokensProvider, - monikerProvider, - typeHierarchyProvider, - inlineValueProvider, - inlayHintProvider, + completionProvider, + declarationProvider, + definitionProvider, diagnosticProvider, - workspaceSymbolProvider, - workspace, + documentFormattingProvider, + documentHighlightProvider, + documentLinkProvider, + documentOnTypeFormattingProvider, + documentRangeFormattingProvider, + documentSymbolProvider, + executeCommandProvider, experimental, + foldingRangeProvider, + hoverProvider, + implementationProvider, + inlayHintProvider, + inlineValueProvider, + linkedEditingRangeProvider, + monikerProvider, + notebookDocumentSync, + positionEncoding, + referencesProvider, + renameProvider, + selectionRangeProvider, + semanticTokensProvider, + signatureHelpProvider, + textDocumentSync, + typeDefinitionProvider, + typeHierarchyProvider, + workspace, + workspaceSymbolProvider, ]); @override @@ -35796,11 +35796,11 @@ class ServerCapabilitiesFileOperations implements ToJsonable { ServerCapabilitiesFileOperations({ this.didCreate, - this.willCreate, - this.didRename, - this.willRename, this.didDelete, + this.didRename, + this.willCreate, this.willDelete, + this.willRename, }); static ServerCapabilitiesFileOperations fromJson(Map json) { final didCreateJson = json['didCreate']; @@ -35808,38 +35808,38 @@ class ServerCapabilitiesFileOperations implements ToJsonable { ? FileOperationRegistrationOptions.fromJson( didCreateJson as Map) : null; - final willCreateJson = json['willCreate']; - final willCreate = willCreateJson != null + final didDeleteJson = json['didDelete']; + final didDelete = didDeleteJson != null ? FileOperationRegistrationOptions.fromJson( - willCreateJson as Map) + didDeleteJson as Map) : null; final didRenameJson = json['didRename']; final didRename = didRenameJson != null ? FileOperationRegistrationOptions.fromJson( didRenameJson as Map) : null; - final willRenameJson = json['willRename']; - final willRename = willRenameJson != null + final willCreateJson = json['willCreate']; + final willCreate = willCreateJson != null ? FileOperationRegistrationOptions.fromJson( - willRenameJson as Map) - : null; - final didDeleteJson = json['didDelete']; - final didDelete = didDeleteJson != null - ? FileOperationRegistrationOptions.fromJson( - didDeleteJson as Map) + willCreateJson as Map) : null; final willDeleteJson = json['willDelete']; final willDelete = willDeleteJson != null ? FileOperationRegistrationOptions.fromJson( willDeleteJson as Map) : null; + final willRenameJson = json['willRename']; + final willRename = willRenameJson != null + ? FileOperationRegistrationOptions.fromJson( + willRenameJson as Map) + : null; return ServerCapabilitiesFileOperations( didCreate: didCreate, - willCreate: willCreate, - didRename: didRename, - willRename: willRename, didDelete: didDelete, + didRename: didRename, + willCreate: willCreate, willDelete: willDelete, + willRename: willRename, ); } @@ -35866,21 +35866,21 @@ class ServerCapabilitiesFileOperations implements ToJsonable { if (didCreate != null) { __result['didCreate'] = didCreate?.toJson(); } - if (willCreate != null) { - __result['willCreate'] = willCreate?.toJson(); + if (didDelete != null) { + __result['didDelete'] = didDelete?.toJson(); } if (didRename != null) { __result['didRename'] = didRename?.toJson(); } - if (willRename != null) { - __result['willRename'] = willRename?.toJson(); - } - if (didDelete != null) { - __result['didDelete'] = didDelete?.toJson(); + if (willCreate != null) { + __result['willCreate'] = willCreate?.toJson(); } if (willDelete != null) { __result['willDelete'] = willDelete?.toJson(); } + if (willRename != null) { + __result['willRename'] = willRename?.toJson(); + } return __result; } @@ -35898,6 +35898,30 @@ class ServerCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } + reporter.push('didDelete'); + try { + final didDelete = obj['didDelete']; + if (didDelete != null && + !(FileOperationRegistrationOptions.canParse(didDelete, reporter))) { + reporter + .reportError('must be of type FileOperationRegistrationOptions'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('didRename'); + try { + final didRename = obj['didRename']; + if (didRename != null && + !(FileOperationRegistrationOptions.canParse(didRename, reporter))) { + reporter + .reportError('must be of type FileOperationRegistrationOptions'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('willCreate'); try { final willCreate = obj['willCreate']; @@ -35911,11 +35935,12 @@ class ServerCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } - reporter.push('didRename'); + reporter.push('willDelete'); try { - final didRename = obj['didRename']; - if (didRename != null && - !(FileOperationRegistrationOptions.canParse(didRename, reporter))) { + final willDelete = obj['willDelete']; + if (willDelete != null && + !(FileOperationRegistrationOptions.canParse( + willDelete, reporter))) { reporter .reportError('must be of type FileOperationRegistrationOptions'); return false; @@ -35936,31 +35961,6 @@ class ServerCapabilitiesFileOperations implements ToJsonable { } finally { reporter.pop(); } - reporter.push('didDelete'); - try { - final didDelete = obj['didDelete']; - if (didDelete != null && - !(FileOperationRegistrationOptions.canParse(didDelete, reporter))) { - reporter - .reportError('must be of type FileOperationRegistrationOptions'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('willDelete'); - try { - final willDelete = obj['willDelete']; - if (willDelete != null && - !(FileOperationRegistrationOptions.canParse( - willDelete, reporter))) { - reporter - .reportError('must be of type FileOperationRegistrationOptions'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ServerCapabilitiesFileOperations'); @@ -35973,11 +35973,11 @@ class ServerCapabilitiesFileOperations implements ToJsonable { if (other is ServerCapabilitiesFileOperations && other.runtimeType == ServerCapabilitiesFileOperations) { return didCreate == other.didCreate && - willCreate == other.willCreate && - didRename == other.didRename && - willRename == other.willRename && didDelete == other.didDelete && + didRename == other.didRename && + willCreate == other.willCreate && willDelete == other.willDelete && + willRename == other.willRename && true; } return false; @@ -35986,11 +35986,11 @@ class ServerCapabilitiesFileOperations implements ToJsonable { @override int get hashCode => Object.hash( didCreate, - willCreate, - didRename, - willRename, didDelete, + didRename, + willCreate, willDelete, + willRename, ); @override @@ -36004,23 +36004,23 @@ class ServerCapabilitiesWorkspace implements ToJsonable { ); ServerCapabilitiesWorkspace({ - this.workspaceFolders, this.fileOperations, + this.workspaceFolders, }); static ServerCapabilitiesWorkspace fromJson(Map json) { - final workspaceFoldersJson = json['workspaceFolders']; - final workspaceFolders = workspaceFoldersJson != null - ? WorkspaceFoldersServerCapabilities.fromJson( - workspaceFoldersJson as Map) - : null; final fileOperationsJson = json['fileOperations']; final fileOperations = fileOperationsJson != null ? ServerCapabilitiesFileOperations.fromJson( fileOperationsJson as Map) : null; + final workspaceFoldersJson = json['workspaceFolders']; + final workspaceFolders = workspaceFoldersJson != null + ? WorkspaceFoldersServerCapabilities.fromJson( + workspaceFoldersJson as Map) + : null; return ServerCapabilitiesWorkspace( - workspaceFolders: workspaceFolders, fileOperations: fileOperations, + workspaceFolders: workspaceFolders, ); } @@ -36034,30 +36034,17 @@ class ServerCapabilitiesWorkspace implements ToJsonable { Map toJson() { var __result = {}; - if (workspaceFolders != null) { - __result['workspaceFolders'] = workspaceFolders?.toJson(); - } if (fileOperations != null) { __result['fileOperations'] = fileOperations?.toJson(); } + if (workspaceFolders != null) { + __result['workspaceFolders'] = workspaceFolders?.toJson(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('workspaceFolders'); - try { - final workspaceFolders = obj['workspaceFolders']; - if (workspaceFolders != null && - !(WorkspaceFoldersServerCapabilities.canParse( - workspaceFolders, reporter))) { - reporter.reportError( - 'must be of type WorkspaceFoldersServerCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('fileOperations'); try { final fileOperations = obj['fileOperations']; @@ -36071,6 +36058,19 @@ class ServerCapabilitiesWorkspace implements ToJsonable { } finally { reporter.pop(); } + reporter.push('workspaceFolders'); + try { + final workspaceFolders = obj['workspaceFolders']; + if (workspaceFolders != null && + !(WorkspaceFoldersServerCapabilities.canParse( + workspaceFolders, reporter))) { + reporter.reportError( + 'must be of type WorkspaceFoldersServerCapabilities'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ServerCapabilitiesWorkspace'); @@ -36082,8 +36082,8 @@ class ServerCapabilitiesWorkspace implements ToJsonable { bool operator ==(Object other) { if (other is ServerCapabilitiesWorkspace && other.runtimeType == ServerCapabilitiesWorkspace) { - return workspaceFolders == other.workspaceFolders && - fileOperations == other.fileOperations && + return fileOperations == other.fileOperations && + workspaceFolders == other.workspaceFolders && true; } return false; @@ -36091,8 +36091,8 @@ class ServerCapabilitiesWorkspace implements ToJsonable { @override int get hashCode => Object.hash( - workspaceFolders, fileOperations, + workspaceFolders, ); @override @@ -36250,27 +36250,27 @@ class ShowDocumentParams implements ToJsonable { ); ShowDocumentParams({ - required this.uri, this.external, - this.takeFocus, this.selection, + this.takeFocus, + required this.uri, }); static ShowDocumentParams fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final externalJson = json['external']; final external = externalJson as bool?; - final takeFocusJson = json['takeFocus']; - final takeFocus = takeFocusJson as bool?; final selectionJson = json['selection']; final selection = selectionJson != null ? Range.fromJson(selectionJson as Map) : null; + final takeFocusJson = json['takeFocus']; + final takeFocus = takeFocusJson as bool?; + final uriJson = json['uri']; + final uri = uriJson as String; return ShowDocumentParams( - uri: uri, external: external, - takeFocus: takeFocus, selection: selection, + takeFocus: takeFocus, + uri: uri, ); } @@ -36294,21 +36294,51 @@ class ShowDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; if (external != null) { __result['external'] = external; } - if (takeFocus != null) { - __result['takeFocus'] = takeFocus; - } if (selection != null) { __result['selection'] = selection?.toJson(); } + if (takeFocus != null) { + __result['takeFocus'] = takeFocus; + } + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('external'); + try { + final external = obj['external']; + if (external != null && !(external is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('selection'); + try { + final selection = obj['selection']; + if (selection != null && !(Range.canParse(selection, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('takeFocus'); + try { + final takeFocus = obj['takeFocus']; + if (takeFocus != null && !(takeFocus is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -36327,36 +36357,6 @@ class ShowDocumentParams implements ToJsonable { } finally { reporter.pop(); } - reporter.push('external'); - try { - final external = obj['external']; - if (external != null && !(external is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('takeFocus'); - try { - final takeFocus = obj['takeFocus']; - if (takeFocus != null && !(takeFocus is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('selection'); - try { - final selection = obj['selection']; - if (selection != null && !(Range.canParse(selection, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type ShowDocumentParams'); @@ -36368,10 +36368,10 @@ class ShowDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is ShowDocumentParams && other.runtimeType == ShowDocumentParams) { - return uri == other.uri && - external == other.external && - takeFocus == other.takeFocus && + return external == other.external && selection == other.selection && + takeFocus == other.takeFocus && + uri == other.uri && true; } return false; @@ -36379,10 +36379,10 @@ class ShowDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - uri, external, - takeFocus, selection, + takeFocus, + uri, ); @override @@ -36467,17 +36467,17 @@ class ShowMessageParams implements ToJsonable { ); ShowMessageParams({ - required this.type, required this.message, + required this.type, }); static ShowMessageParams fromJson(Map json) { - final typeJson = json['type']; - final type = MessageType.fromJson(typeJson as int); final messageJson = json['message']; final message = messageJson as String; + final typeJson = json['type']; + final type = MessageType.fromJson(typeJson as int); return ShowMessageParams( - type: type, message: message, + type: type, ); } @@ -36489,31 +36489,13 @@ class ShowMessageParams implements ToJsonable { Map toJson() { var __result = {}; - __result['type'] = type.toJson(); __result['message'] = message; + __result['type'] = type.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('type'); - try { - if (!obj.containsKey('type')) { - reporter.reportError('must not be undefined'); - return false; - } - final type = obj['type']; - if (type == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(MessageType.canParse(type, reporter))) { - reporter.reportError('must be of type MessageType'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('message'); try { if (!obj.containsKey('message')) { @@ -36532,6 +36514,24 @@ class ShowMessageParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('type'); + try { + if (!obj.containsKey('type')) { + reporter.reportError('must not be undefined'); + return false; + } + final type = obj['type']; + if (type == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(MessageType.canParse(type, reporter))) { + reporter.reportError('must be of type MessageType'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type ShowMessageParams'); @@ -36542,15 +36542,15 @@ class ShowMessageParams implements ToJsonable { @override bool operator ==(Object other) { if (other is ShowMessageParams && other.runtimeType == ShowMessageParams) { - return type == other.type && message == other.message && true; + return message == other.message && type == other.type && true; } return false; } @override int get hashCode => Object.hash( - type, message, + type, ); @override @@ -36708,24 +36708,24 @@ class ShowMessageRequestParams implements ToJsonable { ); ShowMessageRequestParams({ - required this.type, - required this.message, this.actions, + required this.message, + required this.type, }); static ShowMessageRequestParams fromJson(Map json) { - final typeJson = json['type']; - final type = MessageType.fromJson(typeJson as int); - final messageJson = json['message']; - final message = messageJson as String; final actionsJson = json['actions']; final actions = (actionsJson as List?) ?.map( (item) => MessageActionItem.fromJson(item as Map)) .toList(); + final messageJson = json['message']; + final message = messageJson as String; + final typeJson = json['type']; + final type = MessageType.fromJson(typeJson as int); return ShowMessageRequestParams( - type: type, - message: message, actions: actions, + message: message, + type: type, ); } @@ -36740,29 +36740,24 @@ class ShowMessageRequestParams implements ToJsonable { Map toJson() { var __result = {}; - __result['type'] = type.toJson(); - __result['message'] = message; if (actions != null) { __result['actions'] = actions?.map((item) => item.toJson()).toList(); } + __result['message'] = message; + __result['type'] = type.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('type'); + reporter.push('actions'); try { - if (!obj.containsKey('type')) { - reporter.reportError('must not be undefined'); - return false; - } - final type = obj['type']; - if (type == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(MessageType.canParse(type, reporter))) { - reporter.reportError('must be of type MessageType'); + final actions = obj['actions']; + if (actions != null && + !((actions is List && + (actions.every( + (item) => MessageActionItem.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -36786,14 +36781,19 @@ class ShowMessageRequestParams implements ToJsonable { } finally { reporter.pop(); } - reporter.push('actions'); + reporter.push('type'); try { - final actions = obj['actions']; - if (actions != null && - !((actions is List && - (actions.every( - (item) => MessageActionItem.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + if (!obj.containsKey('type')) { + reporter.reportError('must not be undefined'); + return false; + } + final type = obj['type']; + if (type == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(MessageType.canParse(type, reporter))) { + reporter.reportError('must be of type MessageType'); return false; } } finally { @@ -36810,10 +36810,10 @@ class ShowMessageRequestParams implements ToJsonable { bool operator ==(Object other) { if (other is ShowMessageRequestParams && other.runtimeType == ShowMessageRequestParams) { - return type == other.type && - message == other.message && - listEqual(actions, other.actions, + return listEqual(actions, other.actions, (MessageActionItem a, MessageActionItem b) => a == b) && + message == other.message && + type == other.type && true; } return false; @@ -36821,9 +36821,9 @@ class ShowMessageRequestParams implements ToJsonable { @override int get hashCode => Object.hash( - type, - message, lspHashCode(actions), + message, + type, ); @override @@ -36839,24 +36839,24 @@ class SignatureHelp implements ToJsonable { ); SignatureHelp({ - required this.signatures, - this.activeSignature, this.activeParameter, + this.activeSignature, + required this.signatures, }); static SignatureHelp fromJson(Map json) { + final activeParameterJson = json['activeParameter']; + final activeParameter = activeParameterJson as int?; + final activeSignatureJson = json['activeSignature']; + final activeSignature = activeSignatureJson as int?; final signaturesJson = json['signatures']; final signatures = (signaturesJson as List) .map((item) => SignatureInformation.fromJson(item as Map)) .toList(); - final activeSignatureJson = json['activeSignature']; - final activeSignature = activeSignatureJson as int?; - final activeParameterJson = json['activeParameter']; - final activeParameter = activeParameterJson as int?; return SignatureHelp( - signatures: signatures, - activeSignature: activeSignature, activeParameter: activeParameter, + activeSignature: activeSignature, + signatures: signatures, ); } @@ -36885,18 +36885,38 @@ class SignatureHelp implements ToJsonable { Map toJson() { var __result = {}; - __result['signatures'] = signatures.map((item) => item.toJson()).toList(); - if (activeSignature != null) { - __result['activeSignature'] = activeSignature; - } if (activeParameter != null) { __result['activeParameter'] = activeParameter; } + if (activeSignature != null) { + __result['activeSignature'] = activeSignature; + } + __result['signatures'] = signatures.map((item) => item.toJson()).toList(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('activeParameter'); + try { + final activeParameter = obj['activeParameter']; + if (activeParameter != null && !(activeParameter is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('activeSignature'); + try { + final activeSignature = obj['activeSignature']; + if (activeSignature != null && !(activeSignature is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('signatures'); try { if (!obj.containsKey('signatures')) { @@ -36917,26 +36937,6 @@ class SignatureHelp implements ToJsonable { } finally { reporter.pop(); } - reporter.push('activeSignature'); - try { - final activeSignature = obj['activeSignature']; - if (activeSignature != null && !(activeSignature is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('activeParameter'); - try { - final activeParameter = obj['activeParameter']; - if (activeParameter != null && !(activeParameter is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SignatureHelp'); @@ -36947,10 +36947,10 @@ class SignatureHelp implements ToJsonable { @override bool operator ==(Object other) { if (other is SignatureHelp && other.runtimeType == SignatureHelp) { - return listEqual(signatures, other.signatures, - (SignatureInformation a, SignatureInformation b) => a == b) && + return activeParameter == other.activeParameter && activeSignature == other.activeSignature && - activeParameter == other.activeParameter && + listEqual(signatures, other.signatures, + (SignatureInformation a, SignatureInformation b) => a == b) && true; } return false; @@ -36958,9 +36958,9 @@ class SignatureHelp implements ToJsonable { @override int get hashCode => Object.hash( - lspHashCode(signatures), - activeSignature, activeParameter, + activeSignature, + lspHashCode(signatures), ); @override @@ -36974,11 +36974,13 @@ class SignatureHelpClientCapabilities implements ToJsonable { ); SignatureHelpClientCapabilities({ + this.contextSupport, this.dynamicRegistration, this.signatureInformation, - this.contextSupport, }); static SignatureHelpClientCapabilities fromJson(Map json) { + final contextSupportJson = json['contextSupport']; + final contextSupport = contextSupportJson as bool?; final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; final signatureInformationJson = json['signatureInformation']; @@ -36986,12 +36988,10 @@ class SignatureHelpClientCapabilities implements ToJsonable { ? SignatureHelpClientCapabilitiesSignatureInformation.fromJson( signatureInformationJson as Map) : null; - final contextSupportJson = json['contextSupport']; - final contextSupport = contextSupportJson as bool?; return SignatureHelpClientCapabilities( + contextSupport: contextSupport, dynamicRegistration: dynamicRegistration, signatureInformation: signatureInformation, - contextSupport: contextSupport, ); } @@ -37012,20 +37012,30 @@ class SignatureHelpClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; + if (contextSupport != null) { + __result['contextSupport'] = contextSupport; + } if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } if (signatureInformation != null) { __result['signatureInformation'] = signatureInformation?.toJson(); } - if (contextSupport != null) { - __result['contextSupport'] = contextSupport; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('contextSupport'); + try { + final contextSupport = obj['contextSupport']; + if (contextSupport != null && !(contextSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('dynamicRegistration'); try { final dynamicRegistration = obj['dynamicRegistration']; @@ -37049,16 +37059,6 @@ class SignatureHelpClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('contextSupport'); - try { - final contextSupport = obj['contextSupport']; - if (contextSupport != null && !(contextSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SignatureHelpClientCapabilities'); @@ -37070,9 +37070,9 @@ class SignatureHelpClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is SignatureHelpClientCapabilities && other.runtimeType == SignatureHelpClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && + return contextSupport == other.contextSupport && + dynamicRegistration == other.dynamicRegistration && signatureInformation == other.signatureInformation && - contextSupport == other.contextSupport && true; } return false; @@ -37080,9 +37080,9 @@ class SignatureHelpClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( + contextSupport, dynamicRegistration, signatureInformation, - contextSupport, ); @override @@ -37166,12 +37166,14 @@ class SignatureHelpClientCapabilitiesSignatureInformation ); SignatureHelpClientCapabilitiesSignatureInformation({ + this.activeParameterSupport, this.documentationFormat, this.parameterInformation, - this.activeParameterSupport, }); static SignatureHelpClientCapabilitiesSignatureInformation fromJson( Map json) { + final activeParameterSupportJson = json['activeParameterSupport']; + final activeParameterSupport = activeParameterSupportJson as bool?; final documentationFormatJson = json['documentationFormat']; final documentationFormat = (documentationFormatJson as List?) ?.map((item) => MarkupKind.fromJson(item as String)) @@ -37181,12 +37183,10 @@ class SignatureHelpClientCapabilitiesSignatureInformation ? SignatureHelpClientCapabilitiesParameterInformation.fromJson( parameterInformationJson as Map) : null; - final activeParameterSupportJson = json['activeParameterSupport']; - final activeParameterSupport = activeParameterSupportJson as bool?; return SignatureHelpClientCapabilitiesSignatureInformation( + activeParameterSupport: activeParameterSupport, documentationFormat: documentationFormat, parameterInformation: parameterInformation, - activeParameterSupport: activeParameterSupport, ); } @@ -37205,6 +37205,9 @@ class SignatureHelpClientCapabilitiesSignatureInformation Map toJson() { var __result = {}; + if (activeParameterSupport != null) { + __result['activeParameterSupport'] = activeParameterSupport; + } if (documentationFormat != null) { __result['documentationFormat'] = documentationFormat?.map((item) => item.toJson()).toList(); @@ -37212,14 +37215,22 @@ class SignatureHelpClientCapabilitiesSignatureInformation if (parameterInformation != null) { __result['parameterInformation'] = parameterInformation?.toJson(); } - if (activeParameterSupport != null) { - __result['activeParameterSupport'] = activeParameterSupport; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('activeParameterSupport'); + try { + final activeParameterSupport = obj['activeParameterSupport']; + if (activeParameterSupport != null && + !(activeParameterSupport is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('documentationFormat'); try { final documentationFormat = obj['documentationFormat']; @@ -37246,17 +37257,6 @@ class SignatureHelpClientCapabilitiesSignatureInformation } finally { reporter.pop(); } - reporter.push('activeParameterSupport'); - try { - final activeParameterSupport = obj['activeParameterSupport']; - if (activeParameterSupport != null && - !(activeParameterSupport is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError( @@ -37270,10 +37270,10 @@ class SignatureHelpClientCapabilitiesSignatureInformation if (other is SignatureHelpClientCapabilitiesSignatureInformation && other.runtimeType == SignatureHelpClientCapabilitiesSignatureInformation) { - return listEqual(documentationFormat, other.documentationFormat, + return activeParameterSupport == other.activeParameterSupport && + listEqual(documentationFormat, other.documentationFormat, (MarkupKind a, MarkupKind b) => a == b) && parameterInformation == other.parameterInformation && - activeParameterSupport == other.activeParameterSupport && true; } return false; @@ -37281,9 +37281,9 @@ class SignatureHelpClientCapabilitiesSignatureInformation @override int get hashCode => Object.hash( + activeParameterSupport, lspHashCode(documentationFormat), parameterInformation, - activeParameterSupport, ); @override @@ -37300,29 +37300,29 @@ class SignatureHelpContext implements ToJsonable { ); SignatureHelpContext({ - required this.triggerKind, - this.triggerCharacter, - required this.isRetrigger, this.activeSignatureHelp, + required this.isRetrigger, + this.triggerCharacter, + required this.triggerKind, }); static SignatureHelpContext fromJson(Map json) { - final triggerKindJson = json['triggerKind']; - final triggerKind = - SignatureHelpTriggerKind.fromJson(triggerKindJson as int); - final triggerCharacterJson = json['triggerCharacter']; - final triggerCharacter = triggerCharacterJson as String?; - final isRetriggerJson = json['isRetrigger']; - final isRetrigger = isRetriggerJson as bool; final activeSignatureHelpJson = json['activeSignatureHelp']; final activeSignatureHelp = activeSignatureHelpJson != null ? SignatureHelp.fromJson( activeSignatureHelpJson as Map) : null; + final isRetriggerJson = json['isRetrigger']; + final isRetrigger = isRetriggerJson as bool; + final triggerCharacterJson = json['triggerCharacter']; + final triggerCharacter = triggerCharacterJson as String?; + final triggerKindJson = json['triggerKind']; + final triggerKind = + SignatureHelpTriggerKind.fromJson(triggerKindJson as int); return SignatureHelpContext( - triggerKind: triggerKind, - triggerCharacter: triggerCharacter, - isRetrigger: isRetrigger, activeSignatureHelp: activeSignatureHelp, + isRetrigger: isRetrigger, + triggerCharacter: triggerCharacter, + triggerKind: triggerKind, ); } @@ -37350,42 +37350,25 @@ class SignatureHelpContext implements ToJsonable { Map toJson() { var __result = {}; - __result['triggerKind'] = triggerKind.toJson(); - if (triggerCharacter != null) { - __result['triggerCharacter'] = triggerCharacter; - } - __result['isRetrigger'] = isRetrigger; if (activeSignatureHelp != null) { __result['activeSignatureHelp'] = activeSignatureHelp?.toJson(); } + __result['isRetrigger'] = isRetrigger; + if (triggerCharacter != null) { + __result['triggerCharacter'] = triggerCharacter; + } + __result['triggerKind'] = triggerKind.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('triggerKind'); + reporter.push('activeSignatureHelp'); try { - if (!obj.containsKey('triggerKind')) { - reporter.reportError('must not be undefined'); - return false; - } - final triggerKind = obj['triggerKind']; - if (triggerKind == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(SignatureHelpTriggerKind.canParse(triggerKind, reporter))) { - reporter.reportError('must be of type SignatureHelpTriggerKind'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('triggerCharacter'); - try { - final triggerCharacter = obj['triggerCharacter']; - if (triggerCharacter != null && !(triggerCharacter is String)) { - reporter.reportError('must be of type String'); + final activeSignatureHelp = obj['activeSignatureHelp']; + if (activeSignatureHelp != null && + !(SignatureHelp.canParse(activeSignatureHelp, reporter))) { + reporter.reportError('must be of type SignatureHelp'); return false; } } finally { @@ -37409,12 +37392,29 @@ class SignatureHelpContext implements ToJsonable { } finally { reporter.pop(); } - reporter.push('activeSignatureHelp'); + reporter.push('triggerCharacter'); try { - final activeSignatureHelp = obj['activeSignatureHelp']; - if (activeSignatureHelp != null && - !(SignatureHelp.canParse(activeSignatureHelp, reporter))) { - reporter.reportError('must be of type SignatureHelp'); + final triggerCharacter = obj['triggerCharacter']; + if (triggerCharacter != null && !(triggerCharacter is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('triggerKind'); + try { + if (!obj.containsKey('triggerKind')) { + reporter.reportError('must not be undefined'); + return false; + } + final triggerKind = obj['triggerKind']; + if (triggerKind == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(SignatureHelpTriggerKind.canParse(triggerKind, reporter))) { + reporter.reportError('must be of type SignatureHelpTriggerKind'); return false; } } finally { @@ -37431,10 +37431,10 @@ class SignatureHelpContext implements ToJsonable { bool operator ==(Object other) { if (other is SignatureHelpContext && other.runtimeType == SignatureHelpContext) { - return triggerKind == other.triggerKind && - triggerCharacter == other.triggerCharacter && + return activeSignatureHelp == other.activeSignatureHelp && isRetrigger == other.isRetrigger && - activeSignatureHelp == other.activeSignatureHelp && + triggerCharacter == other.triggerCharacter && + triggerKind == other.triggerKind && true; } return false; @@ -37442,10 +37442,10 @@ class SignatureHelpContext implements ToJsonable { @override int get hashCode => Object.hash( - triggerKind, - triggerCharacter, - isRetrigger, activeSignatureHelp, + isRetrigger, + triggerCharacter, + triggerKind, ); @override @@ -37459,27 +37459,27 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { ); SignatureHelpOptions({ - this.triggerCharacters, this.retriggerCharacters, + this.triggerCharacters, this.workDoneProgress, }); static SignatureHelpOptions fromJson(Map json) { if (SignatureHelpRegistrationOptions.canParse(json, nullLspJsonReporter)) { return SignatureHelpRegistrationOptions.fromJson(json); } - final triggerCharactersJson = json['triggerCharacters']; - final triggerCharacters = (triggerCharactersJson as List?) - ?.map((item) => item as String) - .toList(); final retriggerCharactersJson = json['retriggerCharacters']; final retriggerCharacters = (retriggerCharactersJson as List?) ?.map((item) => item as String) .toList(); + final triggerCharactersJson = json['triggerCharacters']; + final triggerCharacters = (triggerCharactersJson as List?) + ?.map((item) => item as String) + .toList(); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return SignatureHelpOptions( - triggerCharacters: triggerCharacters, retriggerCharacters: retriggerCharacters, + triggerCharacters: triggerCharacters, workDoneProgress: workDoneProgress, ); } @@ -37497,12 +37497,12 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { Map toJson() { var __result = {}; - if (triggerCharacters != null) { - __result['triggerCharacters'] = triggerCharacters; - } if (retriggerCharacters != null) { __result['retriggerCharacters'] = retriggerCharacters; } + if (triggerCharacters != null) { + __result['triggerCharacters'] = triggerCharacters; + } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } @@ -37511,18 +37511,6 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('triggerCharacters'); - try { - final triggerCharacters = obj['triggerCharacters']; - if (triggerCharacters != null && - !((triggerCharacters is List && - (triggerCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('retriggerCharacters'); try { final retriggerCharacters = obj['retriggerCharacters']; @@ -37535,6 +37523,18 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { } finally { reporter.pop(); } + reporter.push('triggerCharacters'); + try { + final triggerCharacters = obj['triggerCharacters']; + if (triggerCharacters != null && + !((triggerCharacters is List && + (triggerCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneProgress'); try { final workDoneProgress = obj['workDoneProgress']; @@ -37556,9 +37556,9 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { bool operator ==(Object other) { if (other is SignatureHelpOptions && other.runtimeType == SignatureHelpOptions) { - return listEqual(triggerCharacters, other.triggerCharacters, + return listEqual(retriggerCharacters, other.retriggerCharacters, (String a, String b) => a == b) && - listEqual(retriggerCharacters, other.retriggerCharacters, + listEqual(triggerCharacters, other.triggerCharacters, (String a, String b) => a == b) && workDoneProgress == other.workDoneProgress && true; @@ -37568,8 +37568,8 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { @override int get hashCode => Object.hash( - lspHashCode(triggerCharacters), lspHashCode(retriggerCharacters), + lspHashCode(triggerCharacters), workDoneProgress, ); @@ -37586,8 +37586,8 @@ class SignatureHelpParams SignatureHelpParams({ this.context, - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static SignatureHelpParams fromJson(Map json) { @@ -37595,11 +37595,11 @@ class SignatureHelpParams final context = contextJson != null ? SignatureHelpContext.fromJson(contextJson as Map) : null; + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -37610,8 +37610,8 @@ class SignatureHelpParams : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return SignatureHelpParams( context: context, - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -37636,8 +37636,8 @@ class SignatureHelpParams if (context != null) { __result['context'] = context?.toJson(); } - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -37657,24 +37657,6 @@ class SignatureHelpParams } finally { reporter.pop(); } - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -37693,6 +37675,24 @@ class SignatureHelpParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -37716,8 +37716,8 @@ class SignatureHelpParams if (other is SignatureHelpParams && other.runtimeType == SignatureHelpParams) { return context == other.context && - textDocument == other.textDocument && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -37727,8 +37727,8 @@ class SignatureHelpParams @override int get hashCode => Object.hash( context, - textDocument, position, + textDocument, workDoneToken, ); @@ -37748,8 +37748,8 @@ class SignatureHelpRegistrationOptions SignatureHelpRegistrationOptions({ this.documentSelector, - this.triggerCharacters, this.retriggerCharacters, + this.triggerCharacters, this.workDoneProgress, }); static SignatureHelpRegistrationOptions fromJson(Map json) { @@ -37757,20 +37757,20 @@ class SignatureHelpRegistrationOptions final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final triggerCharactersJson = json['triggerCharacters']; - final triggerCharacters = (triggerCharactersJson as List?) - ?.map((item) => item as String) - .toList(); final retriggerCharactersJson = json['retriggerCharacters']; final retriggerCharacters = (retriggerCharactersJson as List?) ?.map((item) => item as String) .toList(); + final triggerCharactersJson = json['triggerCharacters']; + final triggerCharacters = (triggerCharactersJson as List?) + ?.map((item) => item as String) + .toList(); final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return SignatureHelpRegistrationOptions( documentSelector: documentSelector, - triggerCharacters: triggerCharacters, retriggerCharacters: retriggerCharacters, + triggerCharacters: triggerCharacters, workDoneProgress: workDoneProgress, ); } @@ -37793,12 +37793,12 @@ class SignatureHelpRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (triggerCharacters != null) { - __result['triggerCharacters'] = triggerCharacters; - } if (retriggerCharacters != null) { __result['retriggerCharacters'] = retriggerCharacters; } + if (triggerCharacters != null) { + __result['triggerCharacters'] = triggerCharacters; + } if (workDoneProgress != null) { __result['workDoneProgress'] = workDoneProgress; } @@ -37824,18 +37824,6 @@ class SignatureHelpRegistrationOptions } finally { reporter.pop(); } - reporter.push('triggerCharacters'); - try { - final triggerCharacters = obj['triggerCharacters']; - if (triggerCharacters != null && - !((triggerCharacters is List && - (triggerCharacters.every((item) => item is String))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('retriggerCharacters'); try { final retriggerCharacters = obj['retriggerCharacters']; @@ -37848,6 +37836,18 @@ class SignatureHelpRegistrationOptions } finally { reporter.pop(); } + reporter.push('triggerCharacters'); + try { + final triggerCharacters = obj['triggerCharacters']; + if (triggerCharacters != null && + !((triggerCharacters is List && + (triggerCharacters.every((item) => item is String))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneProgress'); try { final workDoneProgress = obj['workDoneProgress']; @@ -37871,10 +37871,10 @@ class SignatureHelpRegistrationOptions other.runtimeType == SignatureHelpRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - listEqual(triggerCharacters, other.triggerCharacters, - (String a, String b) => a == b) && listEqual(retriggerCharacters, other.retriggerCharacters, (String a, String b) => a == b) && + listEqual(triggerCharacters, other.triggerCharacters, + (String a, String b) => a == b) && workDoneProgress == other.workDoneProgress && true; } @@ -37884,8 +37884,8 @@ class SignatureHelpRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - lspHashCode(triggerCharacters), lspHashCode(retriggerCharacters), + lspHashCode(triggerCharacters), workDoneProgress, ); @@ -37936,14 +37936,14 @@ class SignatureInformation implements ToJsonable { ); SignatureInformation({ - required this.label, - this.documentation, - this.parameters, this.activeParameter, + this.documentation, + required this.label, + this.parameters, }); static SignatureInformation fromJson(Map json) { - final labelJson = json['label']; - final label = labelJson as String; + final activeParameterJson = json['activeParameter']; + final activeParameter = activeParameterJson as int?; final documentationJson = json['documentation']; final documentation = documentationJson == null ? null @@ -37953,18 +37953,18 @@ class SignatureInformation implements ToJsonable { : (documentationJson is String ? Either2.t2(documentationJson) : (throw '''$documentationJson was not one of (MarkupContent, String)'''))); + final labelJson = json['label']; + final label = labelJson as String; final parametersJson = json['parameters']; final parameters = (parametersJson as List?) ?.map((item) => ParameterInformation.fromJson(item as Map)) .toList(); - final activeParameterJson = json['activeParameter']; - final activeParameter = activeParameterJson as int?; return SignatureInformation( - label: label, - documentation: documentation, - parameters: parameters, activeParameter: activeParameter, + documentation: documentation, + label: label, + parameters: parameters, ); } @@ -37986,35 +37986,27 @@ class SignatureInformation implements ToJsonable { Map toJson() { var __result = {}; - __result['label'] = label; + if (activeParameter != null) { + __result['activeParameter'] = activeParameter; + } if (documentation != null) { __result['documentation'] = documentation; } + __result['label'] = label; if (parameters != null) { __result['parameters'] = parameters?.map((item) => item.toJson()).toList(); } - if (activeParameter != null) { - __result['activeParameter'] = activeParameter; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('label'); + reporter.push('activeParameter'); try { - if (!obj.containsKey('label')) { - reporter.reportError('must not be undefined'); - return false; - } - final label = obj['label']; - if (label == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(label is String)) { - reporter.reportError('must be of type String'); + final activeParameter = obj['activeParameter']; + if (activeParameter != null && !(activeParameter is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -38033,6 +38025,24 @@ class SignatureInformation implements ToJsonable { } finally { reporter.pop(); } + reporter.push('label'); + try { + if (!obj.containsKey('label')) { + reporter.reportError('must not be undefined'); + return false; + } + final label = obj['label']; + if (label == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(label is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('parameters'); try { final parameters = obj['parameters']; @@ -38046,16 +38056,6 @@ class SignatureInformation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('activeParameter'); - try { - final activeParameter = obj['activeParameter']; - if (activeParameter != null && !(activeParameter is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type SignatureInformation'); @@ -38067,11 +38067,11 @@ class SignatureInformation implements ToJsonable { bool operator ==(Object other) { if (other is SignatureInformation && other.runtimeType == SignatureInformation) { - return label == other.label && + return activeParameter == other.activeParameter && documentation == other.documentation && + label == other.label && listEqual(parameters, other.parameters, (ParameterInformation a, ParameterInformation b) => a == b) && - activeParameter == other.activeParameter && true; } return false; @@ -38079,10 +38079,10 @@ class SignatureInformation implements ToJsonable { @override int get hashCode => Object.hash( - label, - documentation, - lspHashCode(parameters), activeParameter, + documentation, + label, + lspHashCode(parameters), ); @override @@ -38208,35 +38208,35 @@ class SymbolInformation implements ToJsonable { ); SymbolInformation({ - required this.name, - required this.kind, - this.tags, - this.deprecated, - required this.location, this.containerName, + this.deprecated, + required this.kind, + required this.location, + required this.name, + this.tags, }); static SymbolInformation fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; + final containerNameJson = json['containerName']; + final containerName = containerNameJson as String?; + final deprecatedJson = json['deprecated']; + final deprecated = deprecatedJson as bool?; final kindJson = json['kind']; final kind = SymbolKind.fromJson(kindJson as int); + final locationJson = json['location']; + final location = Location.fromJson(locationJson as Map); + final nameJson = json['name']; + final name = nameJson as String; final tagsJson = json['tags']; final tags = (tagsJson as List?) ?.map((item) => SymbolTag.fromJson(item as int)) .toList(); - final deprecatedJson = json['deprecated']; - final deprecated = deprecatedJson as bool?; - final locationJson = json['location']; - final location = Location.fromJson(locationJson as Map); - final containerNameJson = json['containerName']; - final containerName = containerNameJson as String?; return SymbolInformation( - name: name, - kind: kind, - tags: tags, - deprecated: deprecated, - location: location, containerName: containerName, + deprecated: deprecated, + kind: kind, + location: location, + name: name, + tags: tags, ); } @@ -38273,41 +38273,43 @@ class SymbolInformation implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; - __result['kind'] = kind.toJson(); - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); + if (containerName != null) { + __result['containerName'] = containerName; } if (deprecated != null) { __result['deprecated'] = deprecated; } + __result['kind'] = kind.toJson(); __result['location'] = location.toJson(); - if (containerName != null) { - __result['containerName'] = containerName; + __result['name'] = name; + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); + reporter.push('containerName'); try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); - return false; - } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { + final containerName = obj['containerName']; + if (containerName != null && !(containerName is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } + reporter.push('deprecated'); + try { + final deprecated = obj['deprecated']; + if (deprecated != null && !(deprecated is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -38326,28 +38328,6 @@ class SymbolInformation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); - try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('deprecated'); - try { - final deprecated = obj['deprecated']; - if (deprecated != null && !(deprecated is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('location'); try { if (!obj.containsKey('location')) { @@ -38366,16 +38346,36 @@ class SymbolInformation implements ToJsonable { } finally { reporter.pop(); } - reporter.push('containerName'); + reporter.push('name'); try { - final containerName = obj['containerName']; - if (containerName != null && !(containerName is String)) { + if (!obj.containsKey('name')) { + reporter.reportError('must not be undefined'); + return false; + } + final name = obj['name']; + if (name == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(name is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type SymbolInformation'); @@ -38386,12 +38386,12 @@ class SymbolInformation implements ToJsonable { @override bool operator ==(Object other) { if (other is SymbolInformation && other.runtimeType == SymbolInformation) { - return name == other.name && - kind == other.kind && - listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + return containerName == other.containerName && deprecated == other.deprecated && + kind == other.kind && location == other.location && - containerName == other.containerName && + name == other.name && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && true; } return false; @@ -38399,12 +38399,12 @@ class SymbolInformation implements ToJsonable { @override int get hashCode => Object.hash( - name, - kind, - lspHashCode(tags), - deprecated, - location, containerName, + deprecated, + kind, + location, + name, + lspHashCode(tags), ); @override @@ -38496,20 +38496,20 @@ class TextDocumentChangeRegistrationOptions ); TextDocumentChangeRegistrationOptions({ - required this.syncKind, this.documentSelector, + required this.syncKind, }); static TextDocumentChangeRegistrationOptions fromJson( Map json) { - final syncKindJson = json['syncKind']; - final syncKind = TextDocumentSyncKind.fromJson(syncKindJson as int); final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); + final syncKindJson = json['syncKind']; + final syncKind = TextDocumentSyncKind.fromJson(syncKindJson as int); return TextDocumentChangeRegistrationOptions( - syncKind: syncKind, documentSelector: documentSelector, + syncKind: syncKind, ); } @@ -38523,13 +38523,30 @@ class TextDocumentChangeRegistrationOptions Map toJson() { var __result = {}; - __result['syncKind'] = syncKind.toJson(); __result['documentSelector'] = documentSelector; + __result['syncKind'] = syncKind.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('documentSelector'); + try { + if (!obj.containsKey('documentSelector')) { + reporter.reportError('must not be undefined'); + return false; + } + final documentSelector = obj['documentSelector']; + if (documentSelector != null && + !((documentSelector is List && + (documentSelector.every( + (item) => DocumentFilter.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('syncKind'); try { if (!obj.containsKey('syncKind')) { @@ -38548,23 +38565,6 @@ class TextDocumentChangeRegistrationOptions } finally { reporter.pop(); } - reporter.push('documentSelector'); - try { - if (!obj.containsKey('documentSelector')) { - reporter.reportError('must not be undefined'); - return false; - } - final documentSelector = obj['documentSelector']; - if (documentSelector != null && - !((documentSelector is List && - (documentSelector.every( - (item) => DocumentFilter.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter @@ -38577,9 +38577,9 @@ class TextDocumentChangeRegistrationOptions bool operator ==(Object other) { if (other is TextDocumentChangeRegistrationOptions && other.runtimeType == TextDocumentChangeRegistrationOptions) { - return syncKind == other.syncKind && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && + syncKind == other.syncKind && true; } return false; @@ -38587,8 +38587,8 @@ class TextDocumentChangeRegistrationOptions @override int get hashCode => Object.hash( - syncKind, lspHashCode(documentSelector), + syncKind, ); @override @@ -38603,91 +38603,42 @@ class TextDocumentClientCapabilities implements ToJsonable { ); TextDocumentClientCapabilities({ - this.synchronization, - this.completion, - this.hover, - this.signatureHelp, - this.declaration, - this.definition, - this.typeDefinition, - this.implementation, - this.references, - this.documentHighlight, - this.documentSymbol, + this.callHierarchy, this.codeAction, this.codeLens, - this.documentLink, this.colorProvider, - this.formatting, - this.rangeFormatting, - this.onTypeFormatting, - this.rename, - this.publishDiagnostics, - this.foldingRange, - this.selectionRange, - this.linkedEditingRange, - this.callHierarchy, - this.semanticTokens, - this.moniker, - this.typeHierarchy, - this.inlineValue, - this.inlayHint, + this.completion, + this.declaration, + this.definition, this.diagnostic, + this.documentHighlight, + this.documentLink, + this.documentSymbol, + this.foldingRange, + this.formatting, + this.hover, + this.implementation, + this.inlayHint, + this.inlineValue, + this.linkedEditingRange, + this.moniker, + this.onTypeFormatting, + this.publishDiagnostics, + this.rangeFormatting, + this.references, + this.rename, + this.selectionRange, + this.semanticTokens, + this.signatureHelp, + this.synchronization, + this.typeDefinition, + this.typeHierarchy, }); static TextDocumentClientCapabilities fromJson(Map json) { - final synchronizationJson = json['synchronization']; - final synchronization = synchronizationJson != null - ? TextDocumentSyncClientCapabilities.fromJson( - synchronizationJson as Map) - : null; - final completionJson = json['completion']; - final completion = completionJson != null - ? CompletionClientCapabilities.fromJson( - completionJson as Map) - : null; - final hoverJson = json['hover']; - final hover = hoverJson != null - ? HoverClientCapabilities.fromJson(hoverJson as Map) - : null; - final signatureHelpJson = json['signatureHelp']; - final signatureHelp = signatureHelpJson != null - ? SignatureHelpClientCapabilities.fromJson( - signatureHelpJson as Map) - : null; - final declarationJson = json['declaration']; - final declaration = declarationJson != null - ? DeclarationClientCapabilities.fromJson( - declarationJson as Map) - : null; - final definitionJson = json['definition']; - final definition = definitionJson != null - ? DefinitionClientCapabilities.fromJson( - definitionJson as Map) - : null; - final typeDefinitionJson = json['typeDefinition']; - final typeDefinition = typeDefinitionJson != null - ? TypeDefinitionClientCapabilities.fromJson( - typeDefinitionJson as Map) - : null; - final implementationJson = json['implementation']; - final implementation = implementationJson != null - ? ImplementationClientCapabilities.fromJson( - implementationJson as Map) - : null; - final referencesJson = json['references']; - final references = referencesJson != null - ? ReferenceClientCapabilities.fromJson( - referencesJson as Map) - : null; - final documentHighlightJson = json['documentHighlight']; - final documentHighlight = documentHighlightJson != null - ? DocumentHighlightClientCapabilities.fromJson( - documentHighlightJson as Map) - : null; - final documentSymbolJson = json['documentSymbol']; - final documentSymbol = documentSymbolJson != null - ? DocumentSymbolClientCapabilities.fromJson( - documentSymbolJson as Map) + final callHierarchyJson = json['callHierarchy']; + final callHierarchy = callHierarchyJson != null + ? CallHierarchyClientCapabilities.fromJson( + callHierarchyJson as Map) : null; final codeActionJson = json['codeAction']; final codeAction = codeActionJson != null @@ -38699,121 +38650,170 @@ class TextDocumentClientCapabilities implements ToJsonable { ? CodeLensClientCapabilities.fromJson( codeLensJson as Map) : null; - final documentLinkJson = json['documentLink']; - final documentLink = documentLinkJson != null - ? DocumentLinkClientCapabilities.fromJson( - documentLinkJson as Map) - : null; final colorProviderJson = json['colorProvider']; final colorProvider = colorProviderJson != null ? DocumentColorClientCapabilities.fromJson( colorProviderJson as Map) : null; - final formattingJson = json['formatting']; - final formatting = formattingJson != null - ? DocumentFormattingClientCapabilities.fromJson( - formattingJson as Map) + final completionJson = json['completion']; + final completion = completionJson != null + ? CompletionClientCapabilities.fromJson( + completionJson as Map) : null; - final rangeFormattingJson = json['rangeFormatting']; - final rangeFormatting = rangeFormattingJson != null - ? DocumentRangeFormattingClientCapabilities.fromJson( - rangeFormattingJson as Map) + final declarationJson = json['declaration']; + final declaration = declarationJson != null + ? DeclarationClientCapabilities.fromJson( + declarationJson as Map) : null; - final onTypeFormattingJson = json['onTypeFormatting']; - final onTypeFormatting = onTypeFormattingJson != null - ? DocumentOnTypeFormattingClientCapabilities.fromJson( - onTypeFormattingJson as Map) - : null; - final renameJson = json['rename']; - final rename = renameJson != null - ? RenameClientCapabilities.fromJson(renameJson as Map) - : null; - final publishDiagnosticsJson = json['publishDiagnostics']; - final publishDiagnostics = publishDiagnosticsJson != null - ? PublishDiagnosticsClientCapabilities.fromJson( - publishDiagnosticsJson as Map) - : null; - final foldingRangeJson = json['foldingRange']; - final foldingRange = foldingRangeJson != null - ? FoldingRangeClientCapabilities.fromJson( - foldingRangeJson as Map) - : null; - final selectionRangeJson = json['selectionRange']; - final selectionRange = selectionRangeJson != null - ? SelectionRangeClientCapabilities.fromJson( - selectionRangeJson as Map) - : null; - final linkedEditingRangeJson = json['linkedEditingRange']; - final linkedEditingRange = linkedEditingRangeJson != null - ? LinkedEditingRangeClientCapabilities.fromJson( - linkedEditingRangeJson as Map) - : null; - final callHierarchyJson = json['callHierarchy']; - final callHierarchy = callHierarchyJson != null - ? CallHierarchyClientCapabilities.fromJson( - callHierarchyJson as Map) - : null; - final semanticTokensJson = json['semanticTokens']; - final semanticTokens = semanticTokensJson != null - ? SemanticTokensClientCapabilities.fromJson( - semanticTokensJson as Map) - : null; - final monikerJson = json['moniker']; - final moniker = monikerJson != null - ? MonikerClientCapabilities.fromJson( - monikerJson as Map) - : null; - final typeHierarchyJson = json['typeHierarchy']; - final typeHierarchy = typeHierarchyJson != null - ? TypeHierarchyClientCapabilities1.fromJson( - typeHierarchyJson as Map) - : null; - final inlineValueJson = json['inlineValue']; - final inlineValue = inlineValueJson != null - ? InlineValueClientCapabilities.fromJson( - inlineValueJson as Map) - : null; - final inlayHintJson = json['inlayHint']; - final inlayHint = inlayHintJson != null - ? InlayHintClientCapabilities.fromJson( - inlayHintJson as Map) + final definitionJson = json['definition']; + final definition = definitionJson != null + ? DefinitionClientCapabilities.fromJson( + definitionJson as Map) : null; final diagnosticJson = json['diagnostic']; final diagnostic = diagnosticJson != null ? DiagnosticClientCapabilities.fromJson( diagnosticJson as Map) : null; + final documentHighlightJson = json['documentHighlight']; + final documentHighlight = documentHighlightJson != null + ? DocumentHighlightClientCapabilities.fromJson( + documentHighlightJson as Map) + : null; + final documentLinkJson = json['documentLink']; + final documentLink = documentLinkJson != null + ? DocumentLinkClientCapabilities.fromJson( + documentLinkJson as Map) + : null; + final documentSymbolJson = json['documentSymbol']; + final documentSymbol = documentSymbolJson != null + ? DocumentSymbolClientCapabilities.fromJson( + documentSymbolJson as Map) + : null; + final foldingRangeJson = json['foldingRange']; + final foldingRange = foldingRangeJson != null + ? FoldingRangeClientCapabilities.fromJson( + foldingRangeJson as Map) + : null; + final formattingJson = json['formatting']; + final formatting = formattingJson != null + ? DocumentFormattingClientCapabilities.fromJson( + formattingJson as Map) + : null; + final hoverJson = json['hover']; + final hover = hoverJson != null + ? HoverClientCapabilities.fromJson(hoverJson as Map) + : null; + final implementationJson = json['implementation']; + final implementation = implementationJson != null + ? ImplementationClientCapabilities.fromJson( + implementationJson as Map) + : null; + final inlayHintJson = json['inlayHint']; + final inlayHint = inlayHintJson != null + ? InlayHintClientCapabilities.fromJson( + inlayHintJson as Map) + : null; + final inlineValueJson = json['inlineValue']; + final inlineValue = inlineValueJson != null + ? InlineValueClientCapabilities.fromJson( + inlineValueJson as Map) + : null; + final linkedEditingRangeJson = json['linkedEditingRange']; + final linkedEditingRange = linkedEditingRangeJson != null + ? LinkedEditingRangeClientCapabilities.fromJson( + linkedEditingRangeJson as Map) + : null; + final monikerJson = json['moniker']; + final moniker = monikerJson != null + ? MonikerClientCapabilities.fromJson( + monikerJson as Map) + : null; + final onTypeFormattingJson = json['onTypeFormatting']; + final onTypeFormatting = onTypeFormattingJson != null + ? DocumentOnTypeFormattingClientCapabilities.fromJson( + onTypeFormattingJson as Map) + : null; + final publishDiagnosticsJson = json['publishDiagnostics']; + final publishDiagnostics = publishDiagnosticsJson != null + ? PublishDiagnosticsClientCapabilities.fromJson( + publishDiagnosticsJson as Map) + : null; + final rangeFormattingJson = json['rangeFormatting']; + final rangeFormatting = rangeFormattingJson != null + ? DocumentRangeFormattingClientCapabilities.fromJson( + rangeFormattingJson as Map) + : null; + final referencesJson = json['references']; + final references = referencesJson != null + ? ReferenceClientCapabilities.fromJson( + referencesJson as Map) + : null; + final renameJson = json['rename']; + final rename = renameJson != null + ? RenameClientCapabilities.fromJson(renameJson as Map) + : null; + final selectionRangeJson = json['selectionRange']; + final selectionRange = selectionRangeJson != null + ? SelectionRangeClientCapabilities.fromJson( + selectionRangeJson as Map) + : null; + final semanticTokensJson = json['semanticTokens']; + final semanticTokens = semanticTokensJson != null + ? SemanticTokensClientCapabilities.fromJson( + semanticTokensJson as Map) + : null; + final signatureHelpJson = json['signatureHelp']; + final signatureHelp = signatureHelpJson != null + ? SignatureHelpClientCapabilities.fromJson( + signatureHelpJson as Map) + : null; + final synchronizationJson = json['synchronization']; + final synchronization = synchronizationJson != null + ? TextDocumentSyncClientCapabilities.fromJson( + synchronizationJson as Map) + : null; + final typeDefinitionJson = json['typeDefinition']; + final typeDefinition = typeDefinitionJson != null + ? TypeDefinitionClientCapabilities.fromJson( + typeDefinitionJson as Map) + : null; + final typeHierarchyJson = json['typeHierarchy']; + final typeHierarchy = typeHierarchyJson != null + ? TypeHierarchyClientCapabilities1.fromJson( + typeHierarchyJson as Map) + : null; return TextDocumentClientCapabilities( - synchronization: synchronization, - completion: completion, - hover: hover, - signatureHelp: signatureHelp, - declaration: declaration, - definition: definition, - typeDefinition: typeDefinition, - implementation: implementation, - references: references, - documentHighlight: documentHighlight, - documentSymbol: documentSymbol, + callHierarchy: callHierarchy, codeAction: codeAction, codeLens: codeLens, - documentLink: documentLink, colorProvider: colorProvider, - formatting: formatting, - rangeFormatting: rangeFormatting, - onTypeFormatting: onTypeFormatting, - rename: rename, - publishDiagnostics: publishDiagnostics, - foldingRange: foldingRange, - selectionRange: selectionRange, - linkedEditingRange: linkedEditingRange, - callHierarchy: callHierarchy, - semanticTokens: semanticTokens, - moniker: moniker, - typeHierarchy: typeHierarchy, - inlineValue: inlineValue, - inlayHint: inlayHint, + completion: completion, + declaration: declaration, + definition: definition, diagnostic: diagnostic, + documentHighlight: documentHighlight, + documentLink: documentLink, + documentSymbol: documentSymbol, + foldingRange: foldingRange, + formatting: formatting, + hover: hover, + implementation: implementation, + inlayHint: inlayHint, + inlineValue: inlineValue, + linkedEditingRange: linkedEditingRange, + moniker: moniker, + onTypeFormatting: onTypeFormatting, + publishDiagnostics: publishDiagnostics, + rangeFormatting: rangeFormatting, + references: references, + rename: rename, + selectionRange: selectionRange, + semanticTokens: semanticTokens, + signatureHelp: signatureHelp, + synchronization: synchronization, + typeDefinition: typeDefinition, + typeHierarchy: typeHierarchy, ); } @@ -38924,38 +38924,8 @@ class TextDocumentClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (synchronization != null) { - __result['synchronization'] = synchronization?.toJson(); - } - if (completion != null) { - __result['completion'] = completion?.toJson(); - } - if (hover != null) { - __result['hover'] = hover?.toJson(); - } - if (signatureHelp != null) { - __result['signatureHelp'] = signatureHelp?.toJson(); - } - if (declaration != null) { - __result['declaration'] = declaration?.toJson(); - } - if (definition != null) { - __result['definition'] = definition?.toJson(); - } - if (typeDefinition != null) { - __result['typeDefinition'] = typeDefinition?.toJson(); - } - if (implementation != null) { - __result['implementation'] = implementation?.toJson(); - } - if (references != null) { - __result['references'] = references?.toJson(); - } - if (documentHighlight != null) { - __result['documentHighlight'] = documentHighlight?.toJson(); - } - if (documentSymbol != null) { - __result['documentSymbol'] = documentSymbol?.toJson(); + if (callHierarchy != null) { + __result['callHierarchy'] = callHierarchy?.toJson(); } if (codeAction != null) { __result['codeAction'] = codeAction?.toJson(); @@ -38963,190 +38933,100 @@ class TextDocumentClientCapabilities implements ToJsonable { if (codeLens != null) { __result['codeLens'] = codeLens?.toJson(); } - if (documentLink != null) { - __result['documentLink'] = documentLink?.toJson(); - } if (colorProvider != null) { __result['colorProvider'] = colorProvider?.toJson(); } - if (formatting != null) { - __result['formatting'] = formatting?.toJson(); + if (completion != null) { + __result['completion'] = completion?.toJson(); } - if (rangeFormatting != null) { - __result['rangeFormatting'] = rangeFormatting?.toJson(); + if (declaration != null) { + __result['declaration'] = declaration?.toJson(); } - if (onTypeFormatting != null) { - __result['onTypeFormatting'] = onTypeFormatting?.toJson(); + if (definition != null) { + __result['definition'] = definition?.toJson(); } - if (rename != null) { - __result['rename'] = rename?.toJson(); + if (diagnostic != null) { + __result['diagnostic'] = diagnostic?.toJson(); } - if (publishDiagnostics != null) { - __result['publishDiagnostics'] = publishDiagnostics?.toJson(); + if (documentHighlight != null) { + __result['documentHighlight'] = documentHighlight?.toJson(); + } + if (documentLink != null) { + __result['documentLink'] = documentLink?.toJson(); + } + if (documentSymbol != null) { + __result['documentSymbol'] = documentSymbol?.toJson(); } if (foldingRange != null) { __result['foldingRange'] = foldingRange?.toJson(); } - if (selectionRange != null) { - __result['selectionRange'] = selectionRange?.toJson(); + if (formatting != null) { + __result['formatting'] = formatting?.toJson(); } - if (linkedEditingRange != null) { - __result['linkedEditingRange'] = linkedEditingRange?.toJson(); + if (hover != null) { + __result['hover'] = hover?.toJson(); } - if (callHierarchy != null) { - __result['callHierarchy'] = callHierarchy?.toJson(); - } - if (semanticTokens != null) { - __result['semanticTokens'] = semanticTokens?.toJson(); - } - if (moniker != null) { - __result['moniker'] = moniker?.toJson(); - } - if (typeHierarchy != null) { - __result['typeHierarchy'] = typeHierarchy; - } - if (inlineValue != null) { - __result['inlineValue'] = inlineValue?.toJson(); + if (implementation != null) { + __result['implementation'] = implementation?.toJson(); } if (inlayHint != null) { __result['inlayHint'] = inlayHint?.toJson(); } - if (diagnostic != null) { - __result['diagnostic'] = diagnostic?.toJson(); + if (inlineValue != null) { + __result['inlineValue'] = inlineValue?.toJson(); + } + if (linkedEditingRange != null) { + __result['linkedEditingRange'] = linkedEditingRange?.toJson(); + } + if (moniker != null) { + __result['moniker'] = moniker?.toJson(); + } + if (onTypeFormatting != null) { + __result['onTypeFormatting'] = onTypeFormatting?.toJson(); + } + if (publishDiagnostics != null) { + __result['publishDiagnostics'] = publishDiagnostics?.toJson(); + } + if (rangeFormatting != null) { + __result['rangeFormatting'] = rangeFormatting?.toJson(); + } + if (references != null) { + __result['references'] = references?.toJson(); + } + if (rename != null) { + __result['rename'] = rename?.toJson(); + } + if (selectionRange != null) { + __result['selectionRange'] = selectionRange?.toJson(); + } + if (semanticTokens != null) { + __result['semanticTokens'] = semanticTokens?.toJson(); + } + if (signatureHelp != null) { + __result['signatureHelp'] = signatureHelp?.toJson(); + } + if (synchronization != null) { + __result['synchronization'] = synchronization?.toJson(); + } + if (typeDefinition != null) { + __result['typeDefinition'] = typeDefinition?.toJson(); + } + if (typeHierarchy != null) { + __result['typeHierarchy'] = typeHierarchy; } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('synchronization'); + reporter.push('callHierarchy'); try { - final synchronization = obj['synchronization']; - if (synchronization != null && - !(TextDocumentSyncClientCapabilities.canParse( - synchronization, reporter))) { - reporter.reportError( - 'must be of type TextDocumentSyncClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('completion'); - try { - final completion = obj['completion']; - if (completion != null && - !(CompletionClientCapabilities.canParse(completion, reporter))) { - reporter.reportError('must be of type CompletionClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('hover'); - try { - final hover = obj['hover']; - if (hover != null && - !(HoverClientCapabilities.canParse(hover, reporter))) { - reporter.reportError('must be of type HoverClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('signatureHelp'); - try { - final signatureHelp = obj['signatureHelp']; - if (signatureHelp != null && - !(SignatureHelpClientCapabilities.canParse( - signatureHelp, reporter))) { + final callHierarchy = obj['callHierarchy']; + if (callHierarchy != null && + !(CallHierarchyClientCapabilities.canParse( + callHierarchy, reporter))) { reporter - .reportError('must be of type SignatureHelpClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('declaration'); - try { - final declaration = obj['declaration']; - if (declaration != null && - !(DeclarationClientCapabilities.canParse(declaration, reporter))) { - reporter.reportError('must be of type DeclarationClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('definition'); - try { - final definition = obj['definition']; - if (definition != null && - !(DefinitionClientCapabilities.canParse(definition, reporter))) { - reporter.reportError('must be of type DefinitionClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('typeDefinition'); - try { - final typeDefinition = obj['typeDefinition']; - if (typeDefinition != null && - !(TypeDefinitionClientCapabilities.canParse( - typeDefinition, reporter))) { - reporter - .reportError('must be of type TypeDefinitionClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('implementation'); - try { - final implementation = obj['implementation']; - if (implementation != null && - !(ImplementationClientCapabilities.canParse( - implementation, reporter))) { - reporter - .reportError('must be of type ImplementationClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('references'); - try { - final references = obj['references']; - if (references != null && - !(ReferenceClientCapabilities.canParse(references, reporter))) { - reporter.reportError('must be of type ReferenceClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentHighlight'); - try { - final documentHighlight = obj['documentHighlight']; - if (documentHighlight != null && - !(DocumentHighlightClientCapabilities.canParse( - documentHighlight, reporter))) { - reporter.reportError( - 'must be of type DocumentHighlightClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('documentSymbol'); - try { - final documentSymbol = obj['documentSymbol']; - if (documentSymbol != null && - !(DocumentSymbolClientCapabilities.canParse( - documentSymbol, reporter))) { - reporter - .reportError('must be of type DocumentSymbolClientCapabilities'); + .reportError('must be of type CallHierarchyClientCapabilities'); return false; } } finally { @@ -39174,19 +39054,6 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('documentLink'); - try { - final documentLink = obj['documentLink']; - if (documentLink != null && - !(DocumentLinkClientCapabilities.canParse( - documentLink, reporter))) { - reporter - .reportError('must be of type DocumentLinkClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('colorProvider'); try { final colorProvider = obj['colorProvider']; @@ -39200,64 +39067,84 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('formatting'); + reporter.push('completion'); try { - final formatting = obj['formatting']; - if (formatting != null && - !(DocumentFormattingClientCapabilities.canParse( - formatting, reporter))) { - reporter.reportError( - 'must be of type DocumentFormattingClientCapabilities'); + final completion = obj['completion']; + if (completion != null && + !(CompletionClientCapabilities.canParse(completion, reporter))) { + reporter.reportError('must be of type CompletionClientCapabilities'); return false; } } finally { reporter.pop(); } - reporter.push('rangeFormatting'); + reporter.push('declaration'); try { - final rangeFormatting = obj['rangeFormatting']; - if (rangeFormatting != null && - !(DocumentRangeFormattingClientCapabilities.canParse( - rangeFormatting, reporter))) { - reporter.reportError( - 'must be of type DocumentRangeFormattingClientCapabilities'); + final declaration = obj['declaration']; + if (declaration != null && + !(DeclarationClientCapabilities.canParse(declaration, reporter))) { + reporter.reportError('must be of type DeclarationClientCapabilities'); return false; } } finally { reporter.pop(); } - reporter.push('onTypeFormatting'); + reporter.push('definition'); try { - final onTypeFormatting = obj['onTypeFormatting']; - if (onTypeFormatting != null && - !(DocumentOnTypeFormattingClientCapabilities.canParse( - onTypeFormatting, reporter))) { - reporter.reportError( - 'must be of type DocumentOnTypeFormattingClientCapabilities'); + final definition = obj['definition']; + if (definition != null && + !(DefinitionClientCapabilities.canParse(definition, reporter))) { + reporter.reportError('must be of type DefinitionClientCapabilities'); return false; } } finally { reporter.pop(); } - reporter.push('rename'); + reporter.push('diagnostic'); try { - final rename = obj['rename']; - if (rename != null && - !(RenameClientCapabilities.canParse(rename, reporter))) { - reporter.reportError('must be of type RenameClientCapabilities'); + final diagnostic = obj['diagnostic']; + if (diagnostic != null && + !(DiagnosticClientCapabilities.canParse(diagnostic, reporter))) { + reporter.reportError('must be of type DiagnosticClientCapabilities'); return false; } } finally { reporter.pop(); } - reporter.push('publishDiagnostics'); + reporter.push('documentHighlight'); try { - final publishDiagnostics = obj['publishDiagnostics']; - if (publishDiagnostics != null && - !(PublishDiagnosticsClientCapabilities.canParse( - publishDiagnostics, reporter))) { + final documentHighlight = obj['documentHighlight']; + if (documentHighlight != null && + !(DocumentHighlightClientCapabilities.canParse( + documentHighlight, reporter))) { reporter.reportError( - 'must be of type PublishDiagnosticsClientCapabilities'); + 'must be of type DocumentHighlightClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentLink'); + try { + final documentLink = obj['documentLink']; + if (documentLink != null && + !(DocumentLinkClientCapabilities.canParse( + documentLink, reporter))) { + reporter + .reportError('must be of type DocumentLinkClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('documentSymbol'); + try { + final documentSymbol = obj['documentSymbol']; + if (documentSymbol != null && + !(DocumentSymbolClientCapabilities.canParse( + documentSymbol, reporter))) { + reporter + .reportError('must be of type DocumentSymbolClientCapabilities'); return false; } } finally { @@ -39276,14 +39163,60 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('selectionRange'); + reporter.push('formatting'); try { - final selectionRange = obj['selectionRange']; - if (selectionRange != null && - !(SelectionRangeClientCapabilities.canParse( - selectionRange, reporter))) { + final formatting = obj['formatting']; + if (formatting != null && + !(DocumentFormattingClientCapabilities.canParse( + formatting, reporter))) { + reporter.reportError( + 'must be of type DocumentFormattingClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('hover'); + try { + final hover = obj['hover']; + if (hover != null && + !(HoverClientCapabilities.canParse(hover, reporter))) { + reporter.reportError('must be of type HoverClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('implementation'); + try { + final implementation = obj['implementation']; + if (implementation != null && + !(ImplementationClientCapabilities.canParse( + implementation, reporter))) { reporter - .reportError('must be of type SelectionRangeClientCapabilities'); + .reportError('must be of type ImplementationClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('inlayHint'); + try { + final inlayHint = obj['inlayHint']; + if (inlayHint != null && + !(InlayHintClientCapabilities.canParse(inlayHint, reporter))) { + reporter.reportError('must be of type InlayHintClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('inlineValue'); + try { + final inlineValue = obj['inlineValue']; + if (inlineValue != null && + !(InlineValueClientCapabilities.canParse(inlineValue, reporter))) { + reporter.reportError('must be of type InlineValueClientCapabilities'); return false; } } finally { @@ -39302,14 +39235,86 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('callHierarchy'); + reporter.push('moniker'); try { - final callHierarchy = obj['callHierarchy']; - if (callHierarchy != null && - !(CallHierarchyClientCapabilities.canParse( - callHierarchy, reporter))) { + final moniker = obj['moniker']; + if (moniker != null && + !(MonikerClientCapabilities.canParse(moniker, reporter))) { + reporter.reportError('must be of type MonikerClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('onTypeFormatting'); + try { + final onTypeFormatting = obj['onTypeFormatting']; + if (onTypeFormatting != null && + !(DocumentOnTypeFormattingClientCapabilities.canParse( + onTypeFormatting, reporter))) { + reporter.reportError( + 'must be of type DocumentOnTypeFormattingClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('publishDiagnostics'); + try { + final publishDiagnostics = obj['publishDiagnostics']; + if (publishDiagnostics != null && + !(PublishDiagnosticsClientCapabilities.canParse( + publishDiagnostics, reporter))) { + reporter.reportError( + 'must be of type PublishDiagnosticsClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('rangeFormatting'); + try { + final rangeFormatting = obj['rangeFormatting']; + if (rangeFormatting != null && + !(DocumentRangeFormattingClientCapabilities.canParse( + rangeFormatting, reporter))) { + reporter.reportError( + 'must be of type DocumentRangeFormattingClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('references'); + try { + final references = obj['references']; + if (references != null && + !(ReferenceClientCapabilities.canParse(references, reporter))) { + reporter.reportError('must be of type ReferenceClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('rename'); + try { + final rename = obj['rename']; + if (rename != null && + !(RenameClientCapabilities.canParse(rename, reporter))) { + reporter.reportError('must be of type RenameClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('selectionRange'); + try { + final selectionRange = obj['selectionRange']; + if (selectionRange != null && + !(SelectionRangeClientCapabilities.canParse( + selectionRange, reporter))) { reporter - .reportError('must be of type CallHierarchyClientCapabilities'); + .reportError('must be of type SelectionRangeClientCapabilities'); return false; } } finally { @@ -39328,12 +39333,40 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('moniker'); + reporter.push('signatureHelp'); try { - final moniker = obj['moniker']; - if (moniker != null && - !(MonikerClientCapabilities.canParse(moniker, reporter))) { - reporter.reportError('must be of type MonikerClientCapabilities'); + final signatureHelp = obj['signatureHelp']; + if (signatureHelp != null && + !(SignatureHelpClientCapabilities.canParse( + signatureHelp, reporter))) { + reporter + .reportError('must be of type SignatureHelpClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('synchronization'); + try { + final synchronization = obj['synchronization']; + if (synchronization != null && + !(TextDocumentSyncClientCapabilities.canParse( + synchronization, reporter))) { + reporter.reportError( + 'must be of type TextDocumentSyncClientCapabilities'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('typeDefinition'); + try { + final typeDefinition = obj['typeDefinition']; + if (typeDefinition != null && + !(TypeDefinitionClientCapabilities.canParse( + typeDefinition, reporter))) { + reporter + .reportError('must be of type TypeDefinitionClientCapabilities'); return false; } } finally { @@ -39352,39 +39385,6 @@ class TextDocumentClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('inlineValue'); - try { - final inlineValue = obj['inlineValue']; - if (inlineValue != null && - !(InlineValueClientCapabilities.canParse(inlineValue, reporter))) { - reporter.reportError('must be of type InlineValueClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('inlayHint'); - try { - final inlayHint = obj['inlayHint']; - if (inlayHint != null && - !(InlayHintClientCapabilities.canParse(inlayHint, reporter))) { - reporter.reportError('must be of type InlayHintClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('diagnostic'); - try { - final diagnostic = obj['diagnostic']; - if (diagnostic != null && - !(DiagnosticClientCapabilities.canParse(diagnostic, reporter))) { - reporter.reportError('must be of type DiagnosticClientCapabilities'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type TextDocumentClientCapabilities'); @@ -39396,36 +39396,36 @@ class TextDocumentClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is TextDocumentClientCapabilities && other.runtimeType == TextDocumentClientCapabilities) { - return synchronization == other.synchronization && - completion == other.completion && - hover == other.hover && - signatureHelp == other.signatureHelp && - declaration == other.declaration && - definition == other.definition && - typeDefinition == other.typeDefinition && - implementation == other.implementation && - references == other.references && - documentHighlight == other.documentHighlight && - documentSymbol == other.documentSymbol && + return callHierarchy == other.callHierarchy && codeAction == other.codeAction && codeLens == other.codeLens && - documentLink == other.documentLink && colorProvider == other.colorProvider && - formatting == other.formatting && - rangeFormatting == other.rangeFormatting && - onTypeFormatting == other.onTypeFormatting && - rename == other.rename && - publishDiagnostics == other.publishDiagnostics && - foldingRange == other.foldingRange && - selectionRange == other.selectionRange && - linkedEditingRange == other.linkedEditingRange && - callHierarchy == other.callHierarchy && - semanticTokens == other.semanticTokens && - moniker == other.moniker && - typeHierarchy == other.typeHierarchy && - inlineValue == other.inlineValue && - inlayHint == other.inlayHint && + completion == other.completion && + declaration == other.declaration && + definition == other.definition && diagnostic == other.diagnostic && + documentHighlight == other.documentHighlight && + documentLink == other.documentLink && + documentSymbol == other.documentSymbol && + foldingRange == other.foldingRange && + formatting == other.formatting && + hover == other.hover && + implementation == other.implementation && + inlayHint == other.inlayHint && + inlineValue == other.inlineValue && + linkedEditingRange == other.linkedEditingRange && + moniker == other.moniker && + onTypeFormatting == other.onTypeFormatting && + publishDiagnostics == other.publishDiagnostics && + rangeFormatting == other.rangeFormatting && + references == other.references && + rename == other.rename && + selectionRange == other.selectionRange && + semanticTokens == other.semanticTokens && + signatureHelp == other.signatureHelp && + synchronization == other.synchronization && + typeDefinition == other.typeDefinition && + typeHierarchy == other.typeHierarchy && true; } return false; @@ -39433,36 +39433,36 @@ class TextDocumentClientCapabilities implements ToJsonable { @override int get hashCode => Object.hashAll([ - synchronization, - completion, - hover, - signatureHelp, - declaration, - definition, - typeDefinition, - implementation, - references, - documentHighlight, - documentSymbol, + callHierarchy, codeAction, codeLens, - documentLink, colorProvider, - formatting, - rangeFormatting, - onTypeFormatting, - rename, - publishDiagnostics, - foldingRange, - selectionRange, - linkedEditingRange, - callHierarchy, - semanticTokens, - moniker, - typeHierarchy, - inlineValue, - inlayHint, + completion, + declaration, + definition, diagnostic, + documentHighlight, + documentLink, + documentSymbol, + foldingRange, + formatting, + hover, + implementation, + inlayHint, + inlineValue, + linkedEditingRange, + moniker, + onTypeFormatting, + publishDiagnostics, + rangeFormatting, + references, + rename, + selectionRange, + semanticTokens, + signatureHelp, + synchronization, + typeDefinition, + typeHierarchy, ]); @override @@ -39668,13 +39668,10 @@ class TextDocumentEdit implements ToJsonable { ); TextDocumentEdit({ - required this.textDocument, required this.edits, + required this.textDocument, }); static TextDocumentEdit fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = OptionalVersionedTextDocumentIdentifier.fromJson( - textDocumentJson as Map); final editsJson = json['edits']; final edits = (editsJson as List) .map((item) => AnnotatedTextEdit.canParse(item, nullLspJsonReporter) @@ -39688,9 +39685,12 @@ class TextDocumentEdit implements ToJsonable { TextEdit.fromJson(item as Map)) : (throw '''$item was not one of (AnnotatedTextEdit, SnippetTextEdit, TextEdit)''')))) .toList(); + final textDocumentJson = json['textDocument']; + final textDocument = OptionalVersionedTextDocumentIdentifier.fromJson( + textDocumentJson as Map); return TextDocumentEdit( - textDocument: textDocument, edits: edits, + textDocument: textDocument, ); } @@ -39704,33 +39704,13 @@ class TextDocumentEdit implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['edits'] = edits; + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(OptionalVersionedTextDocumentIdentifier.canParse( - textDocument, reporter))) { - reporter.reportError( - 'must be of type OptionalVersionedTextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('edits'); try { if (!obj.containsKey('edits')) { @@ -39754,6 +39734,26 @@ class TextDocumentEdit implements ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(OptionalVersionedTextDocumentIdentifier.canParse( + textDocument, reporter))) { + reporter.reportError( + 'must be of type OptionalVersionedTextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TextDocumentEdit'); @@ -39764,14 +39764,14 @@ class TextDocumentEdit implements ToJsonable { @override bool operator ==(Object other) { if (other is TextDocumentEdit && other.runtimeType == TextDocumentEdit) { - return textDocument == other.textDocument && - listEqual( + return listEqual( edits, other.edits, (Either3 a, Either3 b) => a == b) && + textDocument == other.textDocument && true; } return false; @@ -39779,8 +39779,8 @@ class TextDocumentEdit implements ToJsonable { @override int get hashCode => Object.hash( - textDocument, lspHashCode(edits), + textDocument, ); @override @@ -39870,25 +39870,25 @@ class TextDocumentItem implements ToJsonable { ); TextDocumentItem({ - required this.uri, required this.languageId, - required this.version, required this.text, + required this.uri, + required this.version, }); static TextDocumentItem fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final languageIdJson = json['languageId']; final languageId = languageIdJson as String; - final versionJson = json['version']; - final version = versionJson as int; final textJson = json['text']; final text = textJson as String; + final uriJson = json['uri']; + final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int; return TextDocumentItem( - uri: uri, languageId: languageId, - version: version, text: text, + uri: uri, + version: version, ); } @@ -39907,33 +39907,15 @@ class TextDocumentItem implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; __result['languageId'] = languageId; - __result['version'] = version; __result['text'] = text; + __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('languageId'); try { if (!obj.containsKey('languageId')) { @@ -39952,6 +39934,42 @@ class TextDocumentItem implements ToJsonable { } finally { reporter.pop(); } + reporter.push('text'); + try { + if (!obj.containsKey('text')) { + reporter.reportError('must not be undefined'); + return false; + } + final text = obj['text']; + if (text == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(text is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('version'); try { if (!obj.containsKey('version')) { @@ -39970,24 +39988,6 @@ class TextDocumentItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('text'); - try { - if (!obj.containsKey('text')) { - reporter.reportError('must not be undefined'); - return false; - } - final text = obj['text']; - if (text == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(text is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type TextDocumentItem'); @@ -39998,10 +39998,10 @@ class TextDocumentItem implements ToJsonable { @override bool operator ==(Object other) { if (other is TextDocumentItem && other.runtimeType == TextDocumentItem) { - return uri == other.uri && - languageId == other.languageId && - version == other.version && + return languageId == other.languageId && text == other.text && + uri == other.uri && + version == other.version && true; } return false; @@ -40009,10 +40009,10 @@ class TextDocumentItem implements ToJsonable { @override int get hashCode => Object.hash( - uri, languageId, - version, text, + uri, + version, ); @override @@ -40026,8 +40026,8 @@ class TextDocumentPositionParams implements ToJsonable { ); TextDocumentPositionParams({ - required this.textDocument, required this.position, + required this.textDocument, }); static TextDocumentPositionParams fromJson(Map json) { if (DeclarationParams.canParse(json, nullLspJsonReporter)) { @@ -40075,14 +40075,14 @@ class TextDocumentPositionParams implements ToJsonable { if (LinkedEditingRangeParams.canParse(json, nullLspJsonReporter)) { return LinkedEditingRangeParams.fromJson(json); } + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); return TextDocumentPositionParams( - textDocument: textDocument, position: position, + textDocument: textDocument, ); } @@ -40094,31 +40094,13 @@ class TextDocumentPositionParams implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -40137,6 +40119,24 @@ class TextDocumentPositionParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TextDocumentPositionParams'); @@ -40148,8 +40148,8 @@ class TextDocumentPositionParams implements ToJsonable { bool operator ==(Object other) { if (other is TextDocumentPositionParams && other.runtimeType == TextDocumentPositionParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && true; } return false; @@ -40157,8 +40157,8 @@ class TextDocumentPositionParams implements ToJsonable { @override int get hashCode => Object.hash( - textDocument, position, + textDocument, ); @override @@ -40377,20 +40377,20 @@ class TextDocumentSaveRegistrationOptions ); TextDocumentSaveRegistrationOptions({ - this.includeText, this.documentSelector, + this.includeText, }); static TextDocumentSaveRegistrationOptions fromJson( Map json) { - final includeTextJson = json['includeText']; - final includeText = includeTextJson as bool?; final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); + final includeTextJson = json['includeText']; + final includeText = includeTextJson as bool?; return TextDocumentSaveRegistrationOptions( - includeText: includeText, documentSelector: documentSelector, + includeText: includeText, ); } @@ -40403,25 +40403,15 @@ class TextDocumentSaveRegistrationOptions Map toJson() { var __result = {}; + __result['documentSelector'] = documentSelector; if (includeText != null) { __result['includeText'] = includeText; } - __result['documentSelector'] = documentSelector; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('includeText'); - try { - final includeText = obj['includeText']; - if (includeText != null && !(includeText is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('documentSelector'); try { if (!obj.containsKey('documentSelector')) { @@ -40439,6 +40429,16 @@ class TextDocumentSaveRegistrationOptions } finally { reporter.pop(); } + reporter.push('includeText'); + try { + final includeText = obj['includeText']; + if (includeText != null && !(includeText is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter @@ -40451,9 +40451,9 @@ class TextDocumentSaveRegistrationOptions bool operator ==(Object other) { if (other is TextDocumentSaveRegistrationOptions && other.runtimeType == TextDocumentSaveRegistrationOptions) { - return includeText == other.includeText && - listEqual(documentSelector, other.documentSelector, + return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && + includeText == other.includeText && true; } return false; @@ -40461,8 +40461,8 @@ class TextDocumentSaveRegistrationOptions @override int get hashCode => Object.hash( - includeText, lspHashCode(documentSelector), + includeText, ); @override @@ -40476,26 +40476,26 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { ); TextDocumentSyncClientCapabilities({ + this.didSave, this.dynamicRegistration, this.willSave, this.willSaveWaitUntil, - this.didSave, }); static TextDocumentSyncClientCapabilities fromJson( Map json) { + final didSaveJson = json['didSave']; + final didSave = didSaveJson as bool?; final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; final willSaveJson = json['willSave']; final willSave = willSaveJson as bool?; final willSaveWaitUntilJson = json['willSaveWaitUntil']; final willSaveWaitUntil = willSaveWaitUntilJson as bool?; - final didSaveJson = json['didSave']; - final didSave = didSaveJson as bool?; return TextDocumentSyncClientCapabilities( + didSave: didSave, dynamicRegistration: dynamicRegistration, willSave: willSave, willSaveWaitUntil: willSaveWaitUntil, - didSave: didSave, ); } @@ -40515,6 +40515,9 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; + if (didSave != null) { + __result['didSave'] = didSave; + } if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } @@ -40524,14 +40527,21 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { if (willSaveWaitUntil != null) { __result['willSaveWaitUntil'] = willSaveWaitUntil; } - if (didSave != null) { - __result['didSave'] = didSave; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('didSave'); + try { + final didSave = obj['didSave']; + if (didSave != null && !(didSave is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('dynamicRegistration'); try { final dynamicRegistration = obj['dynamicRegistration']; @@ -40562,16 +40572,6 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('didSave'); - try { - final didSave = obj['didSave']; - if (didSave != null && !(didSave is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter @@ -40584,10 +40584,10 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is TextDocumentSyncClientCapabilities && other.runtimeType == TextDocumentSyncClientCapabilities) { - return dynamicRegistration == other.dynamicRegistration && + return didSave == other.didSave && + dynamicRegistration == other.dynamicRegistration && willSave == other.willSave && willSaveWaitUntil == other.willSaveWaitUntil && - didSave == other.didSave && true; } return false; @@ -40595,10 +40595,10 @@ class TextDocumentSyncClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( + didSave, dynamicRegistration, willSave, willSaveWaitUntil, - didSave, ); @override @@ -40645,23 +40645,19 @@ class TextDocumentSyncOptions implements ToJsonable { ); TextDocumentSyncOptions({ - this.openClose, this.change, + this.openClose, + this.save, this.willSave, this.willSaveWaitUntil, - this.save, }); static TextDocumentSyncOptions fromJson(Map json) { - final openCloseJson = json['openClose']; - final openClose = openCloseJson as bool?; final changeJson = json['change']; final change = changeJson != null ? TextDocumentSyncKind.fromJson(changeJson as int) : null; - final willSaveJson = json['willSave']; - final willSave = willSaveJson as bool?; - final willSaveWaitUntilJson = json['willSaveWaitUntil']; - final willSaveWaitUntil = willSaveWaitUntilJson as bool?; + final openCloseJson = json['openClose']; + final openClose = openCloseJson as bool?; final saveJson = json['save']; final save = saveJson == null ? null @@ -40671,12 +40667,16 @@ class TextDocumentSyncOptions implements ToJsonable { ? Either2.t2( SaveOptions.fromJson(saveJson as Map)) : (throw '''$saveJson was not one of (bool, SaveOptions)'''))); + final willSaveJson = json['willSave']; + final willSave = willSaveJson as bool?; + final willSaveWaitUntilJson = json['willSaveWaitUntil']; + final willSaveWaitUntil = willSaveWaitUntilJson as bool?; return TextDocumentSyncOptions( - openClose: openClose, change: change, + openClose: openClose, + save: save, willSave: willSave, willSaveWaitUntil: willSaveWaitUntil, - save: save, ); } @@ -40704,11 +40704,14 @@ class TextDocumentSyncOptions implements ToJsonable { Map toJson() { var __result = {}; + if (change != null) { + __result['change'] = change?.toJson(); + } if (openClose != null) { __result['openClose'] = openClose; } - if (change != null) { - __result['change'] = change?.toJson(); + if (save != null) { + __result['save'] = save; } if (willSave != null) { __result['willSave'] = willSave; @@ -40716,14 +40719,22 @@ class TextDocumentSyncOptions implements ToJsonable { if (willSaveWaitUntil != null) { __result['willSaveWaitUntil'] = willSaveWaitUntil; } - if (save != null) { - __result['save'] = save; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('change'); + try { + final change = obj['change']; + if (change != null && + !(TextDocumentSyncKind.canParse(change, reporter))) { + reporter.reportError('must be of type TextDocumentSyncKind'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('openClose'); try { final openClose = obj['openClose']; @@ -40734,12 +40745,12 @@ class TextDocumentSyncOptions implements ToJsonable { } finally { reporter.pop(); } - reporter.push('change'); + reporter.push('save'); try { - final change = obj['change']; - if (change != null && - !(TextDocumentSyncKind.canParse(change, reporter))) { - reporter.reportError('must be of type TextDocumentSyncKind'); + final save = obj['save']; + if (save != null && + !((save is bool || SaveOptions.canParse(save, reporter)))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -40765,17 +40776,6 @@ class TextDocumentSyncOptions implements ToJsonable { } finally { reporter.pop(); } - reporter.push('save'); - try { - final save = obj['save']; - if (save != null && - !((save is bool || SaveOptions.canParse(save, reporter)))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type TextDocumentSyncOptions'); @@ -40787,11 +40787,11 @@ class TextDocumentSyncOptions implements ToJsonable { bool operator ==(Object other) { if (other is TextDocumentSyncOptions && other.runtimeType == TextDocumentSyncOptions) { - return openClose == other.openClose && - change == other.change && + return change == other.change && + openClose == other.openClose && + save == other.save && willSave == other.willSave && willSaveWaitUntil == other.willSaveWaitUntil && - save == other.save && true; } return false; @@ -40799,11 +40799,11 @@ class TextDocumentSyncOptions implements ToJsonable { @override int get hashCode => Object.hash( - openClose, change, + openClose, + save, willSave, willSaveWaitUntil, - save, ); @override @@ -40817,8 +40817,8 @@ class TextEdit implements ToJsonable { ); TextEdit({ - required this.range, required this.newText, + required this.range, }); static TextEdit fromJson(Map json) { if (AnnotatedTextEdit.canParse(json, nullLspJsonReporter)) { @@ -40827,13 +40827,13 @@ class TextEdit implements ToJsonable { if (SnippetTextEdit.canParse(json, nullLspJsonReporter)) { return SnippetTextEdit.fromJson(json); } - final rangeJson = json['range']; - final range = Range.fromJson(rangeJson as Map); final newTextJson = json['newText']; final newText = newTextJson as String; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map); return TextEdit( - range: range, newText: newText, + range: range, ); } @@ -40846,31 +40846,13 @@ class TextEdit implements ToJsonable { Map toJson() { var __result = {}; - __result['range'] = range.toJson(); __result['newText'] = newText; + __result['range'] = range.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('range'); - try { - if (!obj.containsKey('range')) { - reporter.reportError('must not be undefined'); - return false; - } - final range = obj['range']; - if (range == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(Range.canParse(range, reporter))) { - reporter.reportError('must be of type Range'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('newText'); try { if (!obj.containsKey('newText')) { @@ -40889,6 +40871,24 @@ class TextEdit implements ToJsonable { } finally { reporter.pop(); } + reporter.push('range'); + try { + if (!obj.containsKey('range')) { + reporter.reportError('must not be undefined'); + return false; + } + final range = obj['range']; + if (range == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(Range.canParse(range, reporter))) { + reporter.reportError('must be of type Range'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TextEdit'); @@ -40899,15 +40899,15 @@ class TextEdit implements ToJsonable { @override bool operator ==(Object other) { if (other is TextEdit && other.runtimeType == TextEdit) { - return range == other.range && newText == other.newText && true; + return newText == other.newText && range == other.range && true; } return false; } @override int get hashCode => Object.hash( - range, newText, + range, ); @override @@ -41105,25 +41105,12 @@ class TypeDefinitionParams ); TypeDefinitionParams({ - required this.textDocument, - required this.position, - this.workDoneToken, this.partialResultToken, + required this.position, + required this.textDocument, + this.workDoneToken, }); static TypeDefinitionParams fromJson(Map json) { - final textDocumentJson = json['textDocument']; - final textDocument = TextDocumentIdentifier.fromJson( - textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -41132,11 +41119,24 @@ class TypeDefinitionParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return TypeDefinitionParams( - textDocument: textDocument, - position: position, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, ); } @@ -41155,32 +41155,25 @@ class TypeDefinitionParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); - __result['position'] = position.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); + reporter.push('partialResultToken'); try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); return false; } } finally { @@ -41204,22 +41197,29 @@ class TypeDefinitionParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('textDocument'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { - reporter.reportError('must be of type Either2'); + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -41237,10 +41237,10 @@ class TypeDefinitionParams bool operator ==(Object other) { if (other is TypeDefinitionParams && other.runtimeType == TypeDefinitionParams) { - return textDocument == other.textDocument && + return partialResultToken == other.partialResultToken && position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -41248,10 +41248,10 @@ class TypeDefinitionParams @override int get hashCode => Object.hash( - textDocument, - position, - workDoneToken, partialResultToken, + position, + textDocument, + workDoneToken, ); @override @@ -41271,22 +41271,22 @@ class TypeDefinitionRegistrationOptions TypeDefinitionRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static TypeDefinitionRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return TypeDefinitionRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -41302,12 +41302,12 @@ class TypeDefinitionRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -41330,16 +41330,6 @@ class TypeDefinitionRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -41350,6 +41340,16 @@ class TypeDefinitionRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TypeDefinitionRegistrationOptions'); @@ -41363,8 +41363,8 @@ class TypeDefinitionRegistrationOptions other.runtimeType == TypeDefinitionRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -41373,8 +41373,8 @@ class TypeDefinitionRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -41454,44 +41454,44 @@ class TypeHierarchyItem implements ToJsonable { ); TypeHierarchyItem({ - required this.name, - required this.kind, - this.tags, + this.data, this.detail, - required this.uri, + required this.kind, + required this.name, required this.range, required this.selectionRange, - this.data, + this.tags, + required this.uri, }); static TypeHierarchyItem fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; - final kindJson = json['kind']; - final kind = SymbolKind.fromJson(kindJson as int); - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => SymbolTag.fromJson(item as int)) - .toList(); + final dataJson = json['data']; + final data = dataJson; final detailJson = json['detail']; final detail = detailJson as String?; - final uriJson = json['uri']; - final uri = uriJson as String; + final kindJson = json['kind']; + final kind = SymbolKind.fromJson(kindJson as int); + final nameJson = json['name']; + final name = nameJson as String; final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map); final selectionRangeJson = json['selectionRange']; final selectionRange = Range.fromJson(selectionRangeJson as Map); - final dataJson = json['data']; - final data = dataJson; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => SymbolTag.fromJson(item as int)) + .toList(); + final uriJson = json['uri']; + final uri = uriJson as String; return TypeHierarchyItem( - name: name, - kind: kind, - tags: tags, + data: data, detail: detail, - uri: uri, + kind: kind, + name: name, range: range, selectionRange: selectionRange, - data: data, + tags: tags, + uri: uri, ); } @@ -41527,37 +41527,29 @@ class TypeHierarchyItem implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; - __result['kind'] = kind.toJson(); - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); + if (data != null) { + __result['data'] = data; } if (detail != null) { __result['detail'] = detail; } - __result['uri'] = uri; + __result['kind'] = kind.toJson(); + __result['name'] = name; __result['range'] = range.toJson(); __result['selectionRange'] = selectionRange.toJson(); - if (data != null) { - __result['data'] = data; + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); } + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); + reporter.push('detail'); try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); - return false; - } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { + final detail = obj['detail']; + if (detail != null && !(detail is String)) { reporter.reportError('must be of type String'); return false; } @@ -41582,40 +41574,18 @@ class TypeHierarchyItem implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); + reporter.push('name'); try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('detail'); - try { - final detail = obj['detail']; - if (detail != null && !(detail is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { + if (!obj.containsKey('name')) { reporter.reportError('must not be undefined'); return false; } - final uri = obj['uri']; - if (uri == null) { + final name = obj['name']; + if (name == null) { reporter.reportError('must not be null'); return false; } - if (!(uri is String)) { + if (!(name is String)) { reporter.reportError('must be of type String'); return false; } @@ -41658,6 +41628,36 @@ class TypeHierarchyItem implements ToJsonable { } finally { reporter.pop(); } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TypeHierarchyItem'); @@ -41668,14 +41668,14 @@ class TypeHierarchyItem implements ToJsonable { @override bool operator ==(Object other) { if (other is TypeHierarchyItem && other.runtimeType == TypeHierarchyItem) { - return name == other.name && - kind == other.kind && - listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + return data == other.data && detail == other.detail && - uri == other.uri && + kind == other.kind && + name == other.name && range == other.range && selectionRange == other.selectionRange && - data == other.data && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + uri == other.uri && true; } return false; @@ -41683,14 +41683,14 @@ class TypeHierarchyItem implements ToJsonable { @override int get hashCode => Object.hash( - name, - kind, - lspHashCode(tags), + data, detail, - uri, + kind, + name, range, selectionRange, - data, + lspHashCode(tags), + uri, ); @override @@ -41770,16 +41770,16 @@ class TypeHierarchyPrepareParams ); TypeHierarchyPrepareParams({ - required this.textDocument, required this.position, + required this.textDocument, this.workDoneToken, }); static TypeHierarchyPrepareParams fromJson(Map json) { + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final positionJson = json['position']; - final position = Position.fromJson(positionJson as Map); final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -41789,8 +41789,8 @@ class TypeHierarchyPrepareParams ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return TypeHierarchyPrepareParams( - textDocument: textDocument, position: position, + textDocument: textDocument, workDoneToken: workDoneToken, ); } @@ -41806,8 +41806,8 @@ class TypeHierarchyPrepareParams Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['position'] = position.toJson(); + __result['textDocument'] = textDocument.toJson(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } @@ -41816,24 +41816,6 @@ class TypeHierarchyPrepareParams static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('position'); try { if (!obj.containsKey('position')) { @@ -41852,6 +41834,24 @@ class TypeHierarchyPrepareParams } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('workDoneToken'); try { final workDoneToken = obj['workDoneToken']; @@ -41874,8 +41874,8 @@ class TypeHierarchyPrepareParams bool operator ==(Object other) { if (other is TypeHierarchyPrepareParams && other.runtimeType == TypeHierarchyPrepareParams) { - return textDocument == other.textDocument && - position == other.position && + return position == other.position && + textDocument == other.textDocument && workDoneToken == other.workDoneToken && true; } @@ -41884,8 +41884,8 @@ class TypeHierarchyPrepareParams @override int get hashCode => Object.hash( - textDocument, position, + textDocument, workDoneToken, ); @@ -41906,22 +41906,22 @@ class TypeHierarchyRegistrationOptions TypeHierarchyRegistrationOptions({ this.documentSelector, - this.workDoneProgress, this.id, + this.workDoneProgress, }); static TypeHierarchyRegistrationOptions fromJson(Map json) { final documentSelectorJson = json['documentSelector']; final documentSelector = (documentSelectorJson as List?) ?.map((item) => DocumentFilter.fromJson(item as Map)) .toList(); - final workDoneProgressJson = json['workDoneProgress']; - final workDoneProgress = workDoneProgressJson as bool?; final idJson = json['id']; final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; return TypeHierarchyRegistrationOptions( documentSelector: documentSelector, - workDoneProgress: workDoneProgress, id: id, + workDoneProgress: workDoneProgress, ); } @@ -41937,12 +41937,12 @@ class TypeHierarchyRegistrationOptions Map toJson() { var __result = {}; __result['documentSelector'] = documentSelector; - if (workDoneProgress != null) { - __result['workDoneProgress'] = workDoneProgress; - } if (id != null) { __result['id'] = id; } + if (workDoneProgress != null) { + __result['workDoneProgress'] = workDoneProgress; + } return __result; } @@ -41965,16 +41965,6 @@ class TypeHierarchyRegistrationOptions } finally { reporter.pop(); } - reporter.push('workDoneProgress'); - try { - final workDoneProgress = obj['workDoneProgress']; - if (workDoneProgress != null && !(workDoneProgress is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('id'); try { final id = obj['id']; @@ -41985,6 +41975,16 @@ class TypeHierarchyRegistrationOptions } finally { reporter.pop(); } + reporter.push('workDoneProgress'); + try { + final workDoneProgress = obj['workDoneProgress']; + if (workDoneProgress != null && !(workDoneProgress is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type TypeHierarchyRegistrationOptions'); @@ -41998,8 +41998,8 @@ class TypeHierarchyRegistrationOptions other.runtimeType == TypeHierarchyRegistrationOptions) { return listEqual(documentSelector, other.documentSelector, (DocumentFilter a, DocumentFilter b) => a == b) && - workDoneProgress == other.workDoneProgress && id == other.id && + workDoneProgress == other.workDoneProgress && true; } return false; @@ -42008,8 +42008,8 @@ class TypeHierarchyRegistrationOptions @override int get hashCode => Object.hash( lspHashCode(documentSelector), - workDoneProgress, id, + workDoneProgress, ); @override @@ -42025,20 +42025,12 @@ class TypeHierarchySubtypesParams TypeHierarchySubtypesParams({ required this.item, - this.workDoneToken, this.partialResultToken, + this.workDoneToken, }); static TypeHierarchySubtypesParams fromJson(Map json) { final itemJson = json['item']; final item = TypeHierarchyItem.fromJson(itemJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -42047,10 +42039,18 @@ class TypeHierarchySubtypesParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return TypeHierarchySubtypesParams( item: item, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + workDoneToken: workDoneToken, ); } @@ -42066,12 +42066,12 @@ class TypeHierarchySubtypesParams Map toJson() { var __result = {}; __result['item'] = item.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -42095,22 +42095,22 @@ class TypeHierarchySubtypesParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('partialResultToken'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { reporter.reportError('must be of type Either2'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -42129,8 +42129,8 @@ class TypeHierarchySubtypesParams if (other is TypeHierarchySubtypesParams && other.runtimeType == TypeHierarchySubtypesParams) { return item == other.item && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + workDoneToken == other.workDoneToken && true; } return false; @@ -42139,8 +42139,8 @@ class TypeHierarchySubtypesParams @override int get hashCode => Object.hash( item, - workDoneToken, partialResultToken, + workDoneToken, ); @override @@ -42156,20 +42156,12 @@ class TypeHierarchySupertypesParams TypeHierarchySupertypesParams({ required this.item, - this.workDoneToken, this.partialResultToken, + this.workDoneToken, }); static TypeHierarchySupertypesParams fromJson(Map json) { final itemJson = json['item']; final item = TypeHierarchyItem.fromJson(itemJson as Map); - final workDoneTokenJson = json['workDoneToken']; - final workDoneToken = workDoneTokenJson == null - ? null - : (workDoneTokenJson is int - ? Either2.t1(workDoneTokenJson) - : (workDoneTokenJson is String - ? Either2.t2(workDoneTokenJson) - : (throw '''$workDoneTokenJson was not one of (int, String)'''))); final partialResultTokenJson = json['partialResultToken']; final partialResultToken = partialResultTokenJson == null ? null @@ -42178,10 +42170,18 @@ class TypeHierarchySupertypesParams : (partialResultTokenJson is String ? Either2.t2(partialResultTokenJson) : (throw '''$partialResultTokenJson was not one of (int, String)'''))); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = workDoneTokenJson == null + ? null + : (workDoneTokenJson is int + ? Either2.t1(workDoneTokenJson) + : (workDoneTokenJson is String + ? Either2.t2(workDoneTokenJson) + : (throw '''$workDoneTokenJson was not one of (int, String)'''))); return TypeHierarchySupertypesParams( item: item, - workDoneToken: workDoneToken, partialResultToken: partialResultToken, + workDoneToken: workDoneToken, ); } @@ -42197,12 +42197,12 @@ class TypeHierarchySupertypesParams Map toJson() { var __result = {}; __result['item'] = item.toJson(); - if (workDoneToken != null) { - __result['workDoneToken'] = workDoneToken; - } if (partialResultToken != null) { __result['partialResultToken'] = partialResultToken; } + if (workDoneToken != null) { + __result['workDoneToken'] = workDoneToken; + } return __result; } @@ -42226,22 +42226,22 @@ class TypeHierarchySupertypesParams } finally { reporter.pop(); } - reporter.push('workDoneToken'); + reporter.push('partialResultToken'); try { - final workDoneToken = obj['workDoneToken']; - if (workDoneToken != null && - !((workDoneToken is int || workDoneToken is String))) { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { reporter.reportError('must be of type Either2'); return false; } } finally { reporter.pop(); } - reporter.push('partialResultToken'); + reporter.push('workDoneToken'); try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { + final workDoneToken = obj['workDoneToken']; + if (workDoneToken != null && + !((workDoneToken is int || workDoneToken is String))) { reporter.reportError('must be of type Either2'); return false; } @@ -42260,8 +42260,8 @@ class TypeHierarchySupertypesParams if (other is TypeHierarchySupertypesParams && other.runtimeType == TypeHierarchySupertypesParams) { return item == other.item && - workDoneToken == other.workDoneToken && partialResultToken == other.partialResultToken && + workDoneToken == other.workDoneToken && true; } return false; @@ -42270,8 +42270,8 @@ class TypeHierarchySupertypesParams @override int get hashCode => Object.hash( item, - workDoneToken, partialResultToken, + workDoneToken, ); @override @@ -42616,18 +42616,18 @@ class VersionedNotebookDocumentIdentifier implements ToJsonable { ); VersionedNotebookDocumentIdentifier({ - required this.version, required this.uri, + required this.version, }); static VersionedNotebookDocumentIdentifier fromJson( Map json) { - final versionJson = json['version']; - final version = versionJson as int; final uriJson = json['uri']; final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int; return VersionedNotebookDocumentIdentifier( - version: version, uri: uri, + version: version, ); } @@ -42639,31 +42639,13 @@ class VersionedNotebookDocumentIdentifier implements ToJsonable { Map toJson() { var __result = {}; - __result['version'] = version; __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('version'); - try { - if (!obj.containsKey('version')) { - reporter.reportError('must not be undefined'); - return false; - } - final version = obj['version']; - if (version == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(version is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -42682,6 +42664,24 @@ class VersionedNotebookDocumentIdentifier implements ToJsonable { } finally { reporter.pop(); } + reporter.push('version'); + try { + if (!obj.containsKey('version')) { + reporter.reportError('must not be undefined'); + return false; + } + final version = obj['version']; + if (version == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(version is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter @@ -42694,15 +42694,15 @@ class VersionedNotebookDocumentIdentifier implements ToJsonable { bool operator ==(Object other) { if (other is VersionedNotebookDocumentIdentifier && other.runtimeType == VersionedNotebookDocumentIdentifier) { - return version == other.version && uri == other.uri && true; + return uri == other.uri && version == other.version && true; } return false; } @override int get hashCode => Object.hash( - version, uri, + version, ); @override @@ -42717,17 +42717,17 @@ class VersionedTextDocumentIdentifier ); VersionedTextDocumentIdentifier({ - required this.version, required this.uri, + required this.version, }); static VersionedTextDocumentIdentifier fromJson(Map json) { - final versionJson = json['version']; - final version = versionJson as int; final uriJson = json['uri']; final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int; return VersionedTextDocumentIdentifier( - version: version, uri: uri, + version: version, ); } @@ -42742,31 +42742,13 @@ class VersionedTextDocumentIdentifier Map toJson() { var __result = {}; - __result['version'] = version; __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('version'); - try { - if (!obj.containsKey('version')) { - reporter.reportError('must not be undefined'); - return false; - } - final version = obj['version']; - if (version == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(version is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('uri'); try { if (!obj.containsKey('uri')) { @@ -42785,6 +42767,24 @@ class VersionedTextDocumentIdentifier } finally { reporter.pop(); } + reporter.push('version'); + try { + if (!obj.containsKey('version')) { + reporter.reportError('must not be undefined'); + return false; + } + final version = obj['version']; + if (version == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(version is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type VersionedTextDocumentIdentifier'); @@ -42796,15 +42796,15 @@ class VersionedTextDocumentIdentifier bool operator ==(Object other) { if (other is VersionedTextDocumentIdentifier && other.runtimeType == VersionedTextDocumentIdentifier) { - return version == other.version && uri == other.uri && true; + return uri == other.uri && version == other.version && true; } return false; } @override int get hashCode => Object.hash( - version, uri, + version, ); @override @@ -42849,18 +42849,18 @@ class WillSaveTextDocumentParams implements ToJsonable { ); WillSaveTextDocumentParams({ - required this.textDocument, required this.reason, + required this.textDocument, }); static WillSaveTextDocumentParams fromJson(Map json) { + final reasonJson = json['reason']; + final reason = TextDocumentSaveReason.fromJson(reasonJson as int); final textDocumentJson = json['textDocument']; final textDocument = TextDocumentIdentifier.fromJson( textDocumentJson as Map); - final reasonJson = json['reason']; - final reason = TextDocumentSaveReason.fromJson(reasonJson as int); return WillSaveTextDocumentParams( - textDocument: textDocument, reason: reason, + textDocument: textDocument, ); } @@ -42872,31 +42872,13 @@ class WillSaveTextDocumentParams implements ToJsonable { Map toJson() { var __result = {}; - __result['textDocument'] = textDocument.toJson(); __result['reason'] = reason.toJson(); + __result['textDocument'] = textDocument.toJson(); return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('textDocument'); - try { - if (!obj.containsKey('textDocument')) { - reporter.reportError('must not be undefined'); - return false; - } - final textDocument = obj['textDocument']; - if (textDocument == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { - reporter.reportError('must be of type TextDocumentIdentifier'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('reason'); try { if (!obj.containsKey('reason')) { @@ -42915,6 +42897,24 @@ class WillSaveTextDocumentParams implements ToJsonable { } finally { reporter.pop(); } + reporter.push('textDocument'); + try { + if (!obj.containsKey('textDocument')) { + reporter.reportError('must not be undefined'); + return false; + } + final textDocument = obj['textDocument']; + if (textDocument == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) { + reporter.reportError('must be of type TextDocumentIdentifier'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type WillSaveTextDocumentParams'); @@ -42926,8 +42926,8 @@ class WillSaveTextDocumentParams implements ToJsonable { bool operator ==(Object other) { if (other is WillSaveTextDocumentParams && other.runtimeType == WillSaveTextDocumentParams) { - return textDocument == other.textDocument && - reason == other.reason && + return reason == other.reason && + textDocument == other.textDocument && true; } return false; @@ -42935,8 +42935,8 @@ class WillSaveTextDocumentParams implements ToJsonable { @override int get hashCode => Object.hash( - textDocument, reason, + textDocument, ); @override @@ -42950,33 +42950,33 @@ class WorkDoneProgressBegin implements ToJsonable { ); WorkDoneProgressBegin({ - this.kind = 'begin', - required this.title, this.cancellable, + this.kind = 'begin', this.message, this.percentage, + required this.title, }) { if (kind != 'begin') { throw 'kind may only be the literal \'begin\''; } } static WorkDoneProgressBegin fromJson(Map json) { - final kindJson = json['kind']; - final kind = kindJson as String; - final titleJson = json['title']; - final title = titleJson as String; final cancellableJson = json['cancellable']; final cancellable = cancellableJson as bool?; + final kindJson = json['kind']; + final kind = kindJson as String; final messageJson = json['message']; final message = messageJson as String?; final percentageJson = json['percentage']; final percentage = percentageJson as int?; + final titleJson = json['title']; + final title = titleJson as String; return WorkDoneProgressBegin( - kind: kind, - title: title, cancellable: cancellable, + kind: kind, message: message, percentage: percentage, + title: title, ); } @@ -43009,22 +43009,32 @@ class WorkDoneProgressBegin implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; - __result['title'] = title; if (cancellable != null) { __result['cancellable'] = cancellable; } + __result['kind'] = kind; if (message != null) { __result['message'] = message; } if (percentage != null) { __result['percentage'] = percentage; } + __result['title'] = title; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('cancellable'); + try { + final cancellable = obj['cancellable']; + if (cancellable != null && !(cancellable is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -43043,34 +43053,6 @@ class WorkDoneProgressBegin implements ToJsonable { } finally { reporter.pop(); } - reporter.push('title'); - try { - if (!obj.containsKey('title')) { - reporter.reportError('must not be undefined'); - return false; - } - final title = obj['title']; - if (title == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(title is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('cancellable'); - try { - final cancellable = obj['cancellable']; - if (cancellable != null && !(cancellable is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('message'); try { final message = obj['message']; @@ -43091,6 +43073,24 @@ class WorkDoneProgressBegin implements ToJsonable { } finally { reporter.pop(); } + reporter.push('title'); + try { + if (!obj.containsKey('title')) { + reporter.reportError('must not be undefined'); + return false; + } + final title = obj['title']; + if (title == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(title is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type WorkDoneProgressBegin'); @@ -43102,11 +43102,11 @@ class WorkDoneProgressBegin implements ToJsonable { bool operator ==(Object other) { if (other is WorkDoneProgressBegin && other.runtimeType == WorkDoneProgressBegin) { - return kind == other.kind && - title == other.title && - cancellable == other.cancellable && + return cancellable == other.cancellable && + kind == other.kind && message == other.message && percentage == other.percentage && + title == other.title && true; } return false; @@ -43114,11 +43114,11 @@ class WorkDoneProgressBegin implements ToJsonable { @override int get hashCode => Object.hash( - kind, - title, cancellable, + kind, message, percentage, + title, ); @override @@ -43707,8 +43707,8 @@ class WorkDoneProgressReport implements ToJsonable { ); WorkDoneProgressReport({ - this.kind = 'report', this.cancellable, + this.kind = 'report', this.message, this.percentage, }) { @@ -43717,17 +43717,17 @@ class WorkDoneProgressReport implements ToJsonable { } } static WorkDoneProgressReport fromJson(Map json) { - final kindJson = json['kind']; - final kind = kindJson as String; final cancellableJson = json['cancellable']; final cancellable = cancellableJson as bool?; + final kindJson = json['kind']; + final kind = kindJson as String; final messageJson = json['message']; final message = messageJson as String?; final percentageJson = json['percentage']; final percentage = percentageJson as int?; return WorkDoneProgressReport( - kind: kind, cancellable: cancellable, + kind: kind, message: message, percentage: percentage, ); @@ -43758,10 +43758,10 @@ class WorkDoneProgressReport implements ToJsonable { Map toJson() { var __result = {}; - __result['kind'] = kind; if (cancellable != null) { __result['cancellable'] = cancellable; } + __result['kind'] = kind; if (message != null) { __result['message'] = message; } @@ -43773,6 +43773,16 @@ class WorkDoneProgressReport implements ToJsonable { static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('cancellable'); + try { + final cancellable = obj['cancellable']; + if (cancellable != null && !(cancellable is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -43791,16 +43801,6 @@ class WorkDoneProgressReport implements ToJsonable { } finally { reporter.pop(); } - reporter.push('cancellable'); - try { - final cancellable = obj['cancellable']; - if (cancellable != null && !(cancellable is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('message'); try { final message = obj['message']; @@ -43832,8 +43832,8 @@ class WorkDoneProgressReport implements ToJsonable { bool operator ==(Object other) { if (other is WorkDoneProgressReport && other.runtimeType == WorkDoneProgressReport) { - return kind == other.kind && - cancellable == other.cancellable && + return cancellable == other.cancellable && + kind == other.kind && message == other.message && percentage == other.percentage && true; @@ -43843,8 +43843,8 @@ class WorkDoneProgressReport implements ToJsonable { @override int get hashCode => Object.hash( - kind, cancellable, + kind, message, percentage, ); @@ -43864,13 +43864,21 @@ class WorkspaceDiagnosticParams WorkspaceDiagnosticParams({ this.identifier, + this.partialResultToken, required this.previousResultIds, this.workDoneToken, - this.partialResultToken, }); static WorkspaceDiagnosticParams fromJson(Map json) { final identifierJson = json['identifier']; final identifier = identifierJson as String?; + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final previousResultIdsJson = json['previousResultIds']; final previousResultIds = (previousResultIdsJson as List) .map((item) => PreviousResultId.fromJson(item as Map)) @@ -43883,19 +43891,11 @@ class WorkspaceDiagnosticParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return WorkspaceDiagnosticParams( identifier: identifier, + partialResultToken: partialResultToken, previousResultIds: previousResultIds, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -43917,14 +43917,14 @@ class WorkspaceDiagnosticParams if (identifier != null) { __result['identifier'] = identifier; } + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['previousResultIds'] = previousResultIds.map((item) => item.toJson()).toList(); if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } @@ -43940,6 +43940,17 @@ class WorkspaceDiagnosticParams } finally { reporter.pop(); } + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('previousResultIds'); try { if (!obj.containsKey('previousResultIds')) { @@ -43971,17 +43982,6 @@ class WorkspaceDiagnosticParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type WorkspaceDiagnosticParams'); @@ -43994,10 +43994,10 @@ class WorkspaceDiagnosticParams if (other is WorkspaceDiagnosticParams && other.runtimeType == WorkspaceDiagnosticParams) { return identifier == other.identifier && + partialResultToken == other.partialResultToken && listEqual(previousResultIds, other.previousResultIds, (PreviousResultId a, PreviousResultId b) => a == b) && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -44006,9 +44006,9 @@ class WorkspaceDiagnosticParams @override int get hashCode => Object.hash( identifier, + partialResultToken, lspHashCode(previousResultIds), workDoneToken, - partialResultToken, ); @override @@ -44224,11 +44224,15 @@ class WorkspaceEdit implements ToJsonable { ); WorkspaceEdit({ + this.changeAnnotations, this.changes, this.documentChanges, - this.changeAnnotations, }); static WorkspaceEdit fromJson(Map json) { + final changeAnnotationsJson = json['changeAnnotations']; + final changeAnnotations = (changeAnnotationsJson as Map?) + ?.map((key, value) => MapEntry(key as String, + ChangeAnnotation.fromJson(value as Map))); final changesJson = json['changes']; final changes = (changesJson as Map?)?.map((key, value) => MapEntry( @@ -44257,14 +44261,10 @@ class WorkspaceEdit implements ToJsonable { : (TextDocumentEdit.canParse(item, nullLspJsonReporter) ? Either4.t4(TextDocumentEdit.fromJson(item as Map)) : (throw '''$item was not one of (CreateFile, DeleteFile, RenameFile, TextDocumentEdit)'''))))) .toList()) : ((documentChangesJson is List && (documentChangesJson.every((item) => TextDocumentEdit.canParse(item, nullLspJsonReporter)))) ? Either2>, List>.t2((documentChangesJson).map((item) => TextDocumentEdit.fromJson(item as Map)).toList()) : (throw '''$documentChangesJson was not one of (List>, List)'''))); - final changeAnnotationsJson = json['changeAnnotations']; - final changeAnnotations = (changeAnnotationsJson as Map?) - ?.map((key, value) => MapEntry(key as String, - ChangeAnnotation.fromJson(value as Map))); return WorkspaceEdit( + changeAnnotations: changeAnnotations, changes: changes, documentChanges: documentChanges, - changeAnnotations: changeAnnotations, ); } @@ -44298,20 +44298,35 @@ class WorkspaceEdit implements ToJsonable { Map toJson() { var __result = {}; + if (changeAnnotations != null) { + __result['changeAnnotations'] = changeAnnotations; + } if (changes != null) { __result['changes'] = changes; } if (documentChanges != null) { __result['documentChanges'] = documentChanges; } - if (changeAnnotations != null) { - __result['changeAnnotations'] = changeAnnotations; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('changeAnnotations'); + try { + final changeAnnotations = obj['changeAnnotations']; + if (changeAnnotations != null && + !((changeAnnotations is Map && + (changeAnnotations.keys.every((item) => + item is String && + changeAnnotations.values.every((item) => + ChangeAnnotation.canParse(item, reporter))))))) { + reporter.reportError('must be of type Map'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('changes'); try { final changes = obj['changes']; @@ -44348,21 +44363,6 @@ class WorkspaceEdit implements ToJsonable { } finally { reporter.pop(); } - reporter.push('changeAnnotations'); - try { - final changeAnnotations = obj['changeAnnotations']; - if (changeAnnotations != null && - !((changeAnnotations is Map && - (changeAnnotations.keys.every((item) => - item is String && - changeAnnotations.values.every((item) => - ChangeAnnotation.canParse(item, reporter))))))) { - reporter.reportError('must be of type Map'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type WorkspaceEdit'); @@ -44373,14 +44373,14 @@ class WorkspaceEdit implements ToJsonable { @override bool operator ==(Object other) { if (other is WorkspaceEdit && other.runtimeType == WorkspaceEdit) { - return mapEqual( + return mapEqual(changeAnnotations, other.changeAnnotations, + (ChangeAnnotation a, ChangeAnnotation b) => a == b) && + mapEqual( changes, other.changes, (List a, List b) => listEqual(a, b, (TextEdit a, TextEdit b) => a == b)) && documentChanges == other.documentChanges && - mapEqual(changeAnnotations, other.changeAnnotations, - (ChangeAnnotation a, ChangeAnnotation b) => a == b) && true; } return false; @@ -44388,9 +44388,9 @@ class WorkspaceEdit implements ToJsonable { @override int get hashCode => Object.hash( + lspHashCode(changeAnnotations), lspHashCode(changes), documentChanges, - lspHashCode(changeAnnotations), ); @override @@ -44404,36 +44404,36 @@ class WorkspaceEditClientCapabilities implements ToJsonable { ); WorkspaceEditClientCapabilities({ + this.changeAnnotationSupport, this.documentChanges, - this.resourceOperations, this.failureHandling, this.normalizesLineEndings, - this.changeAnnotationSupport, + this.resourceOperations, }); static WorkspaceEditClientCapabilities fromJson(Map json) { + final changeAnnotationSupportJson = json['changeAnnotationSupport']; + final changeAnnotationSupport = changeAnnotationSupportJson != null + ? WorkspaceEditClientCapabilitiesChangeAnnotationSupport.fromJson( + changeAnnotationSupportJson as Map) + : null; final documentChangesJson = json['documentChanges']; final documentChanges = documentChangesJson as bool?; - final resourceOperationsJson = json['resourceOperations']; - final resourceOperations = (resourceOperationsJson as List?) - ?.map((item) => ResourceOperationKind.fromJson(item as String)) - .toList(); final failureHandlingJson = json['failureHandling']; final failureHandling = failureHandlingJson != null ? FailureHandlingKind.fromJson(failureHandlingJson as String) : null; final normalizesLineEndingsJson = json['normalizesLineEndings']; final normalizesLineEndings = normalizesLineEndingsJson as bool?; - final changeAnnotationSupportJson = json['changeAnnotationSupport']; - final changeAnnotationSupport = changeAnnotationSupportJson != null - ? WorkspaceEditClientCapabilitiesChangeAnnotationSupport.fromJson( - changeAnnotationSupportJson as Map) - : null; + final resourceOperationsJson = json['resourceOperations']; + final resourceOperations = (resourceOperationsJson as List?) + ?.map((item) => ResourceOperationKind.fromJson(item as String)) + .toList(); return WorkspaceEditClientCapabilities( + changeAnnotationSupport: changeAnnotationSupport, documentChanges: documentChanges, - resourceOperations: resourceOperations, failureHandling: failureHandling, normalizesLineEndings: normalizesLineEndings, - changeAnnotationSupport: changeAnnotationSupport, + resourceOperations: resourceOperations, ); } @@ -44464,45 +44464,45 @@ class WorkspaceEditClientCapabilities implements ToJsonable { Map toJson() { var __result = {}; + if (changeAnnotationSupport != null) { + __result['changeAnnotationSupport'] = changeAnnotationSupport?.toJson(); + } if (documentChanges != null) { __result['documentChanges'] = documentChanges; } - if (resourceOperations != null) { - __result['resourceOperations'] = - resourceOperations?.map((item) => item.toJson()).toList(); - } if (failureHandling != null) { __result['failureHandling'] = failureHandling?.toJson(); } if (normalizesLineEndings != null) { __result['normalizesLineEndings'] = normalizesLineEndings; } - if (changeAnnotationSupport != null) { - __result['changeAnnotationSupport'] = changeAnnotationSupport?.toJson(); + if (resourceOperations != null) { + __result['resourceOperations'] = + resourceOperations?.map((item) => item.toJson()).toList(); } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('documentChanges'); + reporter.push('changeAnnotationSupport'); try { - final documentChanges = obj['documentChanges']; - if (documentChanges != null && !(documentChanges is bool)) { - reporter.reportError('must be of type bool'); + final changeAnnotationSupport = obj['changeAnnotationSupport']; + if (changeAnnotationSupport != null && + !(WorkspaceEditClientCapabilitiesChangeAnnotationSupport.canParse( + changeAnnotationSupport, reporter))) { + reporter.reportError( + 'must be of type WorkspaceEditClientCapabilitiesChangeAnnotationSupport'); return false; } } finally { reporter.pop(); } - reporter.push('resourceOperations'); + reporter.push('documentChanges'); try { - final resourceOperations = obj['resourceOperations']; - if (resourceOperations != null && - !((resourceOperations is List && - (resourceOperations.every((item) => - ResourceOperationKind.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + final documentChanges = obj['documentChanges']; + if (documentChanges != null && !(documentChanges is bool)) { + reporter.reportError('must be of type bool'); return false; } } finally { @@ -44529,14 +44529,14 @@ class WorkspaceEditClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('changeAnnotationSupport'); + reporter.push('resourceOperations'); try { - final changeAnnotationSupport = obj['changeAnnotationSupport']; - if (changeAnnotationSupport != null && - !(WorkspaceEditClientCapabilitiesChangeAnnotationSupport.canParse( - changeAnnotationSupport, reporter))) { - reporter.reportError( - 'must be of type WorkspaceEditClientCapabilitiesChangeAnnotationSupport'); + final resourceOperations = obj['resourceOperations']; + if (resourceOperations != null && + !((resourceOperations is List && + (resourceOperations.every((item) => + ResourceOperationKind.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -44553,12 +44553,12 @@ class WorkspaceEditClientCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is WorkspaceEditClientCapabilities && other.runtimeType == WorkspaceEditClientCapabilities) { - return documentChanges == other.documentChanges && - listEqual(resourceOperations, other.resourceOperations, - (ResourceOperationKind a, ResourceOperationKind b) => a == b) && + return changeAnnotationSupport == other.changeAnnotationSupport && + documentChanges == other.documentChanges && failureHandling == other.failureHandling && normalizesLineEndings == other.normalizesLineEndings && - changeAnnotationSupport == other.changeAnnotationSupport && + listEqual(resourceOperations, other.resourceOperations, + (ResourceOperationKind a, ResourceOperationKind b) => a == b) && true; } return false; @@ -44566,11 +44566,11 @@ class WorkspaceEditClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( + changeAnnotationSupport, documentChanges, - lspHashCode(resourceOperations), failureHandling, normalizesLineEndings, - changeAnnotationSupport, + lspHashCode(resourceOperations), ); @override @@ -44653,17 +44653,17 @@ class WorkspaceFolder implements ToJsonable { ); WorkspaceFolder({ - required this.uri, required this.name, + required this.uri, }); static WorkspaceFolder fromJson(Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; final nameJson = json['name']; final name = nameJson as String; + final uriJson = json['uri']; + final uri = uriJson as String; return WorkspaceFolder( - uri: uri, name: name, + uri: uri, ); } @@ -44676,31 +44676,13 @@ class WorkspaceFolder implements ToJsonable { Map toJson() { var __result = {}; - __result['uri'] = uri; __result['name'] = name; + __result['uri'] = uri; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('name'); try { if (!obj.containsKey('name')) { @@ -44719,6 +44701,24 @@ class WorkspaceFolder implements ToJsonable { } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type WorkspaceFolder'); @@ -44729,15 +44729,15 @@ class WorkspaceFolder implements ToJsonable { @override bool operator ==(Object other) { if (other is WorkspaceFolder && other.runtimeType == WorkspaceFolder) { - return uri == other.uri && name == other.name && true; + return name == other.name && uri == other.uri && true; } return false; } @override int get hashCode => Object.hash( - uri, name, + uri, ); @override @@ -44862,13 +44862,11 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { ); WorkspaceFoldersServerCapabilities({ - this.supported, this.changeNotifications, + this.supported, }); static WorkspaceFoldersServerCapabilities fromJson( Map json) { - final supportedJson = json['supported']; - final supported = supportedJson as bool?; final changeNotificationsJson = json['changeNotifications']; final changeNotifications = changeNotificationsJson == null ? null @@ -44877,9 +44875,11 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { : (changeNotificationsJson is String ? Either2.t2(changeNotificationsJson) : (throw '''$changeNotificationsJson was not one of (bool, String)'''))); + final supportedJson = json['supported']; + final supported = supportedJson as bool?; return WorkspaceFoldersServerCapabilities( - supported: supported, changeNotifications: changeNotifications, + supported: supported, ); } @@ -44896,27 +44896,17 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { Map toJson() { var __result = {}; - if (supported != null) { - __result['supported'] = supported; - } if (changeNotifications != null) { __result['changeNotifications'] = changeNotifications; } + if (supported != null) { + __result['supported'] = supported; + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('supported'); - try { - final supported = obj['supported']; - if (supported != null && !(supported is bool)) { - reporter.reportError('must be of type bool'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('changeNotifications'); try { final changeNotifications = obj['changeNotifications']; @@ -44928,6 +44918,16 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('supported'); + try { + final supported = obj['supported']; + if (supported != null && !(supported is bool)) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter @@ -44940,8 +44940,8 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { bool operator ==(Object other) { if (other is WorkspaceFoldersServerCapabilities && other.runtimeType == WorkspaceFoldersServerCapabilities) { - return supported == other.supported && - changeNotifications == other.changeNotifications && + return changeNotifications == other.changeNotifications && + supported == other.supported && true; } return false; @@ -44949,8 +44949,8 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { @override int get hashCode => Object.hash( - supported, changeNotifications, + supported, ); @override @@ -44967,11 +44967,11 @@ class WorkspaceFullDocumentDiagnosticReport ); WorkspaceFullDocumentDiagnosticReport({ - required this.uri, - this.version, + required this.items, this.kind = 'full', this.resultId, - required this.items, + required this.uri, + this.version, }) { if (kind != 'full') { throw 'kind may only be the literal \'full\''; @@ -44979,24 +44979,24 @@ class WorkspaceFullDocumentDiagnosticReport } static WorkspaceFullDocumentDiagnosticReport fromJson( Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final versionJson = json['version']; - final version = versionJson as int?; - final kindJson = json['kind']; - final kind = kindJson as String; - final resultIdJson = json['resultId']; - final resultId = resultIdJson as String?; final itemsJson = json['items']; final items = (itemsJson as List) .map((item) => Diagnostic.fromJson(item as Map)) .toList(); + final kindJson = json['kind']; + final kind = kindJson as String; + final resultIdJson = json['resultId']; + final resultId = resultIdJson as String?; + final uriJson = json['uri']; + final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int?; return WorkspaceFullDocumentDiagnosticReport( - uri: uri, - version: version, + items: items, kind: kind, resultId: resultId, - items: items, + uri: uri, + version: version, ); } @@ -45019,45 +45019,32 @@ class WorkspaceFullDocumentDiagnosticReport Map toJson() { var __result = {}; - __result['uri'] = uri; - __result['version'] = version; + __result['items'] = items.map((item) => item.toJson()).toList(); __result['kind'] = kind; if (resultId != null) { __result['resultId'] = resultId; } - __result['items'] = items.map((item) => item.toJson()).toList(); + __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); + reporter.push('items'); try { - if (!obj.containsKey('uri')) { + if (!obj.containsKey('items')) { reporter.reportError('must not be undefined'); return false; } - final uri = obj['uri']; - if (uri == null) { + final items = obj['items']; + if (items == null) { reporter.reportError('must not be null'); return false; } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('version'); - try { - if (!obj.containsKey('version')) { - reporter.reportError('must not be undefined'); - return false; - } - final version = obj['version']; - if (version != null && !(version is int)) { - reporter.reportError('must be of type int'); + if (!((items is List && + (items.every((item) => Diagnostic.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); return false; } } finally { @@ -45091,20 +45078,33 @@ class WorkspaceFullDocumentDiagnosticReport } finally { reporter.pop(); } - reporter.push('items'); + reporter.push('uri'); try { - if (!obj.containsKey('items')) { + if (!obj.containsKey('uri')) { reporter.reportError('must not be undefined'); return false; } - final items = obj['items']; - if (items == null) { + final uri = obj['uri']; + if (uri == null) { reporter.reportError('must not be null'); return false; } - if (!((items is List && - (items.every((item) => Diagnostic.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('version'); + try { + if (!obj.containsKey('version')) { + reporter.reportError('must not be undefined'); + return false; + } + final version = obj['version']; + if (version != null && !(version is int)) { + reporter.reportError('must be of type int'); return false; } } finally { @@ -45122,12 +45122,12 @@ class WorkspaceFullDocumentDiagnosticReport bool operator ==(Object other) { if (other is WorkspaceFullDocumentDiagnosticReport && other.runtimeType == WorkspaceFullDocumentDiagnosticReport) { - return uri == other.uri && - version == other.version && + return listEqual( + items, other.items, (Diagnostic a, Diagnostic b) => a == b) && kind == other.kind && resultId == other.resultId && - listEqual( - items, other.items, (Diagnostic a, Diagnostic b) => a == b) && + uri == other.uri && + version == other.version && true; } return false; @@ -45135,11 +45135,11 @@ class WorkspaceFullDocumentDiagnosticReport @override int get hashCode => Object.hash( - uri, - version, + lspHashCode(items), kind, resultId, - lspHashCode(items), + uri, + version, ); @override @@ -45155,21 +45155,17 @@ class WorkspaceSymbol implements ToJsonable { ); WorkspaceSymbol({ - required this.name, - required this.kind, - this.tags, - required this.location, this.containerName, + required this.kind, + required this.location, + required this.name, + this.tags, }); static WorkspaceSymbol fromJson(Map json) { - final nameJson = json['name']; - final name = nameJson as String; + final containerNameJson = json['containerName']; + final containerName = containerNameJson as String?; final kindJson = json['kind']; final kind = SymbolKind.fromJson(kindJson as int); - final tagsJson = json['tags']; - final tags = (tagsJson as List?) - ?.map((item) => SymbolTag.fromJson(item as int)) - .toList(); final locationJson = json['location']; final location = Location.canParse(locationJson, nullLspJsonReporter) ? Either2.t1( @@ -45179,14 +45175,18 @@ class WorkspaceSymbol implements ToJsonable { WorkspaceSymbolLocation.fromJson( locationJson as Map)) : (throw '''$locationJson was not one of (Location, WorkspaceSymbolLocation)''')); - final containerNameJson = json['containerName']; - final containerName = containerNameJson as String?; + final nameJson = json['name']; + final name = nameJson as String; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => SymbolTag.fromJson(item as int)) + .toList(); return WorkspaceSymbol( - name: name, - kind: kind, - tags: tags, - location: location, containerName: containerName, + kind: kind, + location: location, + name: name, + tags: tags, ); } @@ -45214,32 +45214,24 @@ class WorkspaceSymbol implements ToJsonable { Map toJson() { var __result = {}; - __result['name'] = name; - __result['kind'] = kind.toJson(); - if (tags != null) { - __result['tags'] = tags?.map((item) => item.toJson()).toList(); - } - __result['location'] = location; if (containerName != null) { __result['containerName'] = containerName; } + __result['kind'] = kind.toJson(); + __result['location'] = location; + __result['name'] = name; + if (tags != null) { + __result['tags'] = tags?.map((item) => item.toJson()).toList(); + } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('name'); + reporter.push('containerName'); try { - if (!obj.containsKey('name')) { - reporter.reportError('must not be undefined'); - return false; - } - final name = obj['name']; - if (name == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(name is String)) { + final containerName = obj['containerName']; + if (containerName != null && !(containerName is String)) { reporter.reportError('must be of type String'); return false; } @@ -45264,18 +45256,6 @@ class WorkspaceSymbol implements ToJsonable { } finally { reporter.pop(); } - reporter.push('tags'); - try { - final tags = obj['tags']; - if (tags != null && - !((tags is List && - (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { - reporter.reportError('must be of type List'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('location'); try { if (!obj.containsKey('location')) { @@ -45296,16 +45276,36 @@ class WorkspaceSymbol implements ToJsonable { } finally { reporter.pop(); } - reporter.push('containerName'); + reporter.push('name'); try { - final containerName = obj['containerName']; - if (containerName != null && !(containerName is String)) { + if (!obj.containsKey('name')) { + reporter.reportError('must not be undefined'); + return false; + } + final name = obj['name']; + if (name == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(name is String)) { reporter.reportError('must be of type String'); return false; } } finally { reporter.pop(); } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + !((tags is List && + (tags.every((item) => SymbolTag.canParse(item, reporter)))))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError('must be of type WorkspaceSymbol'); @@ -45316,11 +45316,11 @@ class WorkspaceSymbol implements ToJsonable { @override bool operator ==(Object other) { if (other is WorkspaceSymbol && other.runtimeType == WorkspaceSymbol) { - return name == other.name && + return containerName == other.containerName && kind == other.kind && - listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && location == other.location && - containerName == other.containerName && + name == other.name && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && true; } return false; @@ -45328,11 +45328,11 @@ class WorkspaceSymbol implements ToJsonable { @override int get hashCode => Object.hash( - name, - kind, - lspHashCode(tags), - location, containerName, + kind, + location, + name, + lspHashCode(tags), ); @override @@ -45347,13 +45347,18 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { WorkspaceSymbolClientCapabilities({ this.dynamicRegistration, + this.resolveSupport, this.symbolKind, this.tagSupport, - this.resolveSupport, }); static WorkspaceSymbolClientCapabilities fromJson(Map json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final resolveSupportJson = json['resolveSupport']; + final resolveSupport = resolveSupportJson != null + ? WorkspaceSymbolClientCapabilitiesResolveSupport.fromJson( + resolveSupportJson as Map) + : null; final symbolKindJson = json['symbolKind']; final symbolKind = symbolKindJson != null ? WorkspaceSymbolClientCapabilitiesSymbolKind.fromJson( @@ -45364,16 +45369,11 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { ? WorkspaceSymbolClientCapabilitiesTagSupport.fromJson( tagSupportJson as Map) : null; - final resolveSupportJson = json['resolveSupport']; - final resolveSupport = resolveSupportJson != null - ? WorkspaceSymbolClientCapabilitiesResolveSupport.fromJson( - resolveSupportJson as Map) - : null; return WorkspaceSymbolClientCapabilities( dynamicRegistration: dynamicRegistration, + resolveSupport: resolveSupport, symbolKind: symbolKind, tagSupport: tagSupport, - resolveSupport: resolveSupport, ); } @@ -45400,15 +45400,15 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { if (dynamicRegistration != null) { __result['dynamicRegistration'] = dynamicRegistration; } + if (resolveSupport != null) { + __result['resolveSupport'] = resolveSupport?.toJson(); + } if (symbolKind != null) { __result['symbolKind'] = symbolKind?.toJson(); } if (tagSupport != null) { __result['tagSupport'] = tagSupport?.toJson(); } - if (resolveSupport != null) { - __result['resolveSupport'] = resolveSupport?.toJson(); - } return __result; } @@ -45424,6 +45424,19 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { } finally { reporter.pop(); } + reporter.push('resolveSupport'); + try { + final resolveSupport = obj['resolveSupport']; + if (resolveSupport != null && + !(WorkspaceSymbolClientCapabilitiesResolveSupport.canParse( + resolveSupport, reporter))) { + reporter.reportError( + 'must be of type WorkspaceSymbolClientCapabilitiesResolveSupport'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('symbolKind'); try { final symbolKind = obj['symbolKind']; @@ -45450,19 +45463,6 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { } finally { reporter.pop(); } - reporter.push('resolveSupport'); - try { - final resolveSupport = obj['resolveSupport']; - if (resolveSupport != null && - !(WorkspaceSymbolClientCapabilitiesResolveSupport.canParse( - resolveSupport, reporter))) { - reporter.reportError( - 'must be of type WorkspaceSymbolClientCapabilitiesResolveSupport'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type WorkspaceSymbolClientCapabilities'); @@ -45475,9 +45475,9 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { if (other is WorkspaceSymbolClientCapabilities && other.runtimeType == WorkspaceSymbolClientCapabilities) { return dynamicRegistration == other.dynamicRegistration && + resolveSupport == other.resolveSupport && symbolKind == other.symbolKind && tagSupport == other.tagSupport && - resolveSupport == other.resolveSupport && true; } return false; @@ -45486,9 +45486,9 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { @override int get hashCode => Object.hash( dynamicRegistration, + resolveSupport, symbolKind, tagSupport, - resolveSupport, ); @override @@ -45893,11 +45893,19 @@ class WorkspaceSymbolParams ); WorkspaceSymbolParams({ + this.partialResultToken, required this.query, this.workDoneToken, - this.partialResultToken, }); static WorkspaceSymbolParams fromJson(Map json) { + final partialResultTokenJson = json['partialResultToken']; + final partialResultToken = partialResultTokenJson == null + ? null + : (partialResultTokenJson is int + ? Either2.t1(partialResultTokenJson) + : (partialResultTokenJson is String + ? Either2.t2(partialResultTokenJson) + : (throw '''$partialResultTokenJson was not one of (int, String)'''))); final queryJson = json['query']; final query = queryJson as String; final workDoneTokenJson = json['workDoneToken']; @@ -45908,18 +45916,10 @@ class WorkspaceSymbolParams : (workDoneTokenJson is String ? Either2.t2(workDoneTokenJson) : (throw '''$workDoneTokenJson was not one of (int, String)'''))); - final partialResultTokenJson = json['partialResultToken']; - final partialResultToken = partialResultTokenJson == null - ? null - : (partialResultTokenJson is int - ? Either2.t1(partialResultTokenJson) - : (partialResultTokenJson is String - ? Either2.t2(partialResultTokenJson) - : (throw '''$partialResultTokenJson was not one of (int, String)'''))); return WorkspaceSymbolParams( + partialResultToken: partialResultToken, query: query, workDoneToken: workDoneToken, - partialResultToken: partialResultToken, ); } @@ -45936,18 +45936,29 @@ class WorkspaceSymbolParams Map toJson() { var __result = {}; + if (partialResultToken != null) { + __result['partialResultToken'] = partialResultToken; + } __result['query'] = query; if (workDoneToken != null) { __result['workDoneToken'] = workDoneToken; } - if (partialResultToken != null) { - __result['partialResultToken'] = partialResultToken; - } return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { + reporter.push('partialResultToken'); + try { + final partialResultToken = obj['partialResultToken']; + if (partialResultToken != null && + !((partialResultToken is int || partialResultToken is String))) { + reporter.reportError('must be of type Either2'); + return false; + } + } finally { + reporter.pop(); + } reporter.push('query'); try { if (!obj.containsKey('query')) { @@ -45977,17 +45988,6 @@ class WorkspaceSymbolParams } finally { reporter.pop(); } - reporter.push('partialResultToken'); - try { - final partialResultToken = obj['partialResultToken']; - if (partialResultToken != null && - !((partialResultToken is int || partialResultToken is String))) { - reporter.reportError('must be of type Either2'); - return false; - } - } finally { - reporter.pop(); - } return true; } else { reporter.reportError('must be of type WorkspaceSymbolParams'); @@ -45999,9 +45999,9 @@ class WorkspaceSymbolParams bool operator ==(Object other) { if (other is WorkspaceSymbolParams && other.runtimeType == WorkspaceSymbolParams) { - return query == other.query && + return partialResultToken == other.partialResultToken && + query == other.query && workDoneToken == other.workDoneToken && - partialResultToken == other.partialResultToken && true; } return false; @@ -46009,9 +46009,9 @@ class WorkspaceSymbolParams @override int get hashCode => Object.hash( + partialResultToken, query, workDoneToken, - partialResultToken, ); @override @@ -46119,10 +46119,10 @@ class WorkspaceUnchangedDocumentDiagnosticReport ); WorkspaceUnchangedDocumentDiagnosticReport({ - required this.uri, - this.version, this.kind = 'unchanged', required this.resultId, + required this.uri, + this.version, }) { if (kind != 'unchanged') { throw 'kind may only be the literal \'unchanged\''; @@ -46130,19 +46130,19 @@ class WorkspaceUnchangedDocumentDiagnosticReport } static WorkspaceUnchangedDocumentDiagnosticReport fromJson( Map json) { - final uriJson = json['uri']; - final uri = uriJson as String; - final versionJson = json['version']; - final version = versionJson as int?; final kindJson = json['kind']; final kind = kindJson as String; final resultIdJson = json['resultId']; final resultId = resultIdJson as String; + final uriJson = json['uri']; + final uri = uriJson as String; + final versionJson = json['version']; + final version = versionJson as int?; return WorkspaceUnchangedDocumentDiagnosticReport( - uri: uri, - version: version, kind: kind, resultId: resultId, + uri: uri, + version: version, ); } @@ -46163,47 +46163,15 @@ class WorkspaceUnchangedDocumentDiagnosticReport Map toJson() { var __result = {}; - __result['uri'] = uri; - __result['version'] = version; __result['kind'] = kind; __result['resultId'] = resultId; + __result['uri'] = uri; + __result['version'] = version; return __result; } static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map) { - reporter.push('uri'); - try { - if (!obj.containsKey('uri')) { - reporter.reportError('must not be undefined'); - return false; - } - final uri = obj['uri']; - if (uri == null) { - reporter.reportError('must not be null'); - return false; - } - if (!(uri is String)) { - reporter.reportError('must be of type String'); - return false; - } - } finally { - reporter.pop(); - } - reporter.push('version'); - try { - if (!obj.containsKey('version')) { - reporter.reportError('must not be undefined'); - return false; - } - final version = obj['version']; - if (version != null && !(version is int)) { - reporter.reportError('must be of type int'); - return false; - } - } finally { - reporter.pop(); - } reporter.push('kind'); try { if (!obj.containsKey('kind')) { @@ -46240,6 +46208,38 @@ class WorkspaceUnchangedDocumentDiagnosticReport } finally { reporter.pop(); } + reporter.push('uri'); + try { + if (!obj.containsKey('uri')) { + reporter.reportError('must not be undefined'); + return false; + } + final uri = obj['uri']; + if (uri == null) { + reporter.reportError('must not be null'); + return false; + } + if (!(uri is String)) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('version'); + try { + if (!obj.containsKey('version')) { + reporter.reportError('must not be undefined'); + return false; + } + final version = obj['version']; + if (version != null && !(version is int)) { + reporter.reportError('must be of type int'); + return false; + } + } finally { + reporter.pop(); + } return true; } else { reporter.reportError( @@ -46252,10 +46252,10 @@ class WorkspaceUnchangedDocumentDiagnosticReport bool operator ==(Object other) { if (other is WorkspaceUnchangedDocumentDiagnosticReport && other.runtimeType == WorkspaceUnchangedDocumentDiagnosticReport) { - return uri == other.uri && - version == other.version && - kind == other.kind && + return kind == other.kind && resultId == other.resultId && + uri == other.uri && + version == other.version && true; } return false; @@ -46263,10 +46263,10 @@ class WorkspaceUnchangedDocumentDiagnosticReport @override int get hashCode => Object.hash( - uri, - version, kind, resultId, + uri, + version, ); @override diff --git a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart index 019bcd37a73..ad18e280d32 100644 --- a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart +++ b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart @@ -130,6 +130,9 @@ class AssistsCodeActionsTest extends AbstractCodeActionsTest { "textDocument": { "uri": "${mainFileUri.toString()}" }, + "context": { + "diagnostics": [] + }, "range": { "start": { "line": 3, diff --git a/pkg/analysis_server/test/tool/lsp_spec/json_test.dart b/pkg/analysis_server/test/tool/lsp_spec/json_test.dart index 5f3951c32e6..52a685967c0 100644 --- a/pkg/analysis_server/test/tool/lsp_spec/json_test.dart +++ b/pkg/analysis_server/test/tool/lsp_spec/json_test.dart @@ -23,7 +23,7 @@ void main() { method: Method.shutdown, jsonrpc: 'test'); final output = json.encode(message.toJson()); - expect(output, equals('{"id":1,"method":"shutdown","jsonrpc":"test"}')); + expect(output, equals('{"id":1,"jsonrpc":"test","method":"shutdown"}')); }); test('returns correct output for union types containing interface types', @@ -34,7 +34,7 @@ void main() { expect( output, equals( - '{"uri":"!uri","languageId":"!language","version":1,"text":"!text"}')); + '{"languageId":"!language","text":"!text","uri":"!uri","version":1}')); }); test('returns correct output for types with lists', () { @@ -54,26 +54,26 @@ void main() { ); final output = json.encode(codeAction.toJson()); final expected = '''{ - "range":{ - "start":{"line":1,"character":1}, - "end":{"line":2,"character":2} - }, - "severity":1, "code":"test_err", - "source":"/tmp/source.dart", "message":"err!!", + "range":{ + "end":{"character":2,"line":2}, + "start":{"character":1,"line":1} + }, "relatedInformation":[ { "location":{ - "uri":"y-uri", "range":{ - "start":{"line":1,"character":1}, - "end":{"line":2,"character":2} - } + "end":{"character":2,"line":2}, + "start":{"character":1,"line":1} + }, + "uri":"y-uri" }, "message":"message" } - ] + ], + "severity":1, + "source":"/tmp/source.dart" }''' .replaceAll(RegExp('[ \n]'), ''); expect(output, equals(expected)); @@ -101,11 +101,11 @@ void main() { kind: FoldingRangeKind.Comment); final output = json.encode(foldingRange.toJson()); final expected = '''{ - "startLine":1, - "startCharacter":2, - "endLine":3, "endCharacter":4, - "kind":"comment" + "endLine":3, + "kind":"comment", + "startCharacter":2, + "startLine":1 }''' .replaceAll(RegExp('[ \n]'), ''); expect(output, equals(expected)); @@ -253,9 +253,12 @@ void main() { test('canParse records nested undefined fields', () { final reporter = LspJsonReporter('params'); expect( - CompletionParams.canParse( - {'textDocument': {}}, reporter), - isFalse); + CompletionParams.canParse({ + 'position': {'line': 1, 'character': 1}, + 'textDocument': {}, + }, reporter), + isFalse, + ); expect(reporter.errors, hasLength(greaterThanOrEqualTo(1))); expect(reporter.errors.first, equals('params.textDocument.uri must not be undefined')); @@ -264,10 +267,12 @@ void main() { test('canParse records nested null fields', () { final reporter = LspJsonReporter('params'); expect( - CompletionParams.canParse({ - 'textDocument': {'uri': null} - }, reporter), - isFalse); + CompletionParams.canParse({ + 'position': {'line': 1, 'character': 1}, + 'textDocument': {'uri': null}, + }, reporter), + isFalse, + ); expect(reporter.errors, hasLength(greaterThanOrEqualTo(1))); expect(reporter.errors.first, equals('params.textDocument.uri must not be null')); @@ -276,10 +281,12 @@ void main() { test('canParse records nested fields of the wrong type', () { final reporter = LspJsonReporter('params'); expect( - CompletionParams.canParse({ - 'textDocument': {'uri': 1} - }, reporter), - isFalse); + CompletionParams.canParse({ + 'position': {'line': 1, 'character': 1}, + 'textDocument': {'uri': 1}, + }, reporter), + isFalse, + ); expect(reporter.errors, hasLength(greaterThanOrEqualTo(1))); expect(reporter.errors.first, equals('params.textDocument.uri must be of type String')); @@ -290,10 +297,11 @@ void main() { () { final reporter = LspJsonReporter('params'); expect( - WorkspaceEdit.canParse({ - 'documentChanges': {'uri': 1} - }, reporter), - isFalse); + WorkspaceEdit.canParse({ + 'documentChanges': {'uri': 1} + }, reporter), + isFalse, + ); expect(reporter.errors, hasLength(greaterThanOrEqualTo(1))); expect( reporter.errors.first, diff --git a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart index b8e03a06b7b..fe85eceddbb 100644 --- a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart +++ b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart @@ -101,13 +101,16 @@ List _getAllFields(Interface? interface) { if (interface == null) { return []; } - return interface.members + + final allFields = interface.members .whereType() .followedBy(interface.baseTypes // This cast is safe because base types are always real types. .map((type) => _getAllFields(_interfaces[(type as Type).name])) .expand((ts) => ts)) .toList(); + + return _getSortedUnique(allFields); } /// Returns a copy of the list sorted by name with duplicates (by name+type) removed.