| 1 |
// Copyright 2023 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// Code generated for LSP. DO NOT EDIT. |
| 6 |
|
| 7 |
package protocol |
| 8 |
|
| 9 |
// Code generated from protocol/metaModel.json at ref release/protocol/3.17.6-next.9 (hash c94395b5da53729e6dff931293b051009ccaaaa4). |
| 10 |
// https://github.com/microsoft/vscode-languageserver-node/blob/release/protocol/3.17.6-next.9/protocol/metaModel.json |
| 11 |
// LSP metaData.version = 3.17.0. |
| 12 |
|
| 13 |
import "bytes" |
| 14 |
import "encoding/json" |
| 15 |
|
| 16 |
import "fmt" |
| 17 |
|
| 18 |
// UnmarshalError indicates that a JSON value did not conform to |
| 19 |
// one of the expected cases of an LSP union type. |
| 20 |
type UnmarshalError struct { |
| 21 |
msg string |
| 22 |
} |
| 23 |
|
| 24 |
func (e UnmarshalError) Error() string { |
| 25 |
return e.msg |
| 26 |
} |
| 27 |
func (t Or_CancelParams_id) MarshalJSON() ([]byte, error) { |
| 28 |
switch x := t.Value.(type) { |
| 29 |
case int32: |
| 30 |
return json.Marshal(x) |
| 31 |
case string: |
| 32 |
return json.Marshal(x) |
| 33 |
case nil: |
| 34 |
return []byte("null"), nil |
| 35 |
} |
| 36 |
return nil, fmt.Errorf("type %T not one of [int32 string]", t) |
| 37 |
} |
| 38 |
|
| 39 |
func (t *Or_CancelParams_id) UnmarshalJSON(x []byte) error { |
| 40 |
if string(x) == "null" { |
| 41 |
t.Value = nil |
| 42 |
return nil |
| 43 |
} |
| 44 |
decoder41 := json.NewDecoder(bytes.NewReader(x)) |
| 45 |
decoder41.DisallowUnknownFields() |
| 46 |
var int32Val int32 |
| 47 |
if err := decoder41.Decode(&int32Val); err == nil { |
| 48 |
t.Value = int32Val |
| 49 |
return nil |
| 50 |
} |
| 51 |
decoder42 := json.NewDecoder(bytes.NewReader(x)) |
| 52 |
decoder42.DisallowUnknownFields() |
| 53 |
var stringVal string |
| 54 |
if err := decoder42.Decode(&stringVal); err == nil { |
| 55 |
t.Value = stringVal |
| 56 |
return nil |
| 57 |
} |
| 58 |
return &UnmarshalError{"unmarshal failed to match one of [int32 string]"} |
| 59 |
} |
| 60 |
|
| 61 |
func (t Or_ClientSemanticTokensRequestOptions_full) MarshalJSON() ([]byte, error) { |
| 62 |
switch x := t.Value.(type) { |
| 63 |
case ClientSemanticTokensRequestFullDelta: |
| 64 |
return json.Marshal(x) |
| 65 |
case bool: |
| 66 |
return json.Marshal(x) |
| 67 |
case nil: |
| 68 |
return []byte("null"), nil |
| 69 |
} |
| 70 |
return nil, fmt.Errorf("type %T not one of [ClientSemanticTokensRequestFullDelta bool]", t) |
| 71 |
} |
| 72 |
|
| 73 |
func (t *Or_ClientSemanticTokensRequestOptions_full) UnmarshalJSON(x []byte) error { |
| 74 |
if string(x) == "null" { |
| 75 |
t.Value = nil |
| 76 |
return nil |
| 77 |
} |
| 78 |
decoder220 := json.NewDecoder(bytes.NewReader(x)) |
| 79 |
decoder220.DisallowUnknownFields() |
| 80 |
var boolVal bool |
| 81 |
if err := decoder220.Decode(&boolVal); err == nil { |
| 82 |
t.Value = boolVal |
| 83 |
return nil |
| 84 |
} |
| 85 |
decoder221 := json.NewDecoder(bytes.NewReader(x)) |
| 86 |
decoder221.DisallowUnknownFields() |
| 87 |
var h221 ClientSemanticTokensRequestFullDelta |
| 88 |
if err := decoder221.Decode(&h221); err == nil { |
| 89 |
t.Value = h221 |
| 90 |
return nil |
| 91 |
} |
| 92 |
return &UnmarshalError{"unmarshal failed to match one of [ClientSemanticTokensRequestFullDelta bool]"} |
| 93 |
} |
| 94 |
|
| 95 |
func (t Or_ClientSemanticTokensRequestOptions_range) MarshalJSON() ([]byte, error) { |
| 96 |
switch x := t.Value.(type) { |
| 97 |
case Lit_ClientSemanticTokensRequestOptions_range_Item1: |
| 98 |
return json.Marshal(x) |
| 99 |
case bool: |
| 100 |
return json.Marshal(x) |
| 101 |
case nil: |
| 102 |
return []byte("null"), nil |
| 103 |
} |
| 104 |
return nil, fmt.Errorf("type %T not one of [Lit_ClientSemanticTokensRequestOptions_range_Item1 bool]", t) |
| 105 |
} |
| 106 |
|
| 107 |
func (t *Or_ClientSemanticTokensRequestOptions_range) UnmarshalJSON(x []byte) error { |
| 108 |
if string(x) == "null" { |
| 109 |
t.Value = nil |
| 110 |
return nil |
| 111 |
} |
| 112 |
decoder217 := json.NewDecoder(bytes.NewReader(x)) |
| 113 |
decoder217.DisallowUnknownFields() |
| 114 |
var boolVal bool |
| 115 |
if err := decoder217.Decode(&boolVal); err == nil { |
| 116 |
t.Value = boolVal |
| 117 |
return nil |
| 118 |
} |
| 119 |
decoder218 := json.NewDecoder(bytes.NewReader(x)) |
| 120 |
decoder218.DisallowUnknownFields() |
| 121 |
var h218 Lit_ClientSemanticTokensRequestOptions_range_Item1 |
| 122 |
if err := decoder218.Decode(&h218); err == nil { |
| 123 |
t.Value = h218 |
| 124 |
return nil |
| 125 |
} |
| 126 |
return &UnmarshalError{"unmarshal failed to match one of [Lit_ClientSemanticTokensRequestOptions_range_Item1 bool]"} |
| 127 |
} |
| 128 |
|
| 129 |
func (t Or_CompletionItemDefaults_editRange) MarshalJSON() ([]byte, error) { |
| 130 |
switch x := t.Value.(type) { |
| 131 |
case EditRangeWithInsertReplace: |
| 132 |
return json.Marshal(x) |
| 133 |
case Range: |
| 134 |
return json.Marshal(x) |
| 135 |
case nil: |
| 136 |
return []byte("null"), nil |
| 137 |
} |
| 138 |
return nil, fmt.Errorf("type %T not one of [EditRangeWithInsertReplace Range]", t) |
| 139 |
} |
| 140 |
|
| 141 |
func (t *Or_CompletionItemDefaults_editRange) UnmarshalJSON(x []byte) error { |
| 142 |
if string(x) == "null" { |
| 143 |
t.Value = nil |
| 144 |
return nil |
| 145 |
} |
| 146 |
decoder183 := json.NewDecoder(bytes.NewReader(x)) |
| 147 |
decoder183.DisallowUnknownFields() |
| 148 |
var h183 EditRangeWithInsertReplace |
| 149 |
if err := decoder183.Decode(&h183); err == nil { |
| 150 |
t.Value = h183 |
| 151 |
return nil |
| 152 |
} |
| 153 |
decoder184 := json.NewDecoder(bytes.NewReader(x)) |
| 154 |
decoder184.DisallowUnknownFields() |
| 155 |
var h184 Range |
| 156 |
if err := decoder184.Decode(&h184); err == nil { |
| 157 |
t.Value = h184 |
| 158 |
return nil |
| 159 |
} |
| 160 |
return &UnmarshalError{"unmarshal failed to match one of [EditRangeWithInsertReplace Range]"} |
| 161 |
} |
| 162 |
|
| 163 |
func (t Or_CompletionItem_documentation) MarshalJSON() ([]byte, error) { |
| 164 |
switch x := t.Value.(type) { |
| 165 |
case MarkupContent: |
| 166 |
return json.Marshal(x) |
| 167 |
case string: |
| 168 |
return json.Marshal(x) |
| 169 |
case nil: |
| 170 |
return []byte("null"), nil |
| 171 |
} |
| 172 |
return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t) |
| 173 |
} |
| 174 |
|
| 175 |
func (t *Or_CompletionItem_documentation) UnmarshalJSON(x []byte) error { |
| 176 |
if string(x) == "null" { |
| 177 |
t.Value = nil |
| 178 |
return nil |
| 179 |
} |
| 180 |
decoder25 := json.NewDecoder(bytes.NewReader(x)) |
| 181 |
decoder25.DisallowUnknownFields() |
| 182 |
var stringVal string |
| 183 |
if err := decoder25.Decode(&stringVal); err == nil { |
| 184 |
t.Value = stringVal |
| 185 |
return nil |
| 186 |
} |
| 187 |
decoder26 := json.NewDecoder(bytes.NewReader(x)) |
| 188 |
decoder26.DisallowUnknownFields() |
| 189 |
var h26 MarkupContent |
| 190 |
if err := decoder26.Decode(&h26); err == nil { |
| 191 |
t.Value = h26 |
| 192 |
return nil |
| 193 |
} |
| 194 |
return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"} |
| 195 |
} |
| 196 |
|
| 197 |
func (t Or_CompletionItem_textEdit) MarshalJSON() ([]byte, error) { |
| 198 |
switch x := t.Value.(type) { |
| 199 |
case InsertReplaceEdit: |
| 200 |
return json.Marshal(x) |
| 201 |
case TextEdit: |
| 202 |
return json.Marshal(x) |
| 203 |
case nil: |
| 204 |
return []byte("null"), nil |
| 205 |
} |
| 206 |
return nil, fmt.Errorf("type %T not one of [InsertReplaceEdit TextEdit]", t) |
| 207 |
} |
| 208 |
|
| 209 |
func (t *Or_CompletionItem_textEdit) UnmarshalJSON(x []byte) error { |
| 210 |
if string(x) == "null" { |
| 211 |
t.Value = nil |
| 212 |
return nil |
| 213 |
} |
| 214 |
decoder29 := json.NewDecoder(bytes.NewReader(x)) |
| 215 |
decoder29.DisallowUnknownFields() |
| 216 |
var h29 InsertReplaceEdit |
| 217 |
if err := decoder29.Decode(&h29); err == nil { |
| 218 |
t.Value = h29 |
| 219 |
return nil |
| 220 |
} |
| 221 |
decoder30 := json.NewDecoder(bytes.NewReader(x)) |
| 222 |
decoder30.DisallowUnknownFields() |
| 223 |
var h30 TextEdit |
| 224 |
if err := decoder30.Decode(&h30); err == nil { |
| 225 |
t.Value = h30 |
| 226 |
return nil |
| 227 |
} |
| 228 |
return &UnmarshalError{"unmarshal failed to match one of [InsertReplaceEdit TextEdit]"} |
| 229 |
} |
| 230 |
|
| 231 |
func (t Or_Declaration) MarshalJSON() ([]byte, error) { |
| 232 |
switch x := t.Value.(type) { |
| 233 |
case Location: |
| 234 |
return json.Marshal(x) |
| 235 |
case []Location: |
| 236 |
return json.Marshal(x) |
| 237 |
case nil: |
| 238 |
return []byte("null"), nil |
| 239 |
} |
| 240 |
return nil, fmt.Errorf("type %T not one of [Location []Location]", t) |
| 241 |
} |
| 242 |
|
| 243 |
func (t *Or_Declaration) UnmarshalJSON(x []byte) error { |
| 244 |
if string(x) == "null" { |
| 245 |
t.Value = nil |
| 246 |
return nil |
| 247 |
} |
| 248 |
decoder237 := json.NewDecoder(bytes.NewReader(x)) |
| 249 |
decoder237.DisallowUnknownFields() |
| 250 |
var h237 Location |
| 251 |
if err := decoder237.Decode(&h237); err == nil { |
| 252 |
t.Value = h237 |
| 253 |
return nil |
| 254 |
} |
| 255 |
decoder238 := json.NewDecoder(bytes.NewReader(x)) |
| 256 |
decoder238.DisallowUnknownFields() |
| 257 |
var h238 []Location |
| 258 |
if err := decoder238.Decode(&h238); err == nil { |
| 259 |
t.Value = h238 |
| 260 |
return nil |
| 261 |
} |
| 262 |
return &UnmarshalError{"unmarshal failed to match one of [Location []Location]"} |
| 263 |
} |
| 264 |
|
| 265 |
func (t Or_Definition) MarshalJSON() ([]byte, error) { |
| 266 |
switch x := t.Value.(type) { |
| 267 |
case Location: |
| 268 |
return json.Marshal(x) |
| 269 |
case []Location: |
| 270 |
return json.Marshal(x) |
| 271 |
case nil: |
| 272 |
return []byte("null"), nil |
| 273 |
} |
| 274 |
return nil, fmt.Errorf("type %T not one of [Location []Location]", t) |
| 275 |
} |
| 276 |
|
| 277 |
func (t *Or_Definition) UnmarshalJSON(x []byte) error { |
| 278 |
if string(x) == "null" { |
| 279 |
t.Value = nil |
| 280 |
return nil |
| 281 |
} |
| 282 |
decoder224 := json.NewDecoder(bytes.NewReader(x)) |
| 283 |
decoder224.DisallowUnknownFields() |
| 284 |
var h224 Location |
| 285 |
if err := decoder224.Decode(&h224); err == nil { |
| 286 |
t.Value = h224 |
| 287 |
return nil |
| 288 |
} |
| 289 |
decoder225 := json.NewDecoder(bytes.NewReader(x)) |
| 290 |
decoder225.DisallowUnknownFields() |
| 291 |
var h225 []Location |
| 292 |
if err := decoder225.Decode(&h225); err == nil { |
| 293 |
t.Value = h225 |
| 294 |
return nil |
| 295 |
} |
| 296 |
return &UnmarshalError{"unmarshal failed to match one of [Location []Location]"} |
| 297 |
} |
| 298 |
|
| 299 |
func (t Or_Diagnostic_code) MarshalJSON() ([]byte, error) { |
| 300 |
switch x := t.Value.(type) { |
| 301 |
case int32: |
| 302 |
return json.Marshal(x) |
| 303 |
case string: |
| 304 |
return json.Marshal(x) |
| 305 |
case nil: |
| 306 |
return []byte("null"), nil |
| 307 |
} |
| 308 |
return nil, fmt.Errorf("type %T not one of [int32 string]", t) |
| 309 |
} |
| 310 |
|
| 311 |
func (t *Or_Diagnostic_code) UnmarshalJSON(x []byte) error { |
| 312 |
if string(x) == "null" { |
| 313 |
t.Value = nil |
| 314 |
return nil |
| 315 |
} |
| 316 |
decoder179 := json.NewDecoder(bytes.NewReader(x)) |
| 317 |
decoder179.DisallowUnknownFields() |
| 318 |
var int32Val int32 |
| 319 |
if err := decoder179.Decode(&int32Val); err == nil { |
| 320 |
t.Value = int32Val |
| 321 |
return nil |
| 322 |
} |
| 323 |
decoder180 := json.NewDecoder(bytes.NewReader(x)) |
| 324 |
decoder180.DisallowUnknownFields() |
| 325 |
var stringVal string |
| 326 |
if err := decoder180.Decode(&stringVal); err == nil { |
| 327 |
t.Value = stringVal |
| 328 |
return nil |
| 329 |
} |
| 330 |
return &UnmarshalError{"unmarshal failed to match one of [int32 string]"} |
| 331 |
} |
| 332 |
|
| 333 |
func (t Or_DidChangeConfigurationRegistrationOptions_section) MarshalJSON() ([]byte, error) { |
| 334 |
switch x := t.Value.(type) { |
| 335 |
case []string: |
| 336 |
return json.Marshal(x) |
| 337 |
case string: |
| 338 |
return json.Marshal(x) |
| 339 |
case nil: |
| 340 |
return []byte("null"), nil |
| 341 |
} |
| 342 |
return nil, fmt.Errorf("type %T not one of [[]string string]", t) |
| 343 |
} |
| 344 |
|
| 345 |
func (t *Or_DidChangeConfigurationRegistrationOptions_section) UnmarshalJSON(x []byte) error { |
| 346 |
if string(x) == "null" { |
| 347 |
t.Value = nil |
| 348 |
return nil |
| 349 |
} |
| 350 |
decoder22 := json.NewDecoder(bytes.NewReader(x)) |
| 351 |
decoder22.DisallowUnknownFields() |
| 352 |
var stringVal string |
| 353 |
if err := decoder22.Decode(&stringVal); err == nil { |
| 354 |
t.Value = stringVal |
| 355 |
return nil |
| 356 |
} |
| 357 |
decoder23 := json.NewDecoder(bytes.NewReader(x)) |
| 358 |
decoder23.DisallowUnknownFields() |
| 359 |
var h23 []string |
| 360 |
if err := decoder23.Decode(&h23); err == nil { |
| 361 |
t.Value = h23 |
| 362 |
return nil |
| 363 |
} |
| 364 |
return &UnmarshalError{"unmarshal failed to match one of [[]string string]"} |
| 365 |
} |
| 366 |
|
| 367 |
func (t Or_DocumentDiagnosticReport) MarshalJSON() ([]byte, error) { |
| 368 |
switch x := t.Value.(type) { |
| 369 |
case RelatedFullDocumentDiagnosticReport: |
| 370 |
return json.Marshal(x) |
| 371 |
case RelatedUnchangedDocumentDiagnosticReport: |
| 372 |
return json.Marshal(x) |
| 373 |
case nil: |
| 374 |
return []byte("null"), nil |
| 375 |
} |
| 376 |
return nil, fmt.Errorf("type %T not one of [RelatedFullDocumentDiagnosticReport RelatedUnchangedDocumentDiagnosticReport]", t) |
| 377 |
} |
| 378 |
|
| 379 |
func (t *Or_DocumentDiagnosticReport) UnmarshalJSON(x []byte) error { |
| 380 |
if string(x) == "null" { |
| 381 |
t.Value = nil |
| 382 |
return nil |
| 383 |
} |
| 384 |
decoder247 := json.NewDecoder(bytes.NewReader(x)) |
| 385 |
decoder247.DisallowUnknownFields() |
| 386 |
var h247 RelatedFullDocumentDiagnosticReport |
| 387 |
if err := decoder247.Decode(&h247); err == nil { |
| 388 |
t.Value = h247 |
| 389 |
return nil |
| 390 |
} |
| 391 |
decoder248 := json.NewDecoder(bytes.NewReader(x)) |
| 392 |
decoder248.DisallowUnknownFields() |
| 393 |
var h248 RelatedUnchangedDocumentDiagnosticReport |
| 394 |
if err := decoder248.Decode(&h248); err == nil { |
| 395 |
t.Value = h248 |
| 396 |
return nil |
| 397 |
} |
| 398 |
return &UnmarshalError{"unmarshal failed to match one of [RelatedFullDocumentDiagnosticReport RelatedUnchangedDocumentDiagnosticReport]"} |
| 399 |
} |
| 400 |
|
| 401 |
func (t Or_DocumentDiagnosticReportPartialResult_relatedDocuments_Value) MarshalJSON() ([]byte, error) { |
| 402 |
switch x := t.Value.(type) { |
| 403 |
case FullDocumentDiagnosticReport: |
| 404 |
return json.Marshal(x) |
| 405 |
case UnchangedDocumentDiagnosticReport: |
| 406 |
return json.Marshal(x) |
| 407 |
case nil: |
| 408 |
return []byte("null"), nil |
| 409 |
} |
| 410 |
return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t) |
| 411 |
} |
| 412 |
|
| 413 |
func (t *Or_DocumentDiagnosticReportPartialResult_relatedDocuments_Value) UnmarshalJSON(x []byte) error { |
| 414 |
if string(x) == "null" { |
| 415 |
t.Value = nil |
| 416 |
return nil |
| 417 |
} |
| 418 |
decoder16 := json.NewDecoder(bytes.NewReader(x)) |
| 419 |
decoder16.DisallowUnknownFields() |
| 420 |
var h16 FullDocumentDiagnosticReport |
| 421 |
if err := decoder16.Decode(&h16); err == nil { |
| 422 |
t.Value = h16 |
| 423 |
return nil |
| 424 |
} |
| 425 |
decoder17 := json.NewDecoder(bytes.NewReader(x)) |
| 426 |
decoder17.DisallowUnknownFields() |
| 427 |
var h17 UnchangedDocumentDiagnosticReport |
| 428 |
if err := decoder17.Decode(&h17); err == nil { |
| 429 |
t.Value = h17 |
| 430 |
return nil |
| 431 |
} |
| 432 |
return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"} |
| 433 |
} |
| 434 |
|
| 435 |
func (t Or_DocumentFilter) MarshalJSON() ([]byte, error) { |
| 436 |
switch x := t.Value.(type) { |
| 437 |
case NotebookCellTextDocumentFilter: |
| 438 |
return json.Marshal(x) |
| 439 |
case TextDocumentFilter: |
| 440 |
return json.Marshal(x) |
| 441 |
case nil: |
| 442 |
return []byte("null"), nil |
| 443 |
} |
| 444 |
return nil, fmt.Errorf("type %T not one of [NotebookCellTextDocumentFilter TextDocumentFilter]", t) |
| 445 |
} |
| 446 |
|
| 447 |
func (t *Or_DocumentFilter) UnmarshalJSON(x []byte) error { |
| 448 |
if string(x) == "null" { |
| 449 |
t.Value = nil |
| 450 |
return nil |
| 451 |
} |
| 452 |
decoder270 := json.NewDecoder(bytes.NewReader(x)) |
| 453 |
decoder270.DisallowUnknownFields() |
| 454 |
var h270 NotebookCellTextDocumentFilter |
| 455 |
if err := decoder270.Decode(&h270); err == nil { |
| 456 |
t.Value = h270 |
| 457 |
return nil |
| 458 |
} |
| 459 |
decoder271 := json.NewDecoder(bytes.NewReader(x)) |
| 460 |
decoder271.DisallowUnknownFields() |
| 461 |
var h271 TextDocumentFilter |
| 462 |
if err := decoder271.Decode(&h271); err == nil { |
| 463 |
t.Value = h271 |
| 464 |
return nil |
| 465 |
} |
| 466 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookCellTextDocumentFilter TextDocumentFilter]"} |
| 467 |
} |
| 468 |
|
| 469 |
func (t Or_GlobPattern) MarshalJSON() ([]byte, error) { |
| 470 |
switch x := t.Value.(type) { |
| 471 |
case Pattern: |
| 472 |
return json.Marshal(x) |
| 473 |
case RelativePattern: |
| 474 |
return json.Marshal(x) |
| 475 |
case nil: |
| 476 |
return []byte("null"), nil |
| 477 |
} |
| 478 |
return nil, fmt.Errorf("type %T not one of [Pattern RelativePattern]", t) |
| 479 |
} |
| 480 |
|
| 481 |
func (t *Or_GlobPattern) UnmarshalJSON(x []byte) error { |
| 482 |
if string(x) == "null" { |
| 483 |
t.Value = nil |
| 484 |
return nil |
| 485 |
} |
| 486 |
decoder274 := json.NewDecoder(bytes.NewReader(x)) |
| 487 |
decoder274.DisallowUnknownFields() |
| 488 |
var h274 Pattern |
| 489 |
if err := decoder274.Decode(&h274); err == nil { |
| 490 |
t.Value = h274 |
| 491 |
return nil |
| 492 |
} |
| 493 |
decoder275 := json.NewDecoder(bytes.NewReader(x)) |
| 494 |
decoder275.DisallowUnknownFields() |
| 495 |
var h275 RelativePattern |
| 496 |
if err := decoder275.Decode(&h275); err == nil { |
| 497 |
t.Value = h275 |
| 498 |
return nil |
| 499 |
} |
| 500 |
return &UnmarshalError{"unmarshal failed to match one of [Pattern RelativePattern]"} |
| 501 |
} |
| 502 |
|
| 503 |
func (t Or_Hover_contents) MarshalJSON() ([]byte, error) { |
| 504 |
switch x := t.Value.(type) { |
| 505 |
case MarkedString: |
| 506 |
return json.Marshal(x) |
| 507 |
case MarkupContent: |
| 508 |
return json.Marshal(x) |
| 509 |
case []MarkedString: |
| 510 |
return json.Marshal(x) |
| 511 |
case nil: |
| 512 |
return []byte("null"), nil |
| 513 |
} |
| 514 |
return nil, fmt.Errorf("type %T not one of [MarkedString MarkupContent []MarkedString]", t) |
| 515 |
} |
| 516 |
|
| 517 |
func (t *Or_Hover_contents) UnmarshalJSON(x []byte) error { |
| 518 |
if string(x) == "null" { |
| 519 |
t.Value = nil |
| 520 |
return nil |
| 521 |
} |
| 522 |
decoder34 := json.NewDecoder(bytes.NewReader(x)) |
| 523 |
decoder34.DisallowUnknownFields() |
| 524 |
var h34 MarkedString |
| 525 |
if err := decoder34.Decode(&h34); err == nil { |
| 526 |
t.Value = h34 |
| 527 |
return nil |
| 528 |
} |
| 529 |
decoder35 := json.NewDecoder(bytes.NewReader(x)) |
| 530 |
decoder35.DisallowUnknownFields() |
| 531 |
var h35 MarkupContent |
| 532 |
if err := decoder35.Decode(&h35); err == nil { |
| 533 |
t.Value = h35 |
| 534 |
return nil |
| 535 |
} |
| 536 |
decoder36 := json.NewDecoder(bytes.NewReader(x)) |
| 537 |
decoder36.DisallowUnknownFields() |
| 538 |
var h36 []MarkedString |
| 539 |
if err := decoder36.Decode(&h36); err == nil { |
| 540 |
t.Value = h36 |
| 541 |
return nil |
| 542 |
} |
| 543 |
return &UnmarshalError{"unmarshal failed to match one of [MarkedString MarkupContent []MarkedString]"} |
| 544 |
} |
| 545 |
|
| 546 |
func (t Or_InlayHintLabelPart_tooltip) MarshalJSON() ([]byte, error) { |
| 547 |
switch x := t.Value.(type) { |
| 548 |
case MarkupContent: |
| 549 |
return json.Marshal(x) |
| 550 |
case string: |
| 551 |
return json.Marshal(x) |
| 552 |
case nil: |
| 553 |
return []byte("null"), nil |
| 554 |
} |
| 555 |
return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t) |
| 556 |
} |
| 557 |
|
| 558 |
func (t *Or_InlayHintLabelPart_tooltip) UnmarshalJSON(x []byte) error { |
| 559 |
if string(x) == "null" { |
| 560 |
t.Value = nil |
| 561 |
return nil |
| 562 |
} |
| 563 |
decoder56 := json.NewDecoder(bytes.NewReader(x)) |
| 564 |
decoder56.DisallowUnknownFields() |
| 565 |
var stringVal string |
| 566 |
if err := decoder56.Decode(&stringVal); err == nil { |
| 567 |
t.Value = stringVal |
| 568 |
return nil |
| 569 |
} |
| 570 |
decoder57 := json.NewDecoder(bytes.NewReader(x)) |
| 571 |
decoder57.DisallowUnknownFields() |
| 572 |
var h57 MarkupContent |
| 573 |
if err := decoder57.Decode(&h57); err == nil { |
| 574 |
t.Value = h57 |
| 575 |
return nil |
| 576 |
} |
| 577 |
return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"} |
| 578 |
} |
| 579 |
|
| 580 |
func (t Or_InlayHint_label) MarshalJSON() ([]byte, error) { |
| 581 |
switch x := t.Value.(type) { |
| 582 |
case []InlayHintLabelPart: |
| 583 |
return json.Marshal(x) |
| 584 |
case string: |
| 585 |
return json.Marshal(x) |
| 586 |
case nil: |
| 587 |
return []byte("null"), nil |
| 588 |
} |
| 589 |
return nil, fmt.Errorf("type %T not one of [[]InlayHintLabelPart string]", t) |
| 590 |
} |
| 591 |
|
| 592 |
func (t *Or_InlayHint_label) UnmarshalJSON(x []byte) error { |
| 593 |
if string(x) == "null" { |
| 594 |
t.Value = nil |
| 595 |
return nil |
| 596 |
} |
| 597 |
decoder9 := json.NewDecoder(bytes.NewReader(x)) |
| 598 |
decoder9.DisallowUnknownFields() |
| 599 |
var stringVal string |
| 600 |
if err := decoder9.Decode(&stringVal); err == nil { |
| 601 |
t.Value = stringVal |
| 602 |
return nil |
| 603 |
} |
| 604 |
decoder10 := json.NewDecoder(bytes.NewReader(x)) |
| 605 |
decoder10.DisallowUnknownFields() |
| 606 |
var h10 []InlayHintLabelPart |
| 607 |
if err := decoder10.Decode(&h10); err == nil { |
| 608 |
t.Value = h10 |
| 609 |
return nil |
| 610 |
} |
| 611 |
return &UnmarshalError{"unmarshal failed to match one of [[]InlayHintLabelPart string]"} |
| 612 |
} |
| 613 |
|
| 614 |
func (t Or_InlayHint_tooltip) MarshalJSON() ([]byte, error) { |
| 615 |
switch x := t.Value.(type) { |
| 616 |
case MarkupContent: |
| 617 |
return json.Marshal(x) |
| 618 |
case string: |
| 619 |
return json.Marshal(x) |
| 620 |
case nil: |
| 621 |
return []byte("null"), nil |
| 622 |
} |
| 623 |
return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t) |
| 624 |
} |
| 625 |
|
| 626 |
func (t *Or_InlayHint_tooltip) UnmarshalJSON(x []byte) error { |
| 627 |
if string(x) == "null" { |
| 628 |
t.Value = nil |
| 629 |
return nil |
| 630 |
} |
| 631 |
decoder12 := json.NewDecoder(bytes.NewReader(x)) |
| 632 |
decoder12.DisallowUnknownFields() |
| 633 |
var stringVal string |
| 634 |
if err := decoder12.Decode(&stringVal); err == nil { |
| 635 |
t.Value = stringVal |
| 636 |
return nil |
| 637 |
} |
| 638 |
decoder13 := json.NewDecoder(bytes.NewReader(x)) |
| 639 |
decoder13.DisallowUnknownFields() |
| 640 |
var h13 MarkupContent |
| 641 |
if err := decoder13.Decode(&h13); err == nil { |
| 642 |
t.Value = h13 |
| 643 |
return nil |
| 644 |
} |
| 645 |
return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"} |
| 646 |
} |
| 647 |
|
| 648 |
func (t Or_InlineCompletionItem_insertText) MarshalJSON() ([]byte, error) { |
| 649 |
switch x := t.Value.(type) { |
| 650 |
case StringValue: |
| 651 |
return json.Marshal(x) |
| 652 |
case string: |
| 653 |
return json.Marshal(x) |
| 654 |
case nil: |
| 655 |
return []byte("null"), nil |
| 656 |
} |
| 657 |
return nil, fmt.Errorf("type %T not one of [StringValue string]", t) |
| 658 |
} |
| 659 |
|
| 660 |
func (t *Or_InlineCompletionItem_insertText) UnmarshalJSON(x []byte) error { |
| 661 |
if string(x) == "null" { |
| 662 |
t.Value = nil |
| 663 |
return nil |
| 664 |
} |
| 665 |
decoder19 := json.NewDecoder(bytes.NewReader(x)) |
| 666 |
decoder19.DisallowUnknownFields() |
| 667 |
var stringVal string |
| 668 |
if err := decoder19.Decode(&stringVal); err == nil { |
| 669 |
t.Value = stringVal |
| 670 |
return nil |
| 671 |
} |
| 672 |
decoder20 := json.NewDecoder(bytes.NewReader(x)) |
| 673 |
decoder20.DisallowUnknownFields() |
| 674 |
var h20 StringValue |
| 675 |
if err := decoder20.Decode(&h20); err == nil { |
| 676 |
t.Value = h20 |
| 677 |
return nil |
| 678 |
} |
| 679 |
return &UnmarshalError{"unmarshal failed to match one of [StringValue string]"} |
| 680 |
} |
| 681 |
|
| 682 |
func (t Or_InlineValue) MarshalJSON() ([]byte, error) { |
| 683 |
switch x := t.Value.(type) { |
| 684 |
case InlineValueEvaluatableExpression: |
| 685 |
return json.Marshal(x) |
| 686 |
case InlineValueText: |
| 687 |
return json.Marshal(x) |
| 688 |
case InlineValueVariableLookup: |
| 689 |
return json.Marshal(x) |
| 690 |
case nil: |
| 691 |
return []byte("null"), nil |
| 692 |
} |
| 693 |
return nil, fmt.Errorf("type %T not one of [InlineValueEvaluatableExpression InlineValueText InlineValueVariableLookup]", t) |
| 694 |
} |
| 695 |
|
| 696 |
func (t *Or_InlineValue) UnmarshalJSON(x []byte) error { |
| 697 |
if string(x) == "null" { |
| 698 |
t.Value = nil |
| 699 |
return nil |
| 700 |
} |
| 701 |
decoder242 := json.NewDecoder(bytes.NewReader(x)) |
| 702 |
decoder242.DisallowUnknownFields() |
| 703 |
var h242 InlineValueEvaluatableExpression |
| 704 |
if err := decoder242.Decode(&h242); err == nil { |
| 705 |
t.Value = h242 |
| 706 |
return nil |
| 707 |
} |
| 708 |
decoder243 := json.NewDecoder(bytes.NewReader(x)) |
| 709 |
decoder243.DisallowUnknownFields() |
| 710 |
var h243 InlineValueText |
| 711 |
if err := decoder243.Decode(&h243); err == nil { |
| 712 |
t.Value = h243 |
| 713 |
return nil |
| 714 |
} |
| 715 |
decoder244 := json.NewDecoder(bytes.NewReader(x)) |
| 716 |
decoder244.DisallowUnknownFields() |
| 717 |
var h244 InlineValueVariableLookup |
| 718 |
if err := decoder244.Decode(&h244); err == nil { |
| 719 |
t.Value = h244 |
| 720 |
return nil |
| 721 |
} |
| 722 |
return &UnmarshalError{"unmarshal failed to match one of [InlineValueEvaluatableExpression InlineValueText InlineValueVariableLookup]"} |
| 723 |
} |
| 724 |
|
| 725 |
func (t Or_LSPAny) MarshalJSON() ([]byte, error) { |
| 726 |
switch x := t.Value.(type) { |
| 727 |
case LSPArray: |
| 728 |
return json.Marshal(x) |
| 729 |
case LSPObject: |
| 730 |
return json.Marshal(x) |
| 731 |
case bool: |
| 732 |
return json.Marshal(x) |
| 733 |
case float64: |
| 734 |
return json.Marshal(x) |
| 735 |
case int32: |
| 736 |
return json.Marshal(x) |
| 737 |
case string: |
| 738 |
return json.Marshal(x) |
| 739 |
case uint32: |
| 740 |
return json.Marshal(x) |
| 741 |
case nil: |
| 742 |
return []byte("null"), nil |
| 743 |
} |
| 744 |
return nil, fmt.Errorf("type %T not one of [LSPArray LSPObject bool float64 int32 string uint32]", t) |
| 745 |
} |
| 746 |
|
| 747 |
func (t *Or_LSPAny) UnmarshalJSON(x []byte) error { |
| 748 |
if string(x) == "null" { |
| 749 |
t.Value = nil |
| 750 |
return nil |
| 751 |
} |
| 752 |
decoder228 := json.NewDecoder(bytes.NewReader(x)) |
| 753 |
decoder228.DisallowUnknownFields() |
| 754 |
var boolVal bool |
| 755 |
if err := decoder228.Decode(&boolVal); err == nil { |
| 756 |
t.Value = boolVal |
| 757 |
return nil |
| 758 |
} |
| 759 |
decoder229 := json.NewDecoder(bytes.NewReader(x)) |
| 760 |
decoder229.DisallowUnknownFields() |
| 761 |
var float64Val float64 |
| 762 |
if err := decoder229.Decode(&float64Val); err == nil { |
| 763 |
t.Value = float64Val |
| 764 |
return nil |
| 765 |
} |
| 766 |
decoder230 := json.NewDecoder(bytes.NewReader(x)) |
| 767 |
decoder230.DisallowUnknownFields() |
| 768 |
var int32Val int32 |
| 769 |
if err := decoder230.Decode(&int32Val); err == nil { |
| 770 |
t.Value = int32Val |
| 771 |
return nil |
| 772 |
} |
| 773 |
decoder231 := json.NewDecoder(bytes.NewReader(x)) |
| 774 |
decoder231.DisallowUnknownFields() |
| 775 |
var stringVal string |
| 776 |
if err := decoder231.Decode(&stringVal); err == nil { |
| 777 |
t.Value = stringVal |
| 778 |
return nil |
| 779 |
} |
| 780 |
decoder232 := json.NewDecoder(bytes.NewReader(x)) |
| 781 |
decoder232.DisallowUnknownFields() |
| 782 |
var uint32Val uint32 |
| 783 |
if err := decoder232.Decode(&uint32Val); err == nil { |
| 784 |
t.Value = uint32Val |
| 785 |
return nil |
| 786 |
} |
| 787 |
decoder233 := json.NewDecoder(bytes.NewReader(x)) |
| 788 |
decoder233.DisallowUnknownFields() |
| 789 |
var h233 LSPArray |
| 790 |
if err := decoder233.Decode(&h233); err == nil { |
| 791 |
t.Value = h233 |
| 792 |
return nil |
| 793 |
} |
| 794 |
decoder234 := json.NewDecoder(bytes.NewReader(x)) |
| 795 |
decoder234.DisallowUnknownFields() |
| 796 |
var h234 LSPObject |
| 797 |
if err := decoder234.Decode(&h234); err == nil { |
| 798 |
t.Value = h234 |
| 799 |
return nil |
| 800 |
} |
| 801 |
return &UnmarshalError{"unmarshal failed to match one of [LSPArray LSPObject bool float64 int32 string uint32]"} |
| 802 |
} |
| 803 |
|
| 804 |
func (t Or_MarkedString) MarshalJSON() ([]byte, error) { |
| 805 |
switch x := t.Value.(type) { |
| 806 |
case MarkedStringWithLanguage: |
| 807 |
return json.Marshal(x) |
| 808 |
case string: |
| 809 |
return json.Marshal(x) |
| 810 |
case nil: |
| 811 |
return []byte("null"), nil |
| 812 |
} |
| 813 |
return nil, fmt.Errorf("type %T not one of [MarkedStringWithLanguage string]", t) |
| 814 |
} |
| 815 |
|
| 816 |
func (t *Or_MarkedString) UnmarshalJSON(x []byte) error { |
| 817 |
if string(x) == "null" { |
| 818 |
t.Value = nil |
| 819 |
return nil |
| 820 |
} |
| 821 |
decoder266 := json.NewDecoder(bytes.NewReader(x)) |
| 822 |
decoder266.DisallowUnknownFields() |
| 823 |
var stringVal string |
| 824 |
if err := decoder266.Decode(&stringVal); err == nil { |
| 825 |
t.Value = stringVal |
| 826 |
return nil |
| 827 |
} |
| 828 |
decoder267 := json.NewDecoder(bytes.NewReader(x)) |
| 829 |
decoder267.DisallowUnknownFields() |
| 830 |
var h267 MarkedStringWithLanguage |
| 831 |
if err := decoder267.Decode(&h267); err == nil { |
| 832 |
t.Value = h267 |
| 833 |
return nil |
| 834 |
} |
| 835 |
return &UnmarshalError{"unmarshal failed to match one of [MarkedStringWithLanguage string]"} |
| 836 |
} |
| 837 |
|
| 838 |
func (t Or_NotebookCellTextDocumentFilter_notebook) MarshalJSON() ([]byte, error) { |
| 839 |
switch x := t.Value.(type) { |
| 840 |
case NotebookDocumentFilter: |
| 841 |
return json.Marshal(x) |
| 842 |
case string: |
| 843 |
return json.Marshal(x) |
| 844 |
case nil: |
| 845 |
return []byte("null"), nil |
| 846 |
} |
| 847 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t) |
| 848 |
} |
| 849 |
|
| 850 |
func (t *Or_NotebookCellTextDocumentFilter_notebook) UnmarshalJSON(x []byte) error { |
| 851 |
if string(x) == "null" { |
| 852 |
t.Value = nil |
| 853 |
return nil |
| 854 |
} |
| 855 |
decoder208 := json.NewDecoder(bytes.NewReader(x)) |
| 856 |
decoder208.DisallowUnknownFields() |
| 857 |
var stringVal string |
| 858 |
if err := decoder208.Decode(&stringVal); err == nil { |
| 859 |
t.Value = stringVal |
| 860 |
return nil |
| 861 |
} |
| 862 |
decoder209 := json.NewDecoder(bytes.NewReader(x)) |
| 863 |
decoder209.DisallowUnknownFields() |
| 864 |
var h209 NotebookDocumentFilter |
| 865 |
if err := decoder209.Decode(&h209); err == nil { |
| 866 |
t.Value = h209 |
| 867 |
return nil |
| 868 |
} |
| 869 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"} |
| 870 |
} |
| 871 |
|
| 872 |
func (t Or_NotebookDocumentFilter) MarshalJSON() ([]byte, error) { |
| 873 |
switch x := t.Value.(type) { |
| 874 |
case NotebookDocumentFilterNotebookType: |
| 875 |
return json.Marshal(x) |
| 876 |
case NotebookDocumentFilterPattern: |
| 877 |
return json.Marshal(x) |
| 878 |
case NotebookDocumentFilterScheme: |
| 879 |
return json.Marshal(x) |
| 880 |
case nil: |
| 881 |
return []byte("null"), nil |
| 882 |
} |
| 883 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilterNotebookType NotebookDocumentFilterPattern NotebookDocumentFilterScheme]", t) |
| 884 |
} |
| 885 |
|
| 886 |
func (t *Or_NotebookDocumentFilter) UnmarshalJSON(x []byte) error { |
| 887 |
if string(x) == "null" { |
| 888 |
t.Value = nil |
| 889 |
return nil |
| 890 |
} |
| 891 |
decoder285 := json.NewDecoder(bytes.NewReader(x)) |
| 892 |
decoder285.DisallowUnknownFields() |
| 893 |
var h285 NotebookDocumentFilterNotebookType |
| 894 |
if err := decoder285.Decode(&h285); err == nil { |
| 895 |
t.Value = h285 |
| 896 |
return nil |
| 897 |
} |
| 898 |
decoder286 := json.NewDecoder(bytes.NewReader(x)) |
| 899 |
decoder286.DisallowUnknownFields() |
| 900 |
var h286 NotebookDocumentFilterPattern |
| 901 |
if err := decoder286.Decode(&h286); err == nil { |
| 902 |
t.Value = h286 |
| 903 |
return nil |
| 904 |
} |
| 905 |
decoder287 := json.NewDecoder(bytes.NewReader(x)) |
| 906 |
decoder287.DisallowUnknownFields() |
| 907 |
var h287 NotebookDocumentFilterScheme |
| 908 |
if err := decoder287.Decode(&h287); err == nil { |
| 909 |
t.Value = h287 |
| 910 |
return nil |
| 911 |
} |
| 912 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilterNotebookType NotebookDocumentFilterPattern NotebookDocumentFilterScheme]"} |
| 913 |
} |
| 914 |
|
| 915 |
func (t Or_NotebookDocumentFilterWithCells_notebook) MarshalJSON() ([]byte, error) { |
| 916 |
switch x := t.Value.(type) { |
| 917 |
case NotebookDocumentFilter: |
| 918 |
return json.Marshal(x) |
| 919 |
case string: |
| 920 |
return json.Marshal(x) |
| 921 |
case nil: |
| 922 |
return []byte("null"), nil |
| 923 |
} |
| 924 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t) |
| 925 |
} |
| 926 |
|
| 927 |
func (t *Or_NotebookDocumentFilterWithCells_notebook) UnmarshalJSON(x []byte) error { |
| 928 |
if string(x) == "null" { |
| 929 |
t.Value = nil |
| 930 |
return nil |
| 931 |
} |
| 932 |
decoder192 := json.NewDecoder(bytes.NewReader(x)) |
| 933 |
decoder192.DisallowUnknownFields() |
| 934 |
var stringVal string |
| 935 |
if err := decoder192.Decode(&stringVal); err == nil { |
| 936 |
t.Value = stringVal |
| 937 |
return nil |
| 938 |
} |
| 939 |
decoder193 := json.NewDecoder(bytes.NewReader(x)) |
| 940 |
decoder193.DisallowUnknownFields() |
| 941 |
var h193 NotebookDocumentFilter |
| 942 |
if err := decoder193.Decode(&h193); err == nil { |
| 943 |
t.Value = h193 |
| 944 |
return nil |
| 945 |
} |
| 946 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"} |
| 947 |
} |
| 948 |
|
| 949 |
func (t Or_NotebookDocumentFilterWithNotebook_notebook) MarshalJSON() ([]byte, error) { |
| 950 |
switch x := t.Value.(type) { |
| 951 |
case NotebookDocumentFilter: |
| 952 |
return json.Marshal(x) |
| 953 |
case string: |
| 954 |
return json.Marshal(x) |
| 955 |
case nil: |
| 956 |
return []byte("null"), nil |
| 957 |
} |
| 958 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t) |
| 959 |
} |
| 960 |
|
| 961 |
func (t *Or_NotebookDocumentFilterWithNotebook_notebook) UnmarshalJSON(x []byte) error { |
| 962 |
if string(x) == "null" { |
| 963 |
t.Value = nil |
| 964 |
return nil |
| 965 |
} |
| 966 |
decoder189 := json.NewDecoder(bytes.NewReader(x)) |
| 967 |
decoder189.DisallowUnknownFields() |
| 968 |
var stringVal string |
| 969 |
if err := decoder189.Decode(&stringVal); err == nil { |
| 970 |
t.Value = stringVal |
| 971 |
return nil |
| 972 |
} |
| 973 |
decoder190 := json.NewDecoder(bytes.NewReader(x)) |
| 974 |
decoder190.DisallowUnknownFields() |
| 975 |
var h190 NotebookDocumentFilter |
| 976 |
if err := decoder190.Decode(&h190); err == nil { |
| 977 |
t.Value = h190 |
| 978 |
return nil |
| 979 |
} |
| 980 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"} |
| 981 |
} |
| 982 |
|
| 983 |
func (t Or_NotebookDocumentSyncOptions_notebookSelector_Elem) MarshalJSON() ([]byte, error) { |
| 984 |
switch x := t.Value.(type) { |
| 985 |
case NotebookDocumentFilterWithCells: |
| 986 |
return json.Marshal(x) |
| 987 |
case NotebookDocumentFilterWithNotebook: |
| 988 |
return json.Marshal(x) |
| 989 |
case nil: |
| 990 |
return []byte("null"), nil |
| 991 |
} |
| 992 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilterWithCells NotebookDocumentFilterWithNotebook]", t) |
| 993 |
} |
| 994 |
|
| 995 |
func (t *Or_NotebookDocumentSyncOptions_notebookSelector_Elem) UnmarshalJSON(x []byte) error { |
| 996 |
if string(x) == "null" { |
| 997 |
t.Value = nil |
| 998 |
return nil |
| 999 |
} |
| 1000 |
decoder68 := json.NewDecoder(bytes.NewReader(x)) |
| 1001 |
decoder68.DisallowUnknownFields() |
| 1002 |
var h68 NotebookDocumentFilterWithCells |
| 1003 |
if err := decoder68.Decode(&h68); err == nil { |
| 1004 |
t.Value = h68 |
| 1005 |
return nil |
| 1006 |
} |
| 1007 |
decoder69 := json.NewDecoder(bytes.NewReader(x)) |
| 1008 |
decoder69.DisallowUnknownFields() |
| 1009 |
var h69 NotebookDocumentFilterWithNotebook |
| 1010 |
if err := decoder69.Decode(&h69); err == nil { |
| 1011 |
t.Value = h69 |
| 1012 |
return nil |
| 1013 |
} |
| 1014 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilterWithCells NotebookDocumentFilterWithNotebook]"} |
| 1015 |
} |
| 1016 |
|
| 1017 |
func (t Or_ParameterInformation_documentation) MarshalJSON() ([]byte, error) { |
| 1018 |
switch x := t.Value.(type) { |
| 1019 |
case MarkupContent: |
| 1020 |
return json.Marshal(x) |
| 1021 |
case string: |
| 1022 |
return json.Marshal(x) |
| 1023 |
case nil: |
| 1024 |
return []byte("null"), nil |
| 1025 |
} |
| 1026 |
return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t) |
| 1027 |
} |
| 1028 |
|
| 1029 |
func (t *Or_ParameterInformation_documentation) UnmarshalJSON(x []byte) error { |
| 1030 |
if string(x) == "null" { |
| 1031 |
t.Value = nil |
| 1032 |
return nil |
| 1033 |
} |
| 1034 |
decoder205 := json.NewDecoder(bytes.NewReader(x)) |
| 1035 |
decoder205.DisallowUnknownFields() |
| 1036 |
var stringVal string |
| 1037 |
if err := decoder205.Decode(&stringVal); err == nil { |
| 1038 |
t.Value = stringVal |
| 1039 |
return nil |
| 1040 |
} |
| 1041 |
decoder206 := json.NewDecoder(bytes.NewReader(x)) |
| 1042 |
decoder206.DisallowUnknownFields() |
| 1043 |
var h206 MarkupContent |
| 1044 |
if err := decoder206.Decode(&h206); err == nil { |
| 1045 |
t.Value = h206 |
| 1046 |
return nil |
| 1047 |
} |
| 1048 |
return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"} |
| 1049 |
} |
| 1050 |
|
| 1051 |
func (t Or_ParameterInformation_label) MarshalJSON() ([]byte, error) { |
| 1052 |
switch x := t.Value.(type) { |
| 1053 |
case Tuple_ParameterInformation_label_Item1: |
| 1054 |
return json.Marshal(x) |
| 1055 |
case string: |
| 1056 |
return json.Marshal(x) |
| 1057 |
case nil: |
| 1058 |
return []byte("null"), nil |
| 1059 |
} |
| 1060 |
return nil, fmt.Errorf("type %T not one of [Tuple_ParameterInformation_label_Item1 string]", t) |
| 1061 |
} |
| 1062 |
|
| 1063 |
func (t *Or_ParameterInformation_label) UnmarshalJSON(x []byte) error { |
| 1064 |
if string(x) == "null" { |
| 1065 |
t.Value = nil |
| 1066 |
return nil |
| 1067 |
} |
| 1068 |
decoder202 := json.NewDecoder(bytes.NewReader(x)) |
| 1069 |
decoder202.DisallowUnknownFields() |
| 1070 |
var stringVal string |
| 1071 |
if err := decoder202.Decode(&stringVal); err == nil { |
| 1072 |
t.Value = stringVal |
| 1073 |
return nil |
| 1074 |
} |
| 1075 |
decoder203 := json.NewDecoder(bytes.NewReader(x)) |
| 1076 |
decoder203.DisallowUnknownFields() |
| 1077 |
var h203 Tuple_ParameterInformation_label_Item1 |
| 1078 |
if err := decoder203.Decode(&h203); err == nil { |
| 1079 |
t.Value = h203 |
| 1080 |
return nil |
| 1081 |
} |
| 1082 |
return &UnmarshalError{"unmarshal failed to match one of [Tuple_ParameterInformation_label_Item1 string]"} |
| 1083 |
} |
| 1084 |
|
| 1085 |
func (t Or_PrepareRenameResult) MarshalJSON() ([]byte, error) { |
| 1086 |
switch x := t.Value.(type) { |
| 1087 |
case PrepareRenameDefaultBehavior: |
| 1088 |
return json.Marshal(x) |
| 1089 |
case PrepareRenamePlaceholder: |
| 1090 |
return json.Marshal(x) |
| 1091 |
case Range: |
| 1092 |
return json.Marshal(x) |
| 1093 |
case nil: |
| 1094 |
return []byte("null"), nil |
| 1095 |
} |
| 1096 |
return nil, fmt.Errorf("type %T not one of [PrepareRenameDefaultBehavior PrepareRenamePlaceholder Range]", t) |
| 1097 |
} |
| 1098 |
|
| 1099 |
func (t *Or_PrepareRenameResult) UnmarshalJSON(x []byte) error { |
| 1100 |
if string(x) == "null" { |
| 1101 |
t.Value = nil |
| 1102 |
return nil |
| 1103 |
} |
| 1104 |
decoder252 := json.NewDecoder(bytes.NewReader(x)) |
| 1105 |
decoder252.DisallowUnknownFields() |
| 1106 |
var h252 PrepareRenameDefaultBehavior |
| 1107 |
if err := decoder252.Decode(&h252); err == nil { |
| 1108 |
t.Value = h252 |
| 1109 |
return nil |
| 1110 |
} |
| 1111 |
decoder253 := json.NewDecoder(bytes.NewReader(x)) |
| 1112 |
decoder253.DisallowUnknownFields() |
| 1113 |
var h253 PrepareRenamePlaceholder |
| 1114 |
if err := decoder253.Decode(&h253); err == nil { |
| 1115 |
t.Value = h253 |
| 1116 |
return nil |
| 1117 |
} |
| 1118 |
decoder254 := json.NewDecoder(bytes.NewReader(x)) |
| 1119 |
decoder254.DisallowUnknownFields() |
| 1120 |
var h254 Range |
| 1121 |
if err := decoder254.Decode(&h254); err == nil { |
| 1122 |
t.Value = h254 |
| 1123 |
return nil |
| 1124 |
} |
| 1125 |
return &UnmarshalError{"unmarshal failed to match one of [PrepareRenameDefaultBehavior PrepareRenamePlaceholder Range]"} |
| 1126 |
} |
| 1127 |
|
| 1128 |
func (t Or_ProgressToken) MarshalJSON() ([]byte, error) { |
| 1129 |
switch x := t.Value.(type) { |
| 1130 |
case int32: |
| 1131 |
return json.Marshal(x) |
| 1132 |
case string: |
| 1133 |
return json.Marshal(x) |
| 1134 |
case nil: |
| 1135 |
return []byte("null"), nil |
| 1136 |
} |
| 1137 |
return nil, fmt.Errorf("type %T not one of [int32 string]", t) |
| 1138 |
} |
| 1139 |
|
| 1140 |
func (t *Or_ProgressToken) UnmarshalJSON(x []byte) error { |
| 1141 |
if string(x) == "null" { |
| 1142 |
t.Value = nil |
| 1143 |
return nil |
| 1144 |
} |
| 1145 |
decoder255 := json.NewDecoder(bytes.NewReader(x)) |
| 1146 |
decoder255.DisallowUnknownFields() |
| 1147 |
var int32Val int32 |
| 1148 |
if err := decoder255.Decode(&int32Val); err == nil { |
| 1149 |
t.Value = int32Val |
| 1150 |
return nil |
| 1151 |
} |
| 1152 |
decoder256 := json.NewDecoder(bytes.NewReader(x)) |
| 1153 |
decoder256.DisallowUnknownFields() |
| 1154 |
var stringVal string |
| 1155 |
if err := decoder256.Decode(&stringVal); err == nil { |
| 1156 |
t.Value = stringVal |
| 1157 |
return nil |
| 1158 |
} |
| 1159 |
return &UnmarshalError{"unmarshal failed to match one of [int32 string]"} |
| 1160 |
} |
| 1161 |
|
| 1162 |
func (t Or_RelatedFullDocumentDiagnosticReport_relatedDocuments_Value) MarshalJSON() ([]byte, error) { |
| 1163 |
switch x := t.Value.(type) { |
| 1164 |
case FullDocumentDiagnosticReport: |
| 1165 |
return json.Marshal(x) |
| 1166 |
case UnchangedDocumentDiagnosticReport: |
| 1167 |
return json.Marshal(x) |
| 1168 |
case nil: |
| 1169 |
return []byte("null"), nil |
| 1170 |
} |
| 1171 |
return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t) |
| 1172 |
} |
| 1173 |
|
| 1174 |
func (t *Or_RelatedFullDocumentDiagnosticReport_relatedDocuments_Value) UnmarshalJSON(x []byte) error { |
| 1175 |
if string(x) == "null" { |
| 1176 |
t.Value = nil |
| 1177 |
return nil |
| 1178 |
} |
| 1179 |
decoder60 := json.NewDecoder(bytes.NewReader(x)) |
| 1180 |
decoder60.DisallowUnknownFields() |
| 1181 |
var h60 FullDocumentDiagnosticReport |
| 1182 |
if err := decoder60.Decode(&h60); err == nil { |
| 1183 |
t.Value = h60 |
| 1184 |
return nil |
| 1185 |
} |
| 1186 |
decoder61 := json.NewDecoder(bytes.NewReader(x)) |
| 1187 |
decoder61.DisallowUnknownFields() |
| 1188 |
var h61 UnchangedDocumentDiagnosticReport |
| 1189 |
if err := decoder61.Decode(&h61); err == nil { |
| 1190 |
t.Value = h61 |
| 1191 |
return nil |
| 1192 |
} |
| 1193 |
return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"} |
| 1194 |
} |
| 1195 |
|
| 1196 |
func (t Or_RelatedUnchangedDocumentDiagnosticReport_relatedDocuments_Value) MarshalJSON() ([]byte, error) { |
| 1197 |
switch x := t.Value.(type) { |
| 1198 |
case FullDocumentDiagnosticReport: |
| 1199 |
return json.Marshal(x) |
| 1200 |
case UnchangedDocumentDiagnosticReport: |
| 1201 |
return json.Marshal(x) |
| 1202 |
case nil: |
| 1203 |
return []byte("null"), nil |
| 1204 |
} |
| 1205 |
return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t) |
| 1206 |
} |
| 1207 |
|
| 1208 |
func (t *Or_RelatedUnchangedDocumentDiagnosticReport_relatedDocuments_Value) UnmarshalJSON(x []byte) error { |
| 1209 |
if string(x) == "null" { |
| 1210 |
t.Value = nil |
| 1211 |
return nil |
| 1212 |
} |
| 1213 |
decoder64 := json.NewDecoder(bytes.NewReader(x)) |
| 1214 |
decoder64.DisallowUnknownFields() |
| 1215 |
var h64 FullDocumentDiagnosticReport |
| 1216 |
if err := decoder64.Decode(&h64); err == nil { |
| 1217 |
t.Value = h64 |
| 1218 |
return nil |
| 1219 |
} |
| 1220 |
decoder65 := json.NewDecoder(bytes.NewReader(x)) |
| 1221 |
decoder65.DisallowUnknownFields() |
| 1222 |
var h65 UnchangedDocumentDiagnosticReport |
| 1223 |
if err := decoder65.Decode(&h65); err == nil { |
| 1224 |
t.Value = h65 |
| 1225 |
return nil |
| 1226 |
} |
| 1227 |
return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"} |
| 1228 |
} |
| 1229 |
|
| 1230 |
func (t Or_RelativePattern_baseUri) MarshalJSON() ([]byte, error) { |
| 1231 |
switch x := t.Value.(type) { |
| 1232 |
case URI: |
| 1233 |
return json.Marshal(x) |
| 1234 |
case WorkspaceFolder: |
| 1235 |
return json.Marshal(x) |
| 1236 |
case nil: |
| 1237 |
return []byte("null"), nil |
| 1238 |
} |
| 1239 |
return nil, fmt.Errorf("type %T not one of [URI WorkspaceFolder]", t) |
| 1240 |
} |
| 1241 |
|
| 1242 |
func (t *Or_RelativePattern_baseUri) UnmarshalJSON(x []byte) error { |
| 1243 |
if string(x) == "null" { |
| 1244 |
t.Value = nil |
| 1245 |
return nil |
| 1246 |
} |
| 1247 |
decoder214 := json.NewDecoder(bytes.NewReader(x)) |
| 1248 |
decoder214.DisallowUnknownFields() |
| 1249 |
var h214 URI |
| 1250 |
if err := decoder214.Decode(&h214); err == nil { |
| 1251 |
t.Value = h214 |
| 1252 |
return nil |
| 1253 |
} |
| 1254 |
decoder215 := json.NewDecoder(bytes.NewReader(x)) |
| 1255 |
decoder215.DisallowUnknownFields() |
| 1256 |
var h215 WorkspaceFolder |
| 1257 |
if err := decoder215.Decode(&h215); err == nil { |
| 1258 |
t.Value = h215 |
| 1259 |
return nil |
| 1260 |
} |
| 1261 |
return &UnmarshalError{"unmarshal failed to match one of [URI WorkspaceFolder]"} |
| 1262 |
} |
| 1263 |
|
| 1264 |
func (t Or_Result_textDocument_codeAction_Item0_Elem) MarshalJSON() ([]byte, error) { |
| 1265 |
switch x := t.Value.(type) { |
| 1266 |
case CodeAction: |
| 1267 |
return json.Marshal(x) |
| 1268 |
case Command: |
| 1269 |
return json.Marshal(x) |
| 1270 |
case nil: |
| 1271 |
return []byte("null"), nil |
| 1272 |
} |
| 1273 |
return nil, fmt.Errorf("type %T not one of [CodeAction Command]", t) |
| 1274 |
} |
| 1275 |
|
| 1276 |
func (t *Or_Result_textDocument_codeAction_Item0_Elem) UnmarshalJSON(x []byte) error { |
| 1277 |
if string(x) == "null" { |
| 1278 |
t.Value = nil |
| 1279 |
return nil |
| 1280 |
} |
| 1281 |
decoder322 := json.NewDecoder(bytes.NewReader(x)) |
| 1282 |
decoder322.DisallowUnknownFields() |
| 1283 |
var h322 CodeAction |
| 1284 |
if err := decoder322.Decode(&h322); err == nil { |
| 1285 |
t.Value = h322 |
| 1286 |
return nil |
| 1287 |
} |
| 1288 |
decoder323 := json.NewDecoder(bytes.NewReader(x)) |
| 1289 |
decoder323.DisallowUnknownFields() |
| 1290 |
var h323 Command |
| 1291 |
if err := decoder323.Decode(&h323); err == nil { |
| 1292 |
t.Value = h323 |
| 1293 |
return nil |
| 1294 |
} |
| 1295 |
return &UnmarshalError{"unmarshal failed to match one of [CodeAction Command]"} |
| 1296 |
} |
| 1297 |
|
| 1298 |
func (t Or_Result_textDocument_completion) MarshalJSON() ([]byte, error) { |
| 1299 |
switch x := t.Value.(type) { |
| 1300 |
case CompletionList: |
| 1301 |
return json.Marshal(x) |
| 1302 |
case []CompletionItem: |
| 1303 |
return json.Marshal(x) |
| 1304 |
case nil: |
| 1305 |
return []byte("null"), nil |
| 1306 |
} |
| 1307 |
return nil, fmt.Errorf("type %T not one of [CompletionList []CompletionItem]", t) |
| 1308 |
} |
| 1309 |
|
| 1310 |
func (t *Or_Result_textDocument_completion) UnmarshalJSON(x []byte) error { |
| 1311 |
if string(x) == "null" { |
| 1312 |
t.Value = nil |
| 1313 |
return nil |
| 1314 |
} |
| 1315 |
decoder310 := json.NewDecoder(bytes.NewReader(x)) |
| 1316 |
decoder310.DisallowUnknownFields() |
| 1317 |
var h310 CompletionList |
| 1318 |
if err := decoder310.Decode(&h310); err == nil { |
| 1319 |
t.Value = h310 |
| 1320 |
return nil |
| 1321 |
} |
| 1322 |
decoder311 := json.NewDecoder(bytes.NewReader(x)) |
| 1323 |
decoder311.DisallowUnknownFields() |
| 1324 |
var h311 []CompletionItem |
| 1325 |
if err := decoder311.Decode(&h311); err == nil { |
| 1326 |
t.Value = h311 |
| 1327 |
return nil |
| 1328 |
} |
| 1329 |
return &UnmarshalError{"unmarshal failed to match one of [CompletionList []CompletionItem]"} |
| 1330 |
} |
| 1331 |
|
| 1332 |
func (t Or_Result_textDocument_declaration) MarshalJSON() ([]byte, error) { |
| 1333 |
switch x := t.Value.(type) { |
| 1334 |
case Declaration: |
| 1335 |
return json.Marshal(x) |
| 1336 |
case []DeclarationLink: |
| 1337 |
return json.Marshal(x) |
| 1338 |
case nil: |
| 1339 |
return []byte("null"), nil |
| 1340 |
} |
| 1341 |
return nil, fmt.Errorf("type %T not one of [Declaration []DeclarationLink]", t) |
| 1342 |
} |
| 1343 |
|
| 1344 |
func (t *Or_Result_textDocument_declaration) UnmarshalJSON(x []byte) error { |
| 1345 |
if string(x) == "null" { |
| 1346 |
t.Value = nil |
| 1347 |
return nil |
| 1348 |
} |
| 1349 |
decoder298 := json.NewDecoder(bytes.NewReader(x)) |
| 1350 |
decoder298.DisallowUnknownFields() |
| 1351 |
var h298 Declaration |
| 1352 |
if err := decoder298.Decode(&h298); err == nil { |
| 1353 |
t.Value = h298 |
| 1354 |
return nil |
| 1355 |
} |
| 1356 |
decoder299 := json.NewDecoder(bytes.NewReader(x)) |
| 1357 |
decoder299.DisallowUnknownFields() |
| 1358 |
var h299 []DeclarationLink |
| 1359 |
if err := decoder299.Decode(&h299); err == nil { |
| 1360 |
t.Value = h299 |
| 1361 |
return nil |
| 1362 |
} |
| 1363 |
return &UnmarshalError{"unmarshal failed to match one of [Declaration []DeclarationLink]"} |
| 1364 |
} |
| 1365 |
|
| 1366 |
func (t Or_Result_textDocument_definition) MarshalJSON() ([]byte, error) { |
| 1367 |
switch x := t.Value.(type) { |
| 1368 |
case Definition: |
| 1369 |
return json.Marshal(x) |
| 1370 |
case []DefinitionLink: |
| 1371 |
return json.Marshal(x) |
| 1372 |
case nil: |
| 1373 |
return []byte("null"), nil |
| 1374 |
} |
| 1375 |
return nil, fmt.Errorf("type %T not one of [Definition []DefinitionLink]", t) |
| 1376 |
} |
| 1377 |
|
| 1378 |
func (t *Or_Result_textDocument_definition) UnmarshalJSON(x []byte) error { |
| 1379 |
if string(x) == "null" { |
| 1380 |
t.Value = nil |
| 1381 |
return nil |
| 1382 |
} |
| 1383 |
decoder314 := json.NewDecoder(bytes.NewReader(x)) |
| 1384 |
decoder314.DisallowUnknownFields() |
| 1385 |
var h314 Definition |
| 1386 |
if err := decoder314.Decode(&h314); err == nil { |
| 1387 |
t.Value = h314 |
| 1388 |
return nil |
| 1389 |
} |
| 1390 |
decoder315 := json.NewDecoder(bytes.NewReader(x)) |
| 1391 |
decoder315.DisallowUnknownFields() |
| 1392 |
var h315 []DefinitionLink |
| 1393 |
if err := decoder315.Decode(&h315); err == nil { |
| 1394 |
t.Value = h315 |
| 1395 |
return nil |
| 1396 |
} |
| 1397 |
return &UnmarshalError{"unmarshal failed to match one of [Definition []DefinitionLink]"} |
| 1398 |
} |
| 1399 |
|
| 1400 |
func (t Or_Result_textDocument_documentSymbol) MarshalJSON() ([]byte, error) { |
| 1401 |
switch x := t.Value.(type) { |
| 1402 |
case []DocumentSymbol: |
| 1403 |
return json.Marshal(x) |
| 1404 |
case []SymbolInformation: |
| 1405 |
return json.Marshal(x) |
| 1406 |
case nil: |
| 1407 |
return []byte("null"), nil |
| 1408 |
} |
| 1409 |
return nil, fmt.Errorf("type %T not one of [[]DocumentSymbol []SymbolInformation]", t) |
| 1410 |
} |
| 1411 |
|
| 1412 |
func (t *Or_Result_textDocument_documentSymbol) UnmarshalJSON(x []byte) error { |
| 1413 |
if string(x) == "null" { |
| 1414 |
t.Value = nil |
| 1415 |
return nil |
| 1416 |
} |
| 1417 |
decoder318 := json.NewDecoder(bytes.NewReader(x)) |
| 1418 |
decoder318.DisallowUnknownFields() |
| 1419 |
var h318 []DocumentSymbol |
| 1420 |
if err := decoder318.Decode(&h318); err == nil { |
| 1421 |
t.Value = h318 |
| 1422 |
return nil |
| 1423 |
} |
| 1424 |
decoder319 := json.NewDecoder(bytes.NewReader(x)) |
| 1425 |
decoder319.DisallowUnknownFields() |
| 1426 |
var h319 []SymbolInformation |
| 1427 |
if err := decoder319.Decode(&h319); err == nil { |
| 1428 |
t.Value = h319 |
| 1429 |
return nil |
| 1430 |
} |
| 1431 |
return &UnmarshalError{"unmarshal failed to match one of [[]DocumentSymbol []SymbolInformation]"} |
| 1432 |
} |
| 1433 |
|
| 1434 |
func (t Or_Result_textDocument_implementation) MarshalJSON() ([]byte, error) { |
| 1435 |
switch x := t.Value.(type) { |
| 1436 |
case Definition: |
| 1437 |
return json.Marshal(x) |
| 1438 |
case []DefinitionLink: |
| 1439 |
return json.Marshal(x) |
| 1440 |
case nil: |
| 1441 |
return []byte("null"), nil |
| 1442 |
} |
| 1443 |
return nil, fmt.Errorf("type %T not one of [Definition []DefinitionLink]", t) |
| 1444 |
} |
| 1445 |
|
| 1446 |
func (t *Or_Result_textDocument_implementation) UnmarshalJSON(x []byte) error { |
| 1447 |
if string(x) == "null" { |
| 1448 |
t.Value = nil |
| 1449 |
return nil |
| 1450 |
} |
| 1451 |
decoder290 := json.NewDecoder(bytes.NewReader(x)) |
| 1452 |
decoder290.DisallowUnknownFields() |
| 1453 |
var h290 Definition |
| 1454 |
if err := decoder290.Decode(&h290); err == nil { |
| 1455 |
t.Value = h290 |
| 1456 |
return nil |
| 1457 |
} |
| 1458 |
decoder291 := json.NewDecoder(bytes.NewReader(x)) |
| 1459 |
decoder291.DisallowUnknownFields() |
| 1460 |
var h291 []DefinitionLink |
| 1461 |
if err := decoder291.Decode(&h291); err == nil { |
| 1462 |
t.Value = h291 |
| 1463 |
return nil |
| 1464 |
} |
| 1465 |
return &UnmarshalError{"unmarshal failed to match one of [Definition []DefinitionLink]"} |
| 1466 |
} |
| 1467 |
|
| 1468 |
func (t Or_Result_textDocument_inlineCompletion) MarshalJSON() ([]byte, error) { |
| 1469 |
switch x := t.Value.(type) { |
| 1470 |
case InlineCompletionList: |
| 1471 |
return json.Marshal(x) |
| 1472 |
case []InlineCompletionItem: |
| 1473 |
return json.Marshal(x) |
| 1474 |
case nil: |
| 1475 |
return []byte("null"), nil |
| 1476 |
} |
| 1477 |
return nil, fmt.Errorf("type %T not one of [InlineCompletionList []InlineCompletionItem]", t) |
| 1478 |
} |
| 1479 |
|
| 1480 |
func (t *Or_Result_textDocument_inlineCompletion) UnmarshalJSON(x []byte) error { |
| 1481 |
if string(x) == "null" { |
| 1482 |
t.Value = nil |
| 1483 |
return nil |
| 1484 |
} |
| 1485 |
decoder306 := json.NewDecoder(bytes.NewReader(x)) |
| 1486 |
decoder306.DisallowUnknownFields() |
| 1487 |
var h306 InlineCompletionList |
| 1488 |
if err := decoder306.Decode(&h306); err == nil { |
| 1489 |
t.Value = h306 |
| 1490 |
return nil |
| 1491 |
} |
| 1492 |
decoder307 := json.NewDecoder(bytes.NewReader(x)) |
| 1493 |
decoder307.DisallowUnknownFields() |
| 1494 |
var h307 []InlineCompletionItem |
| 1495 |
if err := decoder307.Decode(&h307); err == nil { |
| 1496 |
t.Value = h307 |
| 1497 |
return nil |
| 1498 |
} |
| 1499 |
return &UnmarshalError{"unmarshal failed to match one of [InlineCompletionList []InlineCompletionItem]"} |
| 1500 |
} |
| 1501 |
|
| 1502 |
func (t Or_Result_textDocument_semanticTokens_full_delta) MarshalJSON() ([]byte, error) { |
| 1503 |
switch x := t.Value.(type) { |
| 1504 |
case SemanticTokens: |
| 1505 |
return json.Marshal(x) |
| 1506 |
case SemanticTokensDelta: |
| 1507 |
return json.Marshal(x) |
| 1508 |
case nil: |
| 1509 |
return []byte("null"), nil |
| 1510 |
} |
| 1511 |
return nil, fmt.Errorf("type %T not one of [SemanticTokens SemanticTokensDelta]", t) |
| 1512 |
} |
| 1513 |
|
| 1514 |
func (t *Or_Result_textDocument_semanticTokens_full_delta) UnmarshalJSON(x []byte) error { |
| 1515 |
if string(x) == "null" { |
| 1516 |
t.Value = nil |
| 1517 |
return nil |
| 1518 |
} |
| 1519 |
decoder302 := json.NewDecoder(bytes.NewReader(x)) |
| 1520 |
decoder302.DisallowUnknownFields() |
| 1521 |
var h302 SemanticTokens |
| 1522 |
if err := decoder302.Decode(&h302); err == nil { |
| 1523 |
t.Value = h302 |
| 1524 |
return nil |
| 1525 |
} |
| 1526 |
decoder303 := json.NewDecoder(bytes.NewReader(x)) |
| 1527 |
decoder303.DisallowUnknownFields() |
| 1528 |
var h303 SemanticTokensDelta |
| 1529 |
if err := decoder303.Decode(&h303); err == nil { |
| 1530 |
t.Value = h303 |
| 1531 |
return nil |
| 1532 |
} |
| 1533 |
return &UnmarshalError{"unmarshal failed to match one of [SemanticTokens SemanticTokensDelta]"} |
| 1534 |
} |
| 1535 |
|
| 1536 |
func (t Or_Result_textDocument_typeDefinition) MarshalJSON() ([]byte, error) { |
| 1537 |
switch x := t.Value.(type) { |
| 1538 |
case Definition: |
| 1539 |
return json.Marshal(x) |
| 1540 |
case []DefinitionLink: |
| 1541 |
return json.Marshal(x) |
| 1542 |
case nil: |
| 1543 |
return []byte("null"), nil |
| 1544 |
} |
| 1545 |
return nil, fmt.Errorf("type %T not one of [Definition []DefinitionLink]", t) |
| 1546 |
} |
| 1547 |
|
| 1548 |
func (t *Or_Result_textDocument_typeDefinition) UnmarshalJSON(x []byte) error { |
| 1549 |
if string(x) == "null" { |
| 1550 |
t.Value = nil |
| 1551 |
return nil |
| 1552 |
} |
| 1553 |
decoder294 := json.NewDecoder(bytes.NewReader(x)) |
| 1554 |
decoder294.DisallowUnknownFields() |
| 1555 |
var h294 Definition |
| 1556 |
if err := decoder294.Decode(&h294); err == nil { |
| 1557 |
t.Value = h294 |
| 1558 |
return nil |
| 1559 |
} |
| 1560 |
decoder295 := json.NewDecoder(bytes.NewReader(x)) |
| 1561 |
decoder295.DisallowUnknownFields() |
| 1562 |
var h295 []DefinitionLink |
| 1563 |
if err := decoder295.Decode(&h295); err == nil { |
| 1564 |
t.Value = h295 |
| 1565 |
return nil |
| 1566 |
} |
| 1567 |
return &UnmarshalError{"unmarshal failed to match one of [Definition []DefinitionLink]"} |
| 1568 |
} |
| 1569 |
|
| 1570 |
func (t Or_Result_workspace_symbol) MarshalJSON() ([]byte, error) { |
| 1571 |
switch x := t.Value.(type) { |
| 1572 |
case []SymbolInformation: |
| 1573 |
return json.Marshal(x) |
| 1574 |
case []WorkspaceSymbol: |
| 1575 |
return json.Marshal(x) |
| 1576 |
case nil: |
| 1577 |
return []byte("null"), nil |
| 1578 |
} |
| 1579 |
return nil, fmt.Errorf("type %T not one of [[]SymbolInformation []WorkspaceSymbol]", t) |
| 1580 |
} |
| 1581 |
|
| 1582 |
func (t *Or_Result_workspace_symbol) UnmarshalJSON(x []byte) error { |
| 1583 |
if string(x) == "null" { |
| 1584 |
t.Value = nil |
| 1585 |
return nil |
| 1586 |
} |
| 1587 |
decoder326 := json.NewDecoder(bytes.NewReader(x)) |
| 1588 |
decoder326.DisallowUnknownFields() |
| 1589 |
var h326 []SymbolInformation |
| 1590 |
if err := decoder326.Decode(&h326); err == nil { |
| 1591 |
t.Value = h326 |
| 1592 |
return nil |
| 1593 |
} |
| 1594 |
decoder327 := json.NewDecoder(bytes.NewReader(x)) |
| 1595 |
decoder327.DisallowUnknownFields() |
| 1596 |
var h327 []WorkspaceSymbol |
| 1597 |
if err := decoder327.Decode(&h327); err == nil { |
| 1598 |
t.Value = h327 |
| 1599 |
return nil |
| 1600 |
} |
| 1601 |
return &UnmarshalError{"unmarshal failed to match one of [[]SymbolInformation []WorkspaceSymbol]"} |
| 1602 |
} |
| 1603 |
|
| 1604 |
func (t Or_SemanticTokensOptions_full) MarshalJSON() ([]byte, error) { |
| 1605 |
switch x := t.Value.(type) { |
| 1606 |
case SemanticTokensFullDelta: |
| 1607 |
return json.Marshal(x) |
| 1608 |
case bool: |
| 1609 |
return json.Marshal(x) |
| 1610 |
case nil: |
| 1611 |
return []byte("null"), nil |
| 1612 |
} |
| 1613 |
return nil, fmt.Errorf("type %T not one of [SemanticTokensFullDelta bool]", t) |
| 1614 |
} |
| 1615 |
|
| 1616 |
func (t *Or_SemanticTokensOptions_full) UnmarshalJSON(x []byte) error { |
| 1617 |
if string(x) == "null" { |
| 1618 |
t.Value = nil |
| 1619 |
return nil |
| 1620 |
} |
| 1621 |
decoder47 := json.NewDecoder(bytes.NewReader(x)) |
| 1622 |
decoder47.DisallowUnknownFields() |
| 1623 |
var boolVal bool |
| 1624 |
if err := decoder47.Decode(&boolVal); err == nil { |
| 1625 |
t.Value = boolVal |
| 1626 |
return nil |
| 1627 |
} |
| 1628 |
decoder48 := json.NewDecoder(bytes.NewReader(x)) |
| 1629 |
decoder48.DisallowUnknownFields() |
| 1630 |
var h48 SemanticTokensFullDelta |
| 1631 |
if err := decoder48.Decode(&h48); err == nil { |
| 1632 |
t.Value = h48 |
| 1633 |
return nil |
| 1634 |
} |
| 1635 |
return &UnmarshalError{"unmarshal failed to match one of [SemanticTokensFullDelta bool]"} |
| 1636 |
} |
| 1637 |
|
| 1638 |
func (t Or_SemanticTokensOptions_range) MarshalJSON() ([]byte, error) { |
| 1639 |
switch x := t.Value.(type) { |
| 1640 |
case Lit_SemanticTokensOptions_range_Item1: |
| 1641 |
return json.Marshal(x) |
| 1642 |
case bool: |
| 1643 |
return json.Marshal(x) |
| 1644 |
case nil: |
| 1645 |
return []byte("null"), nil |
| 1646 |
} |
| 1647 |
return nil, fmt.Errorf("type %T not one of [Lit_SemanticTokensOptions_range_Item1 bool]", t) |
| 1648 |
} |
| 1649 |
|
| 1650 |
func (t *Or_SemanticTokensOptions_range) UnmarshalJSON(x []byte) error { |
| 1651 |
if string(x) == "null" { |
| 1652 |
t.Value = nil |
| 1653 |
return nil |
| 1654 |
} |
| 1655 |
decoder44 := json.NewDecoder(bytes.NewReader(x)) |
| 1656 |
decoder44.DisallowUnknownFields() |
| 1657 |
var boolVal bool |
| 1658 |
if err := decoder44.Decode(&boolVal); err == nil { |
| 1659 |
t.Value = boolVal |
| 1660 |
return nil |
| 1661 |
} |
| 1662 |
decoder45 := json.NewDecoder(bytes.NewReader(x)) |
| 1663 |
decoder45.DisallowUnknownFields() |
| 1664 |
var h45 Lit_SemanticTokensOptions_range_Item1 |
| 1665 |
if err := decoder45.Decode(&h45); err == nil { |
| 1666 |
t.Value = h45 |
| 1667 |
return nil |
| 1668 |
} |
| 1669 |
return &UnmarshalError{"unmarshal failed to match one of [Lit_SemanticTokensOptions_range_Item1 bool]"} |
| 1670 |
} |
| 1671 |
|
| 1672 |
func (t Or_ServerCapabilities_callHierarchyProvider) MarshalJSON() ([]byte, error) { |
| 1673 |
switch x := t.Value.(type) { |
| 1674 |
case CallHierarchyOptions: |
| 1675 |
return json.Marshal(x) |
| 1676 |
case CallHierarchyRegistrationOptions: |
| 1677 |
return json.Marshal(x) |
| 1678 |
case bool: |
| 1679 |
return json.Marshal(x) |
| 1680 |
case nil: |
| 1681 |
return []byte("null"), nil |
| 1682 |
} |
| 1683 |
return nil, fmt.Errorf("type %T not one of [CallHierarchyOptions CallHierarchyRegistrationOptions bool]", t) |
| 1684 |
} |
| 1685 |
|
| 1686 |
func (t *Or_ServerCapabilities_callHierarchyProvider) UnmarshalJSON(x []byte) error { |
| 1687 |
if string(x) == "null" { |
| 1688 |
t.Value = nil |
| 1689 |
return nil |
| 1690 |
} |
| 1691 |
decoder140 := json.NewDecoder(bytes.NewReader(x)) |
| 1692 |
decoder140.DisallowUnknownFields() |
| 1693 |
var boolVal bool |
| 1694 |
if err := decoder140.Decode(&boolVal); err == nil { |
| 1695 |
t.Value = boolVal |
| 1696 |
return nil |
| 1697 |
} |
| 1698 |
decoder141 := json.NewDecoder(bytes.NewReader(x)) |
| 1699 |
decoder141.DisallowUnknownFields() |
| 1700 |
var h141 CallHierarchyOptions |
| 1701 |
if err := decoder141.Decode(&h141); err == nil { |
| 1702 |
t.Value = h141 |
| 1703 |
return nil |
| 1704 |
} |
| 1705 |
decoder142 := json.NewDecoder(bytes.NewReader(x)) |
| 1706 |
decoder142.DisallowUnknownFields() |
| 1707 |
var h142 CallHierarchyRegistrationOptions |
| 1708 |
if err := decoder142.Decode(&h142); err == nil { |
| 1709 |
t.Value = h142 |
| 1710 |
return nil |
| 1711 |
} |
| 1712 |
return &UnmarshalError{"unmarshal failed to match one of [CallHierarchyOptions CallHierarchyRegistrationOptions bool]"} |
| 1713 |
} |
| 1714 |
|
| 1715 |
func (t Or_ServerCapabilities_codeActionProvider) MarshalJSON() ([]byte, error) { |
| 1716 |
switch x := t.Value.(type) { |
| 1717 |
case CodeActionOptions: |
| 1718 |
return json.Marshal(x) |
| 1719 |
case bool: |
| 1720 |
return json.Marshal(x) |
| 1721 |
case nil: |
| 1722 |
return []byte("null"), nil |
| 1723 |
} |
| 1724 |
return nil, fmt.Errorf("type %T not one of [CodeActionOptions bool]", t) |
| 1725 |
} |
| 1726 |
|
| 1727 |
func (t *Or_ServerCapabilities_codeActionProvider) UnmarshalJSON(x []byte) error { |
| 1728 |
if string(x) == "null" { |
| 1729 |
t.Value = nil |
| 1730 |
return nil |
| 1731 |
} |
| 1732 |
decoder109 := json.NewDecoder(bytes.NewReader(x)) |
| 1733 |
decoder109.DisallowUnknownFields() |
| 1734 |
var boolVal bool |
| 1735 |
if err := decoder109.Decode(&boolVal); err == nil { |
| 1736 |
t.Value = boolVal |
| 1737 |
return nil |
| 1738 |
} |
| 1739 |
decoder110 := json.NewDecoder(bytes.NewReader(x)) |
| 1740 |
decoder110.DisallowUnknownFields() |
| 1741 |
var h110 CodeActionOptions |
| 1742 |
if err := decoder110.Decode(&h110); err == nil { |
| 1743 |
t.Value = h110 |
| 1744 |
return nil |
| 1745 |
} |
| 1746 |
return &UnmarshalError{"unmarshal failed to match one of [CodeActionOptions bool]"} |
| 1747 |
} |
| 1748 |
|
| 1749 |
func (t Or_ServerCapabilities_colorProvider) MarshalJSON() ([]byte, error) { |
| 1750 |
switch x := t.Value.(type) { |
| 1751 |
case DocumentColorOptions: |
| 1752 |
return json.Marshal(x) |
| 1753 |
case DocumentColorRegistrationOptions: |
| 1754 |
return json.Marshal(x) |
| 1755 |
case bool: |
| 1756 |
return json.Marshal(x) |
| 1757 |
case nil: |
| 1758 |
return []byte("null"), nil |
| 1759 |
} |
| 1760 |
return nil, fmt.Errorf("type %T not one of [DocumentColorOptions DocumentColorRegistrationOptions bool]", t) |
| 1761 |
} |
| 1762 |
|
| 1763 |
func (t *Or_ServerCapabilities_colorProvider) UnmarshalJSON(x []byte) error { |
| 1764 |
if string(x) == "null" { |
| 1765 |
t.Value = nil |
| 1766 |
return nil |
| 1767 |
} |
| 1768 |
decoder113 := json.NewDecoder(bytes.NewReader(x)) |
| 1769 |
decoder113.DisallowUnknownFields() |
| 1770 |
var boolVal bool |
| 1771 |
if err := decoder113.Decode(&boolVal); err == nil { |
| 1772 |
t.Value = boolVal |
| 1773 |
return nil |
| 1774 |
} |
| 1775 |
decoder114 := json.NewDecoder(bytes.NewReader(x)) |
| 1776 |
decoder114.DisallowUnknownFields() |
| 1777 |
var h114 DocumentColorOptions |
| 1778 |
if err := decoder114.Decode(&h114); err == nil { |
| 1779 |
t.Value = h114 |
| 1780 |
return nil |
| 1781 |
} |
| 1782 |
decoder115 := json.NewDecoder(bytes.NewReader(x)) |
| 1783 |
decoder115.DisallowUnknownFields() |
| 1784 |
var h115 DocumentColorRegistrationOptions |
| 1785 |
if err := decoder115.Decode(&h115); err == nil { |
| 1786 |
t.Value = h115 |
| 1787 |
return nil |
| 1788 |
} |
| 1789 |
return &UnmarshalError{"unmarshal failed to match one of [DocumentColorOptions DocumentColorRegistrationOptions bool]"} |
| 1790 |
} |
| 1791 |
|
| 1792 |
func (t Or_ServerCapabilities_declarationProvider) MarshalJSON() ([]byte, error) { |
| 1793 |
switch x := t.Value.(type) { |
| 1794 |
case DeclarationOptions: |
| 1795 |
return json.Marshal(x) |
| 1796 |
case DeclarationRegistrationOptions: |
| 1797 |
return json.Marshal(x) |
| 1798 |
case bool: |
| 1799 |
return json.Marshal(x) |
| 1800 |
case nil: |
| 1801 |
return []byte("null"), nil |
| 1802 |
} |
| 1803 |
return nil, fmt.Errorf("type %T not one of [DeclarationOptions DeclarationRegistrationOptions bool]", t) |
| 1804 |
} |
| 1805 |
|
| 1806 |
func (t *Or_ServerCapabilities_declarationProvider) UnmarshalJSON(x []byte) error { |
| 1807 |
if string(x) == "null" { |
| 1808 |
t.Value = nil |
| 1809 |
return nil |
| 1810 |
} |
| 1811 |
decoder83 := json.NewDecoder(bytes.NewReader(x)) |
| 1812 |
decoder83.DisallowUnknownFields() |
| 1813 |
var boolVal bool |
| 1814 |
if err := decoder83.Decode(&boolVal); err == nil { |
| 1815 |
t.Value = boolVal |
| 1816 |
return nil |
| 1817 |
} |
| 1818 |
decoder84 := json.NewDecoder(bytes.NewReader(x)) |
| 1819 |
decoder84.DisallowUnknownFields() |
| 1820 |
var h84 DeclarationOptions |
| 1821 |
if err := decoder84.Decode(&h84); err == nil { |
| 1822 |
t.Value = h84 |
| 1823 |
return nil |
| 1824 |
} |
| 1825 |
decoder85 := json.NewDecoder(bytes.NewReader(x)) |
| 1826 |
decoder85.DisallowUnknownFields() |
| 1827 |
var h85 DeclarationRegistrationOptions |
| 1828 |
if err := decoder85.Decode(&h85); err == nil { |
| 1829 |
t.Value = h85 |
| 1830 |
return nil |
| 1831 |
} |
| 1832 |
return &UnmarshalError{"unmarshal failed to match one of [DeclarationOptions DeclarationRegistrationOptions bool]"} |
| 1833 |
} |
| 1834 |
|
| 1835 |
func (t Or_ServerCapabilities_definitionProvider) MarshalJSON() ([]byte, error) { |
| 1836 |
switch x := t.Value.(type) { |
| 1837 |
case DefinitionOptions: |
| 1838 |
return json.Marshal(x) |
| 1839 |
case bool: |
| 1840 |
return json.Marshal(x) |
| 1841 |
case nil: |
| 1842 |
return []byte("null"), nil |
| 1843 |
} |
| 1844 |
return nil, fmt.Errorf("type %T not one of [DefinitionOptions bool]", t) |
| 1845 |
} |
| 1846 |
|
| 1847 |
func (t *Or_ServerCapabilities_definitionProvider) UnmarshalJSON(x []byte) error { |
| 1848 |
if string(x) == "null" { |
| 1849 |
t.Value = nil |
| 1850 |
return nil |
| 1851 |
} |
| 1852 |
decoder87 := json.NewDecoder(bytes.NewReader(x)) |
| 1853 |
decoder87.DisallowUnknownFields() |
| 1854 |
var boolVal bool |
| 1855 |
if err := decoder87.Decode(&boolVal); err == nil { |
| 1856 |
t.Value = boolVal |
| 1857 |
return nil |
| 1858 |
} |
| 1859 |
decoder88 := json.NewDecoder(bytes.NewReader(x)) |
| 1860 |
decoder88.DisallowUnknownFields() |
| 1861 |
var h88 DefinitionOptions |
| 1862 |
if err := decoder88.Decode(&h88); err == nil { |
| 1863 |
t.Value = h88 |
| 1864 |
return nil |
| 1865 |
} |
| 1866 |
return &UnmarshalError{"unmarshal failed to match one of [DefinitionOptions bool]"} |
| 1867 |
} |
| 1868 |
|
| 1869 |
func (t Or_ServerCapabilities_diagnosticProvider) MarshalJSON() ([]byte, error) { |
| 1870 |
switch x := t.Value.(type) { |
| 1871 |
case DiagnosticOptions: |
| 1872 |
return json.Marshal(x) |
| 1873 |
case DiagnosticRegistrationOptions: |
| 1874 |
return json.Marshal(x) |
| 1875 |
case nil: |
| 1876 |
return []byte("null"), nil |
| 1877 |
} |
| 1878 |
return nil, fmt.Errorf("type %T not one of [DiagnosticOptions DiagnosticRegistrationOptions]", t) |
| 1879 |
} |
| 1880 |
|
| 1881 |
func (t *Or_ServerCapabilities_diagnosticProvider) UnmarshalJSON(x []byte) error { |
| 1882 |
if string(x) == "null" { |
| 1883 |
t.Value = nil |
| 1884 |
return nil |
| 1885 |
} |
| 1886 |
decoder174 := json.NewDecoder(bytes.NewReader(x)) |
| 1887 |
decoder174.DisallowUnknownFields() |
| 1888 |
var h174 DiagnosticOptions |
| 1889 |
if err := decoder174.Decode(&h174); err == nil { |
| 1890 |
t.Value = h174 |
| 1891 |
return nil |
| 1892 |
} |
| 1893 |
decoder175 := json.NewDecoder(bytes.NewReader(x)) |
| 1894 |
decoder175.DisallowUnknownFields() |
| 1895 |
var h175 DiagnosticRegistrationOptions |
| 1896 |
if err := decoder175.Decode(&h175); err == nil { |
| 1897 |
t.Value = h175 |
| 1898 |
return nil |
| 1899 |
} |
| 1900 |
return &UnmarshalError{"unmarshal failed to match one of [DiagnosticOptions DiagnosticRegistrationOptions]"} |
| 1901 |
} |
| 1902 |
|
| 1903 |
func (t Or_ServerCapabilities_documentFormattingProvider) MarshalJSON() ([]byte, error) { |
| 1904 |
switch x := t.Value.(type) { |
| 1905 |
case DocumentFormattingOptions: |
| 1906 |
return json.Marshal(x) |
| 1907 |
case bool: |
| 1908 |
return json.Marshal(x) |
| 1909 |
case nil: |
| 1910 |
return []byte("null"), nil |
| 1911 |
} |
| 1912 |
return nil, fmt.Errorf("type %T not one of [DocumentFormattingOptions bool]", t) |
| 1913 |
} |
| 1914 |
|
| 1915 |
func (t *Or_ServerCapabilities_documentFormattingProvider) UnmarshalJSON(x []byte) error { |
| 1916 |
if string(x) == "null" { |
| 1917 |
t.Value = nil |
| 1918 |
return nil |
| 1919 |
} |
| 1920 |
decoder120 := json.NewDecoder(bytes.NewReader(x)) |
| 1921 |
decoder120.DisallowUnknownFields() |
| 1922 |
var boolVal bool |
| 1923 |
if err := decoder120.Decode(&boolVal); err == nil { |
| 1924 |
t.Value = boolVal |
| 1925 |
return nil |
| 1926 |
} |
| 1927 |
decoder121 := json.NewDecoder(bytes.NewReader(x)) |
| 1928 |
decoder121.DisallowUnknownFields() |
| 1929 |
var h121 DocumentFormattingOptions |
| 1930 |
if err := decoder121.Decode(&h121); err == nil { |
| 1931 |
t.Value = h121 |
| 1932 |
return nil |
| 1933 |
} |
| 1934 |
return &UnmarshalError{"unmarshal failed to match one of [DocumentFormattingOptions bool]"} |
| 1935 |
} |
| 1936 |
|
| 1937 |
func (t Or_ServerCapabilities_documentHighlightProvider) MarshalJSON() ([]byte, error) { |
| 1938 |
switch x := t.Value.(type) { |
| 1939 |
case DocumentHighlightOptions: |
| 1940 |
return json.Marshal(x) |
| 1941 |
case bool: |
| 1942 |
return json.Marshal(x) |
| 1943 |
case nil: |
| 1944 |
return []byte("null"), nil |
| 1945 |
} |
| 1946 |
return nil, fmt.Errorf("type %T not one of [DocumentHighlightOptions bool]", t) |
| 1947 |
} |
| 1948 |
|
| 1949 |
func (t *Or_ServerCapabilities_documentHighlightProvider) UnmarshalJSON(x []byte) error { |
| 1950 |
if string(x) == "null" { |
| 1951 |
t.Value = nil |
| 1952 |
return nil |
| 1953 |
} |
| 1954 |
decoder103 := json.NewDecoder(bytes.NewReader(x)) |
| 1955 |
decoder103.DisallowUnknownFields() |
| 1956 |
var boolVal bool |
| 1957 |
if err := decoder103.Decode(&boolVal); err == nil { |
| 1958 |
t.Value = boolVal |
| 1959 |
return nil |
| 1960 |
} |
| 1961 |
decoder104 := json.NewDecoder(bytes.NewReader(x)) |
| 1962 |
decoder104.DisallowUnknownFields() |
| 1963 |
var h104 DocumentHighlightOptions |
| 1964 |
if err := decoder104.Decode(&h104); err == nil { |
| 1965 |
t.Value = h104 |
| 1966 |
return nil |
| 1967 |
} |
| 1968 |
return &UnmarshalError{"unmarshal failed to match one of [DocumentHighlightOptions bool]"} |
| 1969 |
} |
| 1970 |
|
| 1971 |
func (t Or_ServerCapabilities_documentRangeFormattingProvider) MarshalJSON() ([]byte, error) { |
| 1972 |
switch x := t.Value.(type) { |
| 1973 |
case DocumentRangeFormattingOptions: |
| 1974 |
return json.Marshal(x) |
| 1975 |
case bool: |
| 1976 |
return json.Marshal(x) |
| 1977 |
case nil: |
| 1978 |
return []byte("null"), nil |
| 1979 |
} |
| 1980 |
return nil, fmt.Errorf("type %T not one of [DocumentRangeFormattingOptions bool]", t) |
| 1981 |
} |
| 1982 |
|
| 1983 |
func (t *Or_ServerCapabilities_documentRangeFormattingProvider) UnmarshalJSON(x []byte) error { |
| 1984 |
if string(x) == "null" { |
| 1985 |
t.Value = nil |
| 1986 |
return nil |
| 1987 |
} |
| 1988 |
decoder123 := json.NewDecoder(bytes.NewReader(x)) |
| 1989 |
decoder123.DisallowUnknownFields() |
| 1990 |
var boolVal bool |
| 1991 |
if err := decoder123.Decode(&boolVal); err == nil { |
| 1992 |
t.Value = boolVal |
| 1993 |
return nil |
| 1994 |
} |
| 1995 |
decoder124 := json.NewDecoder(bytes.NewReader(x)) |
| 1996 |
decoder124.DisallowUnknownFields() |
| 1997 |
var h124 DocumentRangeFormattingOptions |
| 1998 |
if err := decoder124.Decode(&h124); err == nil { |
| 1999 |
t.Value = h124 |
| 2000 |
return nil |
| 2001 |
} |
| 2002 |
return &UnmarshalError{"unmarshal failed to match one of [DocumentRangeFormattingOptions bool]"} |
| 2003 |
} |
| 2004 |
|
| 2005 |
func (t Or_ServerCapabilities_documentSymbolProvider) MarshalJSON() ([]byte, error) { |
| 2006 |
switch x := t.Value.(type) { |
| 2007 |
case DocumentSymbolOptions: |
| 2008 |
return json.Marshal(x) |
| 2009 |
case bool: |
| 2010 |
return json.Marshal(x) |
| 2011 |
case nil: |
| 2012 |
return []byte("null"), nil |
| 2013 |
} |
| 2014 |
return nil, fmt.Errorf("type %T not one of [DocumentSymbolOptions bool]", t) |
| 2015 |
} |
| 2016 |
|
| 2017 |
func (t *Or_ServerCapabilities_documentSymbolProvider) UnmarshalJSON(x []byte) error { |
| 2018 |
if string(x) == "null" { |
| 2019 |
t.Value = nil |
| 2020 |
return nil |
| 2021 |
} |
| 2022 |
decoder106 := json.NewDecoder(bytes.NewReader(x)) |
| 2023 |
decoder106.DisallowUnknownFields() |
| 2024 |
var boolVal bool |
| 2025 |
if err := decoder106.Decode(&boolVal); err == nil { |
| 2026 |
t.Value = boolVal |
| 2027 |
return nil |
| 2028 |
} |
| 2029 |
decoder107 := json.NewDecoder(bytes.NewReader(x)) |
| 2030 |
decoder107.DisallowUnknownFields() |
| 2031 |
var h107 DocumentSymbolOptions |
| 2032 |
if err := decoder107.Decode(&h107); err == nil { |
| 2033 |
t.Value = h107 |
| 2034 |
return nil |
| 2035 |
} |
| 2036 |
return &UnmarshalError{"unmarshal failed to match one of [DocumentSymbolOptions bool]"} |
| 2037 |
} |
| 2038 |
|
| 2039 |
func (t Or_ServerCapabilities_foldingRangeProvider) MarshalJSON() ([]byte, error) { |
| 2040 |
switch x := t.Value.(type) { |
| 2041 |
case FoldingRangeOptions: |
| 2042 |
return json.Marshal(x) |
| 2043 |
case FoldingRangeRegistrationOptions: |
| 2044 |
return json.Marshal(x) |
| 2045 |
case bool: |
| 2046 |
return json.Marshal(x) |
| 2047 |
case nil: |
| 2048 |
return []byte("null"), nil |
| 2049 |
} |
| 2050 |
return nil, fmt.Errorf("type %T not one of [FoldingRangeOptions FoldingRangeRegistrationOptions bool]", t) |
| 2051 |
} |
| 2052 |
|
| 2053 |
func (t *Or_ServerCapabilities_foldingRangeProvider) UnmarshalJSON(x []byte) error { |
| 2054 |
if string(x) == "null" { |
| 2055 |
t.Value = nil |
| 2056 |
return nil |
| 2057 |
} |
| 2058 |
decoder130 := json.NewDecoder(bytes.NewReader(x)) |
| 2059 |
decoder130.DisallowUnknownFields() |
| 2060 |
var boolVal bool |
| 2061 |
if err := decoder130.Decode(&boolVal); err == nil { |
| 2062 |
t.Value = boolVal |
| 2063 |
return nil |
| 2064 |
} |
| 2065 |
decoder131 := json.NewDecoder(bytes.NewReader(x)) |
| 2066 |
decoder131.DisallowUnknownFields() |
| 2067 |
var h131 FoldingRangeOptions |
| 2068 |
if err := decoder131.Decode(&h131); err == nil { |
| 2069 |
t.Value = h131 |
| 2070 |
return nil |
| 2071 |
} |
| 2072 |
decoder132 := json.NewDecoder(bytes.NewReader(x)) |
| 2073 |
decoder132.DisallowUnknownFields() |
| 2074 |
var h132 FoldingRangeRegistrationOptions |
| 2075 |
if err := decoder132.Decode(&h132); err == nil { |
| 2076 |
t.Value = h132 |
| 2077 |
return nil |
| 2078 |
} |
| 2079 |
return &UnmarshalError{"unmarshal failed to match one of [FoldingRangeOptions FoldingRangeRegistrationOptions bool]"} |
| 2080 |
} |
| 2081 |
|
| 2082 |
func (t Or_ServerCapabilities_hoverProvider) MarshalJSON() ([]byte, error) { |
| 2083 |
switch x := t.Value.(type) { |
| 2084 |
case HoverOptions: |
| 2085 |
return json.Marshal(x) |
| 2086 |
case bool: |
| 2087 |
return json.Marshal(x) |
| 2088 |
case nil: |
| 2089 |
return []byte("null"), nil |
| 2090 |
} |
| 2091 |
return nil, fmt.Errorf("type %T not one of [HoverOptions bool]", t) |
| 2092 |
} |
| 2093 |
|
| 2094 |
func (t *Or_ServerCapabilities_hoverProvider) UnmarshalJSON(x []byte) error { |
| 2095 |
if string(x) == "null" { |
| 2096 |
t.Value = nil |
| 2097 |
return nil |
| 2098 |
} |
| 2099 |
decoder79 := json.NewDecoder(bytes.NewReader(x)) |
| 2100 |
decoder79.DisallowUnknownFields() |
| 2101 |
var boolVal bool |
| 2102 |
if err := decoder79.Decode(&boolVal); err == nil { |
| 2103 |
t.Value = boolVal |
| 2104 |
return nil |
| 2105 |
} |
| 2106 |
decoder80 := json.NewDecoder(bytes.NewReader(x)) |
| 2107 |
decoder80.DisallowUnknownFields() |
| 2108 |
var h80 HoverOptions |
| 2109 |
if err := decoder80.Decode(&h80); err == nil { |
| 2110 |
t.Value = h80 |
| 2111 |
return nil |
| 2112 |
} |
| 2113 |
return &UnmarshalError{"unmarshal failed to match one of [HoverOptions bool]"} |
| 2114 |
} |
| 2115 |
|
| 2116 |
func (t Or_ServerCapabilities_implementationProvider) MarshalJSON() ([]byte, error) { |
| 2117 |
switch x := t.Value.(type) { |
| 2118 |
case ImplementationOptions: |
| 2119 |
return json.Marshal(x) |
| 2120 |
case ImplementationRegistrationOptions: |
| 2121 |
return json.Marshal(x) |
| 2122 |
case bool: |
| 2123 |
return json.Marshal(x) |
| 2124 |
case nil: |
| 2125 |
return []byte("null"), nil |
| 2126 |
} |
| 2127 |
return nil, fmt.Errorf("type %T not one of [ImplementationOptions ImplementationRegistrationOptions bool]", t) |
| 2128 |
} |
| 2129 |
|
| 2130 |
func (t *Or_ServerCapabilities_implementationProvider) UnmarshalJSON(x []byte) error { |
| 2131 |
if string(x) == "null" { |
| 2132 |
t.Value = nil |
| 2133 |
return nil |
| 2134 |
} |
| 2135 |
decoder96 := json.NewDecoder(bytes.NewReader(x)) |
| 2136 |
decoder96.DisallowUnknownFields() |
| 2137 |
var boolVal bool |
| 2138 |
if err := decoder96.Decode(&boolVal); err == nil { |
| 2139 |
t.Value = boolVal |
| 2140 |
return nil |
| 2141 |
} |
| 2142 |
decoder97 := json.NewDecoder(bytes.NewReader(x)) |
| 2143 |
decoder97.DisallowUnknownFields() |
| 2144 |
var h97 ImplementationOptions |
| 2145 |
if err := decoder97.Decode(&h97); err == nil { |
| 2146 |
t.Value = h97 |
| 2147 |
return nil |
| 2148 |
} |
| 2149 |
decoder98 := json.NewDecoder(bytes.NewReader(x)) |
| 2150 |
decoder98.DisallowUnknownFields() |
| 2151 |
var h98 ImplementationRegistrationOptions |
| 2152 |
if err := decoder98.Decode(&h98); err == nil { |
| 2153 |
t.Value = h98 |
| 2154 |
return nil |
| 2155 |
} |
| 2156 |
return &UnmarshalError{"unmarshal failed to match one of [ImplementationOptions ImplementationRegistrationOptions bool]"} |
| 2157 |
} |
| 2158 |
|
| 2159 |
func (t Or_ServerCapabilities_inlayHintProvider) MarshalJSON() ([]byte, error) { |
| 2160 |
switch x := t.Value.(type) { |
| 2161 |
case InlayHintOptions: |
| 2162 |
return json.Marshal(x) |
| 2163 |
case InlayHintRegistrationOptions: |
| 2164 |
return json.Marshal(x) |
| 2165 |
case bool: |
| 2166 |
return json.Marshal(x) |
| 2167 |
case nil: |
| 2168 |
return []byte("null"), nil |
| 2169 |
} |
| 2170 |
return nil, fmt.Errorf("type %T not one of [InlayHintOptions InlayHintRegistrationOptions bool]", t) |
| 2171 |
} |
| 2172 |
|
| 2173 |
func (t *Or_ServerCapabilities_inlayHintProvider) UnmarshalJSON(x []byte) error { |
| 2174 |
if string(x) == "null" { |
| 2175 |
t.Value = nil |
| 2176 |
return nil |
| 2177 |
} |
| 2178 |
decoder169 := json.NewDecoder(bytes.NewReader(x)) |
| 2179 |
decoder169.DisallowUnknownFields() |
| 2180 |
var boolVal bool |
| 2181 |
if err := decoder169.Decode(&boolVal); err == nil { |
| 2182 |
t.Value = boolVal |
| 2183 |
return nil |
| 2184 |
} |
| 2185 |
decoder170 := json.NewDecoder(bytes.NewReader(x)) |
| 2186 |
decoder170.DisallowUnknownFields() |
| 2187 |
var h170 InlayHintOptions |
| 2188 |
if err := decoder170.Decode(&h170); err == nil { |
| 2189 |
t.Value = h170 |
| 2190 |
return nil |
| 2191 |
} |
| 2192 |
decoder171 := json.NewDecoder(bytes.NewReader(x)) |
| 2193 |
decoder171.DisallowUnknownFields() |
| 2194 |
var h171 InlayHintRegistrationOptions |
| 2195 |
if err := decoder171.Decode(&h171); err == nil { |
| 2196 |
t.Value = h171 |
| 2197 |
return nil |
| 2198 |
} |
| 2199 |
return &UnmarshalError{"unmarshal failed to match one of [InlayHintOptions InlayHintRegistrationOptions bool]"} |
| 2200 |
} |
| 2201 |
|
| 2202 |
func (t Or_ServerCapabilities_inlineCompletionProvider) MarshalJSON() ([]byte, error) { |
| 2203 |
switch x := t.Value.(type) { |
| 2204 |
case InlineCompletionOptions: |
| 2205 |
return json.Marshal(x) |
| 2206 |
case bool: |
| 2207 |
return json.Marshal(x) |
| 2208 |
case nil: |
| 2209 |
return []byte("null"), nil |
| 2210 |
} |
| 2211 |
return nil, fmt.Errorf("type %T not one of [InlineCompletionOptions bool]", t) |
| 2212 |
} |
| 2213 |
|
| 2214 |
func (t *Or_ServerCapabilities_inlineCompletionProvider) UnmarshalJSON(x []byte) error { |
| 2215 |
if string(x) == "null" { |
| 2216 |
t.Value = nil |
| 2217 |
return nil |
| 2218 |
} |
| 2219 |
decoder177 := json.NewDecoder(bytes.NewReader(x)) |
| 2220 |
decoder177.DisallowUnknownFields() |
| 2221 |
var boolVal bool |
| 2222 |
if err := decoder177.Decode(&boolVal); err == nil { |
| 2223 |
t.Value = boolVal |
| 2224 |
return nil |
| 2225 |
} |
| 2226 |
decoder178 := json.NewDecoder(bytes.NewReader(x)) |
| 2227 |
decoder178.DisallowUnknownFields() |
| 2228 |
var h178 InlineCompletionOptions |
| 2229 |
if err := decoder178.Decode(&h178); err == nil { |
| 2230 |
t.Value = h178 |
| 2231 |
return nil |
| 2232 |
} |
| 2233 |
return &UnmarshalError{"unmarshal failed to match one of [InlineCompletionOptions bool]"} |
| 2234 |
} |
| 2235 |
|
| 2236 |
func (t Or_ServerCapabilities_inlineValueProvider) MarshalJSON() ([]byte, error) { |
| 2237 |
switch x := t.Value.(type) { |
| 2238 |
case InlineValueOptions: |
| 2239 |
return json.Marshal(x) |
| 2240 |
case InlineValueRegistrationOptions: |
| 2241 |
return json.Marshal(x) |
| 2242 |
case bool: |
| 2243 |
return json.Marshal(x) |
| 2244 |
case nil: |
| 2245 |
return []byte("null"), nil |
| 2246 |
} |
| 2247 |
return nil, fmt.Errorf("type %T not one of [InlineValueOptions InlineValueRegistrationOptions bool]", t) |
| 2248 |
} |
| 2249 |
|
| 2250 |
func (t *Or_ServerCapabilities_inlineValueProvider) UnmarshalJSON(x []byte) error { |
| 2251 |
if string(x) == "null" { |
| 2252 |
t.Value = nil |
| 2253 |
return nil |
| 2254 |
} |
| 2255 |
decoder164 := json.NewDecoder(bytes.NewReader(x)) |
| 2256 |
decoder164.DisallowUnknownFields() |
| 2257 |
var boolVal bool |
| 2258 |
if err := decoder164.Decode(&boolVal); err == nil { |
| 2259 |
t.Value = boolVal |
| 2260 |
return nil |
| 2261 |
} |
| 2262 |
decoder165 := json.NewDecoder(bytes.NewReader(x)) |
| 2263 |
decoder165.DisallowUnknownFields() |
| 2264 |
var h165 InlineValueOptions |
| 2265 |
if err := decoder165.Decode(&h165); err == nil { |
| 2266 |
t.Value = h165 |
| 2267 |
return nil |
| 2268 |
} |
| 2269 |
decoder166 := json.NewDecoder(bytes.NewReader(x)) |
| 2270 |
decoder166.DisallowUnknownFields() |
| 2271 |
var h166 InlineValueRegistrationOptions |
| 2272 |
if err := decoder166.Decode(&h166); err == nil { |
| 2273 |
t.Value = h166 |
| 2274 |
return nil |
| 2275 |
} |
| 2276 |
return &UnmarshalError{"unmarshal failed to match one of [InlineValueOptions InlineValueRegistrationOptions bool]"} |
| 2277 |
} |
| 2278 |
|
| 2279 |
func (t Or_ServerCapabilities_linkedEditingRangeProvider) MarshalJSON() ([]byte, error) { |
| 2280 |
switch x := t.Value.(type) { |
| 2281 |
case LinkedEditingRangeOptions: |
| 2282 |
return json.Marshal(x) |
| 2283 |
case LinkedEditingRangeRegistrationOptions: |
| 2284 |
return json.Marshal(x) |
| 2285 |
case bool: |
| 2286 |
return json.Marshal(x) |
| 2287 |
case nil: |
| 2288 |
return []byte("null"), nil |
| 2289 |
} |
| 2290 |
return nil, fmt.Errorf("type %T not one of [LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions bool]", t) |
| 2291 |
} |
| 2292 |
|
| 2293 |
func (t *Or_ServerCapabilities_linkedEditingRangeProvider) UnmarshalJSON(x []byte) error { |
| 2294 |
if string(x) == "null" { |
| 2295 |
t.Value = nil |
| 2296 |
return nil |
| 2297 |
} |
| 2298 |
decoder145 := json.NewDecoder(bytes.NewReader(x)) |
| 2299 |
decoder145.DisallowUnknownFields() |
| 2300 |
var boolVal bool |
| 2301 |
if err := decoder145.Decode(&boolVal); err == nil { |
| 2302 |
t.Value = boolVal |
| 2303 |
return nil |
| 2304 |
} |
| 2305 |
decoder146 := json.NewDecoder(bytes.NewReader(x)) |
| 2306 |
decoder146.DisallowUnknownFields() |
| 2307 |
var h146 LinkedEditingRangeOptions |
| 2308 |
if err := decoder146.Decode(&h146); err == nil { |
| 2309 |
t.Value = h146 |
| 2310 |
return nil |
| 2311 |
} |
| 2312 |
decoder147 := json.NewDecoder(bytes.NewReader(x)) |
| 2313 |
decoder147.DisallowUnknownFields() |
| 2314 |
var h147 LinkedEditingRangeRegistrationOptions |
| 2315 |
if err := decoder147.Decode(&h147); err == nil { |
| 2316 |
t.Value = h147 |
| 2317 |
return nil |
| 2318 |
} |
| 2319 |
return &UnmarshalError{"unmarshal failed to match one of [LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions bool]"} |
| 2320 |
} |
| 2321 |
|
| 2322 |
func (t Or_ServerCapabilities_monikerProvider) MarshalJSON() ([]byte, error) { |
| 2323 |
switch x := t.Value.(type) { |
| 2324 |
case MonikerOptions: |
| 2325 |
return json.Marshal(x) |
| 2326 |
case MonikerRegistrationOptions: |
| 2327 |
return json.Marshal(x) |
| 2328 |
case bool: |
| 2329 |
return json.Marshal(x) |
| 2330 |
case nil: |
| 2331 |
return []byte("null"), nil |
| 2332 |
} |
| 2333 |
return nil, fmt.Errorf("type %T not one of [MonikerOptions MonikerRegistrationOptions bool]", t) |
| 2334 |
} |
| 2335 |
|
| 2336 |
func (t *Or_ServerCapabilities_monikerProvider) UnmarshalJSON(x []byte) error { |
| 2337 |
if string(x) == "null" { |
| 2338 |
t.Value = nil |
| 2339 |
return nil |
| 2340 |
} |
| 2341 |
decoder154 := json.NewDecoder(bytes.NewReader(x)) |
| 2342 |
decoder154.DisallowUnknownFields() |
| 2343 |
var boolVal bool |
| 2344 |
if err := decoder154.Decode(&boolVal); err == nil { |
| 2345 |
t.Value = boolVal |
| 2346 |
return nil |
| 2347 |
} |
| 2348 |
decoder155 := json.NewDecoder(bytes.NewReader(x)) |
| 2349 |
decoder155.DisallowUnknownFields() |
| 2350 |
var h155 MonikerOptions |
| 2351 |
if err := decoder155.Decode(&h155); err == nil { |
| 2352 |
t.Value = h155 |
| 2353 |
return nil |
| 2354 |
} |
| 2355 |
decoder156 := json.NewDecoder(bytes.NewReader(x)) |
| 2356 |
decoder156.DisallowUnknownFields() |
| 2357 |
var h156 MonikerRegistrationOptions |
| 2358 |
if err := decoder156.Decode(&h156); err == nil { |
| 2359 |
t.Value = h156 |
| 2360 |
return nil |
| 2361 |
} |
| 2362 |
return &UnmarshalError{"unmarshal failed to match one of [MonikerOptions MonikerRegistrationOptions bool]"} |
| 2363 |
} |
| 2364 |
|
| 2365 |
func (t Or_ServerCapabilities_notebookDocumentSync) MarshalJSON() ([]byte, error) { |
| 2366 |
switch x := t.Value.(type) { |
| 2367 |
case NotebookDocumentSyncOptions: |
| 2368 |
return json.Marshal(x) |
| 2369 |
case NotebookDocumentSyncRegistrationOptions: |
| 2370 |
return json.Marshal(x) |
| 2371 |
case nil: |
| 2372 |
return []byte("null"), nil |
| 2373 |
} |
| 2374 |
return nil, fmt.Errorf("type %T not one of [NotebookDocumentSyncOptions NotebookDocumentSyncRegistrationOptions]", t) |
| 2375 |
} |
| 2376 |
|
| 2377 |
func (t *Or_ServerCapabilities_notebookDocumentSync) UnmarshalJSON(x []byte) error { |
| 2378 |
if string(x) == "null" { |
| 2379 |
t.Value = nil |
| 2380 |
return nil |
| 2381 |
} |
| 2382 |
decoder76 := json.NewDecoder(bytes.NewReader(x)) |
| 2383 |
decoder76.DisallowUnknownFields() |
| 2384 |
var h76 NotebookDocumentSyncOptions |
| 2385 |
if err := decoder76.Decode(&h76); err == nil { |
| 2386 |
t.Value = h76 |
| 2387 |
return nil |
| 2388 |
} |
| 2389 |
decoder77 := json.NewDecoder(bytes.NewReader(x)) |
| 2390 |
decoder77.DisallowUnknownFields() |
| 2391 |
var h77 NotebookDocumentSyncRegistrationOptions |
| 2392 |
if err := decoder77.Decode(&h77); err == nil { |
| 2393 |
t.Value = h77 |
| 2394 |
return nil |
| 2395 |
} |
| 2396 |
return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentSyncOptions NotebookDocumentSyncRegistrationOptions]"} |
| 2397 |
} |
| 2398 |
|
| 2399 |
func (t Or_ServerCapabilities_referencesProvider) MarshalJSON() ([]byte, error) { |
| 2400 |
switch x := t.Value.(type) { |
| 2401 |
case ReferenceOptions: |
| 2402 |
return json.Marshal(x) |
| 2403 |
case bool: |
| 2404 |
return json.Marshal(x) |
| 2405 |
case nil: |
| 2406 |
return []byte("null"), nil |
| 2407 |
} |
| 2408 |
return nil, fmt.Errorf("type %T not one of [ReferenceOptions bool]", t) |
| 2409 |
} |
| 2410 |
|
| 2411 |
func (t *Or_ServerCapabilities_referencesProvider) UnmarshalJSON(x []byte) error { |
| 2412 |
if string(x) == "null" { |
| 2413 |
t.Value = nil |
| 2414 |
return nil |
| 2415 |
} |
| 2416 |
decoder100 := json.NewDecoder(bytes.NewReader(x)) |
| 2417 |
decoder100.DisallowUnknownFields() |
| 2418 |
var boolVal bool |
| 2419 |
if err := decoder100.Decode(&boolVal); err == nil { |
| 2420 |
t.Value = boolVal |
| 2421 |
return nil |
| 2422 |
} |
| 2423 |
decoder101 := json.NewDecoder(bytes.NewReader(x)) |
| 2424 |
decoder101.DisallowUnknownFields() |
| 2425 |
var h101 ReferenceOptions |
| 2426 |
if err := decoder101.Decode(&h101); err == nil { |
| 2427 |
t.Value = h101 |
| 2428 |
return nil |
| 2429 |
} |
| 2430 |
return &UnmarshalError{"unmarshal failed to match one of [ReferenceOptions bool]"} |
| 2431 |
} |
| 2432 |
|
| 2433 |
func (t Or_ServerCapabilities_renameProvider) MarshalJSON() ([]byte, error) { |
| 2434 |
switch x := t.Value.(type) { |
| 2435 |
case RenameOptions: |
| 2436 |
return json.Marshal(x) |
| 2437 |
case bool: |
| 2438 |
return json.Marshal(x) |
| 2439 |
case nil: |
| 2440 |
return []byte("null"), nil |
| 2441 |
} |
| 2442 |
return nil, fmt.Errorf("type %T not one of [RenameOptions bool]", t) |
| 2443 |
} |
| 2444 |
|
| 2445 |
func (t *Or_ServerCapabilities_renameProvider) UnmarshalJSON(x []byte) error { |
| 2446 |
if string(x) == "null" { |
| 2447 |
t.Value = nil |
| 2448 |
return nil |
| 2449 |
} |
| 2450 |
decoder126 := json.NewDecoder(bytes.NewReader(x)) |
| 2451 |
decoder126.DisallowUnknownFields() |
| 2452 |
var boolVal bool |
| 2453 |
if err := decoder126.Decode(&boolVal); err == nil { |
| 2454 |
t.Value = boolVal |
| 2455 |
return nil |
| 2456 |
} |
| 2457 |
decoder127 := json.NewDecoder(bytes.NewReader(x)) |
| 2458 |
decoder127.DisallowUnknownFields() |
| 2459 |
var h127 RenameOptions |
| 2460 |
if err := decoder127.Decode(&h127); err == nil { |
| 2461 |
t.Value = h127 |
| 2462 |
return nil |
| 2463 |
} |
| 2464 |
return &UnmarshalError{"unmarshal failed to match one of [RenameOptions bool]"} |
| 2465 |
} |
| 2466 |
|
| 2467 |
func (t Or_ServerCapabilities_selectionRangeProvider) MarshalJSON() ([]byte, error) { |
| 2468 |
switch x := t.Value.(type) { |
| 2469 |
case SelectionRangeOptions: |
| 2470 |
return json.Marshal(x) |
| 2471 |
case SelectionRangeRegistrationOptions: |
| 2472 |
return json.Marshal(x) |
| 2473 |
case bool: |
| 2474 |
return json.Marshal(x) |
| 2475 |
case nil: |
| 2476 |
return []byte("null"), nil |
| 2477 |
} |
| 2478 |
return nil, fmt.Errorf("type %T not one of [SelectionRangeOptions SelectionRangeRegistrationOptions bool]", t) |
| 2479 |
} |
| 2480 |
|
| 2481 |
func (t *Or_ServerCapabilities_selectionRangeProvider) UnmarshalJSON(x []byte) error { |
| 2482 |
if string(x) == "null" { |
| 2483 |
t.Value = nil |
| 2484 |
return nil |
| 2485 |
} |
| 2486 |
decoder135 := json.NewDecoder(bytes.NewReader(x)) |
| 2487 |
decoder135.DisallowUnknownFields() |
| 2488 |
var boolVal bool |
| 2489 |
if err := decoder135.Decode(&boolVal); err == nil { |
| 2490 |
t.Value = boolVal |
| 2491 |
return nil |
| 2492 |
} |
| 2493 |
decoder136 := json.NewDecoder(bytes.NewReader(x)) |
| 2494 |
decoder136.DisallowUnknownFields() |
| 2495 |
var h136 SelectionRangeOptions |
| 2496 |
if err := decoder136.Decode(&h136); err == nil { |
| 2497 |
t.Value = h136 |
| 2498 |
return nil |
| 2499 |
} |
| 2500 |
decoder137 := json.NewDecoder(bytes.NewReader(x)) |
| 2501 |
decoder137.DisallowUnknownFields() |
| 2502 |
var h137 SelectionRangeRegistrationOptions |
| 2503 |
if err := decoder137.Decode(&h137); err == nil { |
| 2504 |
t.Value = h137 |
| 2505 |
return nil |
| 2506 |
} |
| 2507 |
return &UnmarshalError{"unmarshal failed to match one of [SelectionRangeOptions SelectionRangeRegistrationOptions bool]"} |
| 2508 |
} |
| 2509 |
|
| 2510 |
func (t Or_ServerCapabilities_semanticTokensProvider) MarshalJSON() ([]byte, error) { |
| 2511 |
switch x := t.Value.(type) { |
| 2512 |
case SemanticTokensOptions: |
| 2513 |
return json.Marshal(x) |
| 2514 |
case SemanticTokensRegistrationOptions: |
| 2515 |
return json.Marshal(x) |
| 2516 |
case nil: |
| 2517 |
return []byte("null"), nil |
| 2518 |
} |
| 2519 |
return nil, fmt.Errorf("type %T not one of [SemanticTokensOptions SemanticTokensRegistrationOptions]", t) |
| 2520 |
} |
| 2521 |
|
| 2522 |
func (t *Or_ServerCapabilities_semanticTokensProvider) UnmarshalJSON(x []byte) error { |
| 2523 |
if string(x) == "null" { |
| 2524 |
t.Value = nil |
| 2525 |
return nil |
| 2526 |
} |
| 2527 |
decoder150 := json.NewDecoder(bytes.NewReader(x)) |
| 2528 |
decoder150.DisallowUnknownFields() |
| 2529 |
var h150 SemanticTokensOptions |
| 2530 |
if err := decoder150.Decode(&h150); err == nil { |
| 2531 |
t.Value = h150 |
| 2532 |
return nil |
| 2533 |
} |
| 2534 |
decoder151 := json.NewDecoder(bytes.NewReader(x)) |
| 2535 |
decoder151.DisallowUnknownFields() |
| 2536 |
var h151 SemanticTokensRegistrationOptions |
| 2537 |
if err := decoder151.Decode(&h151); err == nil { |
| 2538 |
t.Value = h151 |
| 2539 |
return nil |
| 2540 |
} |
| 2541 |
return &UnmarshalError{"unmarshal failed to match one of [SemanticTokensOptions SemanticTokensRegistrationOptions]"} |
| 2542 |
} |
| 2543 |
|
| 2544 |
func (t Or_ServerCapabilities_textDocumentSync) MarshalJSON() ([]byte, error) { |
| 2545 |
switch x := t.Value.(type) { |
| 2546 |
case TextDocumentSyncKind: |
| 2547 |
return json.Marshal(x) |
| 2548 |
case TextDocumentSyncOptions: |
| 2549 |
return json.Marshal(x) |
| 2550 |
case nil: |
| 2551 |
return []byte("null"), nil |
| 2552 |
} |
| 2553 |
return nil, fmt.Errorf("type %T not one of [TextDocumentSyncKind TextDocumentSyncOptions]", t) |
| 2554 |
} |
| 2555 |
|
| 2556 |
func (t *Or_ServerCapabilities_textDocumentSync) UnmarshalJSON(x []byte) error { |
| 2557 |
if string(x) == "null" { |
| 2558 |
t.Value = nil |
| 2559 |
return nil |
| 2560 |
} |
| 2561 |
decoder72 := json.NewDecoder(bytes.NewReader(x)) |
| 2562 |
decoder72.DisallowUnknownFields() |
| 2563 |
var h72 TextDocumentSyncKind |
| 2564 |
if err := decoder72.Decode(&h72); err == nil { |
| 2565 |
t.Value = h72 |
| 2566 |
return nil |
| 2567 |
} |
| 2568 |
decoder73 := json.NewDecoder(bytes.NewReader(x)) |
| 2569 |
decoder73.DisallowUnknownFields() |
| 2570 |
var h73 TextDocumentSyncOptions |
| 2571 |
if err := decoder73.Decode(&h73); err == nil { |
| 2572 |
t.Value = h73 |
| 2573 |
return nil |
| 2574 |
} |
| 2575 |
return &UnmarshalError{"unmarshal failed to match one of [TextDocumentSyncKind TextDocumentSyncOptions]"} |
| 2576 |
} |
| 2577 |
|
| 2578 |
func (t Or_ServerCapabilities_typeDefinitionProvider) MarshalJSON() ([]byte, error) { |
| 2579 |
switch x := t.Value.(type) { |
| 2580 |
case TypeDefinitionOptions: |
| 2581 |
return json.Marshal(x) |
| 2582 |
case TypeDefinitionRegistrationOptions: |
| 2583 |
return json.Marshal(x) |
| 2584 |
case bool: |
| 2585 |
return json.Marshal(x) |
| 2586 |
case nil: |
| 2587 |
return []byte("null"), nil |
| 2588 |
} |
| 2589 |
return nil, fmt.Errorf("type %T not one of [TypeDefinitionOptions TypeDefinitionRegistrationOptions bool]", t) |
| 2590 |
} |
| 2591 |
|
| 2592 |
func (t *Or_ServerCapabilities_typeDefinitionProvider) UnmarshalJSON(x []byte) error { |
| 2593 |
if string(x) == "null" { |
| 2594 |
t.Value = nil |
| 2595 |
return nil |
| 2596 |
} |
| 2597 |
decoder91 := json.NewDecoder(bytes.NewReader(x)) |
| 2598 |
decoder91.DisallowUnknownFields() |
| 2599 |
var boolVal bool |
| 2600 |
if err := decoder91.Decode(&boolVal); err == nil { |
| 2601 |
t.Value = boolVal |
| 2602 |
return nil |
| 2603 |
} |
| 2604 |
decoder92 := json.NewDecoder(bytes.NewReader(x)) |
| 2605 |
decoder92.DisallowUnknownFields() |
| 2606 |
var h92 TypeDefinitionOptions |
| 2607 |
if err := decoder92.Decode(&h92); err == nil { |
| 2608 |
t.Value = h92 |
| 2609 |
return nil |
| 2610 |
} |
| 2611 |
decoder93 := json.NewDecoder(bytes.NewReader(x)) |
| 2612 |
decoder93.DisallowUnknownFields() |
| 2613 |
var h93 TypeDefinitionRegistrationOptions |
| 2614 |
if err := decoder93.Decode(&h93); err == nil { |
| 2615 |
t.Value = h93 |
| 2616 |
return nil |
| 2617 |
} |
| 2618 |
return &UnmarshalError{"unmarshal failed to match one of [TypeDefinitionOptions TypeDefinitionRegistrationOptions bool]"} |
| 2619 |
} |
| 2620 |
|
| 2621 |
func (t Or_ServerCapabilities_typeHierarchyProvider) MarshalJSON() ([]byte, error) { |
| 2622 |
switch x := t.Value.(type) { |
| 2623 |
case TypeHierarchyOptions: |
| 2624 |
return json.Marshal(x) |
| 2625 |
case TypeHierarchyRegistrationOptions: |
| 2626 |
return json.Marshal(x) |
| 2627 |
case bool: |
| 2628 |
return json.Marshal(x) |
| 2629 |
case nil: |
| 2630 |
return []byte("null"), nil |
| 2631 |
} |
| 2632 |
return nil, fmt.Errorf("type %T not one of [TypeHierarchyOptions TypeHierarchyRegistrationOptions bool]", t) |
| 2633 |
} |
| 2634 |
|
| 2635 |
func (t *Or_ServerCapabilities_typeHierarchyProvider) UnmarshalJSON(x []byte) error { |
| 2636 |
if string(x) == "null" { |
| 2637 |
t.Value = nil |
| 2638 |
return nil |
| 2639 |
} |
| 2640 |
decoder159 := json.NewDecoder(bytes.NewReader(x)) |
| 2641 |
decoder159.DisallowUnknownFields() |
| 2642 |
var boolVal bool |
| 2643 |
if err := decoder159.Decode(&boolVal); err == nil { |
| 2644 |
t.Value = boolVal |
| 2645 |
return nil |
| 2646 |
} |
| 2647 |
decoder160 := json.NewDecoder(bytes.NewReader(x)) |
| 2648 |
decoder160.DisallowUnknownFields() |
| 2649 |
var h160 TypeHierarchyOptions |
| 2650 |
if err := decoder160.Decode(&h160); err == nil { |
| 2651 |
t.Value = h160 |
| 2652 |
return nil |
| 2653 |
} |
| 2654 |
decoder161 := json.NewDecoder(bytes.NewReader(x)) |
| 2655 |
decoder161.DisallowUnknownFields() |
| 2656 |
var h161 TypeHierarchyRegistrationOptions |
| 2657 |
if err := decoder161.Decode(&h161); err == nil { |
| 2658 |
t.Value = h161 |
| 2659 |
return nil |
| 2660 |
} |
| 2661 |
return &UnmarshalError{"unmarshal failed to match one of [TypeHierarchyOptions TypeHierarchyRegistrationOptions bool]"} |
| 2662 |
} |
| 2663 |
|
| 2664 |
func (t Or_ServerCapabilities_workspaceSymbolProvider) MarshalJSON() ([]byte, error) { |
| 2665 |
switch x := t.Value.(type) { |
| 2666 |
case WorkspaceSymbolOptions: |
| 2667 |
return json.Marshal(x) |
| 2668 |
case bool: |
| 2669 |
return json.Marshal(x) |
| 2670 |
case nil: |
| 2671 |
return []byte("null"), nil |
| 2672 |
} |
| 2673 |
return nil, fmt.Errorf("type %T not one of [WorkspaceSymbolOptions bool]", t) |
| 2674 |
} |
| 2675 |
|
| 2676 |
func (t *Or_ServerCapabilities_workspaceSymbolProvider) UnmarshalJSON(x []byte) error { |
| 2677 |
if string(x) == "null" { |
| 2678 |
t.Value = nil |
| 2679 |
return nil |
| 2680 |
} |
| 2681 |
decoder117 := json.NewDecoder(bytes.NewReader(x)) |
| 2682 |
decoder117.DisallowUnknownFields() |
| 2683 |
var boolVal bool |
| 2684 |
if err := decoder117.Decode(&boolVal); err == nil { |
| 2685 |
t.Value = boolVal |
| 2686 |
return nil |
| 2687 |
} |
| 2688 |
decoder118 := json.NewDecoder(bytes.NewReader(x)) |
| 2689 |
decoder118.DisallowUnknownFields() |
| 2690 |
var h118 WorkspaceSymbolOptions |
| 2691 |
if err := decoder118.Decode(&h118); err == nil { |
| 2692 |
t.Value = h118 |
| 2693 |
return nil |
| 2694 |
} |
| 2695 |
return &UnmarshalError{"unmarshal failed to match one of [WorkspaceSymbolOptions bool]"} |
| 2696 |
} |
| 2697 |
|
| 2698 |
func (t Or_SignatureInformation_documentation) MarshalJSON() ([]byte, error) { |
| 2699 |
switch x := t.Value.(type) { |
| 2700 |
case MarkupContent: |
| 2701 |
return json.Marshal(x) |
| 2702 |
case string: |
| 2703 |
return json.Marshal(x) |
| 2704 |
case nil: |
| 2705 |
return []byte("null"), nil |
| 2706 |
} |
| 2707 |
return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t) |
| 2708 |
} |
| 2709 |
|
| 2710 |
func (t *Or_SignatureInformation_documentation) UnmarshalJSON(x []byte) error { |
| 2711 |
if string(x) == "null" { |
| 2712 |
t.Value = nil |
| 2713 |
return nil |
| 2714 |
} |
| 2715 |
decoder186 := json.NewDecoder(bytes.NewReader(x)) |
| 2716 |
decoder186.DisallowUnknownFields() |
| 2717 |
var stringVal string |
| 2718 |
if err := decoder186.Decode(&stringVal); err == nil { |
| 2719 |
t.Value = stringVal |
| 2720 |
return nil |
| 2721 |
} |
| 2722 |
decoder187 := json.NewDecoder(bytes.NewReader(x)) |
| 2723 |
decoder187.DisallowUnknownFields() |
| 2724 |
var h187 MarkupContent |
| 2725 |
if err := decoder187.Decode(&h187); err == nil { |
| 2726 |
t.Value = h187 |
| 2727 |
return nil |
| 2728 |
} |
| 2729 |
return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"} |
| 2730 |
} |
| 2731 |
|
| 2732 |
func (t Or_TextDocumentContentChangeEvent) MarshalJSON() ([]byte, error) { |
| 2733 |
switch x := t.Value.(type) { |
| 2734 |
case TextDocumentContentChangePartial: |
| 2735 |
return json.Marshal(x) |
| 2736 |
case TextDocumentContentChangeWholeDocument: |
| 2737 |
return json.Marshal(x) |
| 2738 |
case nil: |
| 2739 |
return []byte("null"), nil |
| 2740 |
} |
| 2741 |
return nil, fmt.Errorf("type %T not one of [TextDocumentContentChangePartial TextDocumentContentChangeWholeDocument]", t) |
| 2742 |
} |
| 2743 |
|
| 2744 |
func (t *Or_TextDocumentContentChangeEvent) UnmarshalJSON(x []byte) error { |
| 2745 |
if string(x) == "null" { |
| 2746 |
t.Value = nil |
| 2747 |
return nil |
| 2748 |
} |
| 2749 |
decoder263 := json.NewDecoder(bytes.NewReader(x)) |
| 2750 |
decoder263.DisallowUnknownFields() |
| 2751 |
var h263 TextDocumentContentChangePartial |
| 2752 |
if err := decoder263.Decode(&h263); err == nil { |
| 2753 |
t.Value = h263 |
| 2754 |
return nil |
| 2755 |
} |
| 2756 |
decoder264 := json.NewDecoder(bytes.NewReader(x)) |
| 2757 |
decoder264.DisallowUnknownFields() |
| 2758 |
var h264 TextDocumentContentChangeWholeDocument |
| 2759 |
if err := decoder264.Decode(&h264); err == nil { |
| 2760 |
t.Value = h264 |
| 2761 |
return nil |
| 2762 |
} |
| 2763 |
return &UnmarshalError{"unmarshal failed to match one of [TextDocumentContentChangePartial TextDocumentContentChangeWholeDocument]"} |
| 2764 |
} |
| 2765 |
|
| 2766 |
func (t Or_TextDocumentEdit_edits_Elem) MarshalJSON() ([]byte, error) { |
| 2767 |
switch x := t.Value.(type) { |
| 2768 |
case AnnotatedTextEdit: |
| 2769 |
return json.Marshal(x) |
| 2770 |
case SnippetTextEdit: |
| 2771 |
return json.Marshal(x) |
| 2772 |
case TextEdit: |
| 2773 |
return json.Marshal(x) |
| 2774 |
case nil: |
| 2775 |
return []byte("null"), nil |
| 2776 |
} |
| 2777 |
return nil, fmt.Errorf("type %T not one of [AnnotatedTextEdit SnippetTextEdit TextEdit]", t) |
| 2778 |
} |
| 2779 |
|
| 2780 |
func (t *Or_TextDocumentEdit_edits_Elem) UnmarshalJSON(x []byte) error { |
| 2781 |
if string(x) == "null" { |
| 2782 |
t.Value = nil |
| 2783 |
return nil |
| 2784 |
} |
| 2785 |
decoder52 := json.NewDecoder(bytes.NewReader(x)) |
| 2786 |
decoder52.DisallowUnknownFields() |
| 2787 |
var h52 AnnotatedTextEdit |
| 2788 |
if err := decoder52.Decode(&h52); err == nil { |
| 2789 |
t.Value = h52 |
| 2790 |
return nil |
| 2791 |
} |
| 2792 |
decoder53 := json.NewDecoder(bytes.NewReader(x)) |
| 2793 |
decoder53.DisallowUnknownFields() |
| 2794 |
var h53 SnippetTextEdit |
| 2795 |
if err := decoder53.Decode(&h53); err == nil { |
| 2796 |
t.Value = h53 |
| 2797 |
return nil |
| 2798 |
} |
| 2799 |
decoder54 := json.NewDecoder(bytes.NewReader(x)) |
| 2800 |
decoder54.DisallowUnknownFields() |
| 2801 |
var h54 TextEdit |
| 2802 |
if err := decoder54.Decode(&h54); err == nil { |
| 2803 |
t.Value = h54 |
| 2804 |
return nil |
| 2805 |
} |
| 2806 |
return &UnmarshalError{"unmarshal failed to match one of [AnnotatedTextEdit SnippetTextEdit TextEdit]"} |
| 2807 |
} |
| 2808 |
|
| 2809 |
func (t Or_TextDocumentFilter) MarshalJSON() ([]byte, error) { |
| 2810 |
switch x := t.Value.(type) { |
| 2811 |
case TextDocumentFilterLanguage: |
| 2812 |
return json.Marshal(x) |
| 2813 |
case TextDocumentFilterPattern: |
| 2814 |
return json.Marshal(x) |
| 2815 |
case TextDocumentFilterScheme: |
| 2816 |
return json.Marshal(x) |
| 2817 |
case nil: |
| 2818 |
return []byte("null"), nil |
| 2819 |
} |
| 2820 |
return nil, fmt.Errorf("type %T not one of [TextDocumentFilterLanguage TextDocumentFilterPattern TextDocumentFilterScheme]", t) |
| 2821 |
} |
| 2822 |
|
| 2823 |
func (t *Or_TextDocumentFilter) UnmarshalJSON(x []byte) error { |
| 2824 |
if string(x) == "null" { |
| 2825 |
t.Value = nil |
| 2826 |
return nil |
| 2827 |
} |
| 2828 |
decoder279 := json.NewDecoder(bytes.NewReader(x)) |
| 2829 |
decoder279.DisallowUnknownFields() |
| 2830 |
var h279 TextDocumentFilterLanguage |
| 2831 |
if err := decoder279.Decode(&h279); err == nil { |
| 2832 |
t.Value = h279 |
| 2833 |
return nil |
| 2834 |
} |
| 2835 |
decoder280 := json.NewDecoder(bytes.NewReader(x)) |
| 2836 |
decoder280.DisallowUnknownFields() |
| 2837 |
var h280 TextDocumentFilterPattern |
| 2838 |
if err := decoder280.Decode(&h280); err == nil { |
| 2839 |
t.Value = h280 |
| 2840 |
return nil |
| 2841 |
} |
| 2842 |
decoder281 := json.NewDecoder(bytes.NewReader(x)) |
| 2843 |
decoder281.DisallowUnknownFields() |
| 2844 |
var h281 TextDocumentFilterScheme |
| 2845 |
if err := decoder281.Decode(&h281); err == nil { |
| 2846 |
t.Value = h281 |
| 2847 |
return nil |
| 2848 |
} |
| 2849 |
return &UnmarshalError{"unmarshal failed to match one of [TextDocumentFilterLanguage TextDocumentFilterPattern TextDocumentFilterScheme]"} |
| 2850 |
} |
| 2851 |
|
| 2852 |
func (t Or_TextDocumentSyncOptions_save) MarshalJSON() ([]byte, error) { |
| 2853 |
switch x := t.Value.(type) { |
| 2854 |
case SaveOptions: |
| 2855 |
return json.Marshal(x) |
| 2856 |
case bool: |
| 2857 |
return json.Marshal(x) |
| 2858 |
case nil: |
| 2859 |
return []byte("null"), nil |
| 2860 |
} |
| 2861 |
return nil, fmt.Errorf("type %T not one of [SaveOptions bool]", t) |
| 2862 |
} |
| 2863 |
|
| 2864 |
func (t *Or_TextDocumentSyncOptions_save) UnmarshalJSON(x []byte) error { |
| 2865 |
if string(x) == "null" { |
| 2866 |
t.Value = nil |
| 2867 |
return nil |
| 2868 |
} |
| 2869 |
decoder195 := json.NewDecoder(bytes.NewReader(x)) |
| 2870 |
decoder195.DisallowUnknownFields() |
| 2871 |
var boolVal bool |
| 2872 |
if err := decoder195.Decode(&boolVal); err == nil { |
| 2873 |
t.Value = boolVal |
| 2874 |
return nil |
| 2875 |
} |
| 2876 |
decoder196 := json.NewDecoder(bytes.NewReader(x)) |
| 2877 |
decoder196.DisallowUnknownFields() |
| 2878 |
var h196 SaveOptions |
| 2879 |
if err := decoder196.Decode(&h196); err == nil { |
| 2880 |
t.Value = h196 |
| 2881 |
return nil |
| 2882 |
} |
| 2883 |
return &UnmarshalError{"unmarshal failed to match one of [SaveOptions bool]"} |
| 2884 |
} |
| 2885 |
|
| 2886 |
func (t Or_WorkspaceDocumentDiagnosticReport) MarshalJSON() ([]byte, error) { |
| 2887 |
switch x := t.Value.(type) { |
| 2888 |
case WorkspaceFullDocumentDiagnosticReport: |
| 2889 |
return json.Marshal(x) |
| 2890 |
case WorkspaceUnchangedDocumentDiagnosticReport: |
| 2891 |
return json.Marshal(x) |
| 2892 |
case nil: |
| 2893 |
return []byte("null"), nil |
| 2894 |
} |
| 2895 |
return nil, fmt.Errorf("type %T not one of [WorkspaceFullDocumentDiagnosticReport WorkspaceUnchangedDocumentDiagnosticReport]", t) |
| 2896 |
} |
| 2897 |
|
| 2898 |
func (t *Or_WorkspaceDocumentDiagnosticReport) UnmarshalJSON(x []byte) error { |
| 2899 |
if string(x) == "null" { |
| 2900 |
t.Value = nil |
| 2901 |
return nil |
| 2902 |
} |
| 2903 |
decoder259 := json.NewDecoder(bytes.NewReader(x)) |
| 2904 |
decoder259.DisallowUnknownFields() |
| 2905 |
var h259 WorkspaceFullDocumentDiagnosticReport |
| 2906 |
if err := decoder259.Decode(&h259); err == nil { |
| 2907 |
t.Value = h259 |
| 2908 |
return nil |
| 2909 |
} |
| 2910 |
decoder260 := json.NewDecoder(bytes.NewReader(x)) |
| 2911 |
decoder260.DisallowUnknownFields() |
| 2912 |
var h260 WorkspaceUnchangedDocumentDiagnosticReport |
| 2913 |
if err := decoder260.Decode(&h260); err == nil { |
| 2914 |
t.Value = h260 |
| 2915 |
return nil |
| 2916 |
} |
| 2917 |
return &UnmarshalError{"unmarshal failed to match one of [WorkspaceFullDocumentDiagnosticReport WorkspaceUnchangedDocumentDiagnosticReport]"} |
| 2918 |
} |
| 2919 |
|
| 2920 |
func (t Or_WorkspaceEdit_documentChanges_Elem) MarshalJSON() ([]byte, error) { |
| 2921 |
switch x := t.Value.(type) { |
| 2922 |
case CreateFile: |
| 2923 |
return json.Marshal(x) |
| 2924 |
case DeleteFile: |
| 2925 |
return json.Marshal(x) |
| 2926 |
case RenameFile: |
| 2927 |
return json.Marshal(x) |
| 2928 |
case TextDocumentEdit: |
| 2929 |
return json.Marshal(x) |
| 2930 |
case nil: |
| 2931 |
return []byte("null"), nil |
| 2932 |
} |
| 2933 |
return nil, fmt.Errorf("type %T not one of [CreateFile DeleteFile RenameFile TextDocumentEdit]", t) |
| 2934 |
} |
| 2935 |
|
| 2936 |
func (t *Or_WorkspaceEdit_documentChanges_Elem) UnmarshalJSON(x []byte) error { |
| 2937 |
if string(x) == "null" { |
| 2938 |
t.Value = nil |
| 2939 |
return nil |
| 2940 |
} |
| 2941 |
decoder4 := json.NewDecoder(bytes.NewReader(x)) |
| 2942 |
decoder4.DisallowUnknownFields() |
| 2943 |
var h4 CreateFile |
| 2944 |
if err := decoder4.Decode(&h4); err == nil { |
| 2945 |
t.Value = h4 |
| 2946 |
return nil |
| 2947 |
} |
| 2948 |
decoder5 := json.NewDecoder(bytes.NewReader(x)) |
| 2949 |
decoder5.DisallowUnknownFields() |
| 2950 |
var h5 DeleteFile |
| 2951 |
if err := decoder5.Decode(&h5); err == nil { |
| 2952 |
t.Value = h5 |
| 2953 |
return nil |
| 2954 |
} |
| 2955 |
decoder6 := json.NewDecoder(bytes.NewReader(x)) |
| 2956 |
decoder6.DisallowUnknownFields() |
| 2957 |
var h6 RenameFile |
| 2958 |
if err := decoder6.Decode(&h6); err == nil { |
| 2959 |
t.Value = h6 |
| 2960 |
return nil |
| 2961 |
} |
| 2962 |
decoder7 := json.NewDecoder(bytes.NewReader(x)) |
| 2963 |
decoder7.DisallowUnknownFields() |
| 2964 |
var h7 TextDocumentEdit |
| 2965 |
if err := decoder7.Decode(&h7); err == nil { |
| 2966 |
t.Value = h7 |
| 2967 |
return nil |
| 2968 |
} |
| 2969 |
return &UnmarshalError{"unmarshal failed to match one of [CreateFile DeleteFile RenameFile TextDocumentEdit]"} |
| 2970 |
} |
| 2971 |
|
| 2972 |
func (t Or_WorkspaceFoldersServerCapabilities_changeNotifications) MarshalJSON() ([]byte, error) { |
| 2973 |
switch x := t.Value.(type) { |
| 2974 |
case bool: |
| 2975 |
return json.Marshal(x) |
| 2976 |
case string: |
| 2977 |
return json.Marshal(x) |
| 2978 |
case nil: |
| 2979 |
return []byte("null"), nil |
| 2980 |
} |
| 2981 |
return nil, fmt.Errorf("type %T not one of [bool string]", t) |
| 2982 |
} |
| 2983 |
|
| 2984 |
func (t *Or_WorkspaceFoldersServerCapabilities_changeNotifications) UnmarshalJSON(x []byte) error { |
| 2985 |
if string(x) == "null" { |
| 2986 |
t.Value = nil |
| 2987 |
return nil |
| 2988 |
} |
| 2989 |
decoder210 := json.NewDecoder(bytes.NewReader(x)) |
| 2990 |
decoder210.DisallowUnknownFields() |
| 2991 |
var boolVal bool |
| 2992 |
if err := decoder210.Decode(&boolVal); err == nil { |
| 2993 |
t.Value = boolVal |
| 2994 |
return nil |
| 2995 |
} |
| 2996 |
decoder211 := json.NewDecoder(bytes.NewReader(x)) |
| 2997 |
decoder211.DisallowUnknownFields() |
| 2998 |
var stringVal string |
| 2999 |
if err := decoder211.Decode(&stringVal); err == nil { |
| 3000 |
t.Value = stringVal |
| 3001 |
return nil |
| 3002 |
} |
| 3003 |
return &UnmarshalError{"unmarshal failed to match one of [bool string]"} |
| 3004 |
} |
| 3005 |
|
| 3006 |
func (t Or_WorkspaceOptions_textDocumentContent) MarshalJSON() ([]byte, error) { |
| 3007 |
switch x := t.Value.(type) { |
| 3008 |
case TextDocumentContentOptions: |
| 3009 |
return json.Marshal(x) |
| 3010 |
case TextDocumentContentRegistrationOptions: |
| 3011 |
return json.Marshal(x) |
| 3012 |
case nil: |
| 3013 |
return []byte("null"), nil |
| 3014 |
} |
| 3015 |
return nil, fmt.Errorf("type %T not one of [TextDocumentContentOptions TextDocumentContentRegistrationOptions]", t) |
| 3016 |
} |
| 3017 |
|
| 3018 |
func (t *Or_WorkspaceOptions_textDocumentContent) UnmarshalJSON(x []byte) error { |
| 3019 |
if string(x) == "null" { |
| 3020 |
t.Value = nil |
| 3021 |
return nil |
| 3022 |
} |
| 3023 |
decoder199 := json.NewDecoder(bytes.NewReader(x)) |
| 3024 |
decoder199.DisallowUnknownFields() |
| 3025 |
var h199 TextDocumentContentOptions |
| 3026 |
if err := decoder199.Decode(&h199); err == nil { |
| 3027 |
t.Value = h199 |
| 3028 |
return nil |
| 3029 |
} |
| 3030 |
decoder200 := json.NewDecoder(bytes.NewReader(x)) |
| 3031 |
decoder200.DisallowUnknownFields() |
| 3032 |
var h200 TextDocumentContentRegistrationOptions |
| 3033 |
if err := decoder200.Decode(&h200); err == nil { |
| 3034 |
t.Value = h200 |
| 3035 |
return nil |
| 3036 |
} |
| 3037 |
return &UnmarshalError{"unmarshal failed to match one of [TextDocumentContentOptions TextDocumentContentRegistrationOptions]"} |
| 3038 |
} |
| 3039 |
|
| 3040 |
func (t Or_WorkspaceSymbol_location) MarshalJSON() ([]byte, error) { |
| 3041 |
switch x := t.Value.(type) { |
| 3042 |
case Location: |
| 3043 |
return json.Marshal(x) |
| 3044 |
case LocationUriOnly: |
| 3045 |
return json.Marshal(x) |
| 3046 |
case nil: |
| 3047 |
return []byte("null"), nil |
| 3048 |
} |
| 3049 |
return nil, fmt.Errorf("type %T not one of [Location LocationUriOnly]", t) |
| 3050 |
} |
| 3051 |
|
| 3052 |
func (t *Or_WorkspaceSymbol_location) UnmarshalJSON(x []byte) error { |
| 3053 |
if string(x) == "null" { |
| 3054 |
t.Value = nil |
| 3055 |
return nil |
| 3056 |
} |
| 3057 |
decoder39 := json.NewDecoder(bytes.NewReader(x)) |
| 3058 |
decoder39.DisallowUnknownFields() |
| 3059 |
var h39 Location |
| 3060 |
if err := decoder39.Decode(&h39); err == nil { |
| 3061 |
t.Value = h39 |
| 3062 |
return nil |
| 3063 |
} |
| 3064 |
decoder40 := json.NewDecoder(bytes.NewReader(x)) |
| 3065 |
decoder40.DisallowUnknownFields() |
| 3066 |
var h40 LocationUriOnly |
| 3067 |
if err := decoder40.Decode(&h40); err == nil { |
| 3068 |
t.Value = h40 |
| 3069 |
return nil |
| 3070 |
} |
| 3071 |
return &UnmarshalError{"unmarshal failed to match one of [Location LocationUriOnly]"} |
| 3072 |
} |