Debian Codegraph @

gopls/internal/protocol/tsjson.go

raw symbols SCIP
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.14 (hash 66a087310eea0d60495ba3578d78f70409c403d9).
10 // https://github.com/microsoft/vscode-languageserver-node/blob/release/protocol/3.17.6-next.14/protocol/metaModel.json
11 // LSP metaData.version = 3.17.0.
12
13 import "encoding/json"
14
15 import "fmt"
16
17 // UnmarshalError indicates that a JSON value did not conform to
18 // one of the expected cases of an LSP union type.
19 type UnmarshalError struct {
20 msg string
21 }
22
23 func (e UnmarshalError) Error() string {
24 return e.msg
25 }
26 func (t OrPLocation_workspace_symbol) MarshalJSON() ([]byte, error) {
27 switch x := t.Value.(type) {
28 case Location:
29 return json.Marshal(x)
30 case LocationUriOnly:
31 return json.Marshal(x)
32 case nil:
33 return []byte("null"), nil
34 }
35 return nil, fmt.Errorf("type %T not one of [Location LocationUriOnly]", t)
36 }
37
38 func (t *OrPLocation_workspace_symbol) UnmarshalJSON(x []byte) error {
39 if string(x) == "null" {
40 t.Value = nil
41 return nil
42 }
43 var h0 Location
44 if err := json.Unmarshal(x, &h0); err == nil {
45 t.Value = h0
46 return nil
47 }
48 var h1 LocationUriOnly
49 if err := json.Unmarshal(x, &h1); err == nil {
50 t.Value = h1
51 return nil
52 }
53 return &UnmarshalError{"unmarshal failed to match one of [Location LocationUriOnly]"}
54 }
55
56 func (t OrPSection_workspace_didChangeConfiguration) MarshalJSON() ([]byte, error) {
57 switch x := t.Value.(type) {
58 case []string:
59 return json.Marshal(x)
60 case string:
61 return json.Marshal(x)
62 case nil:
63 return []byte("null"), nil
64 }
65 return nil, fmt.Errorf("type %T not one of [[]string string]", t)
66 }
67
68 func (t *OrPSection_workspace_didChangeConfiguration) UnmarshalJSON(x []byte) error {
69 if string(x) == "null" {
70 t.Value = nil
71 return nil
72 }
73 var h0 []string
74 if err := json.Unmarshal(x, &h0); err == nil {
75 t.Value = h0
76 return nil
77 }
78 var h1 string
79 if err := json.Unmarshal(x, &h1); err == nil {
80 t.Value = h1
81 return nil
82 }
83 return &UnmarshalError{"unmarshal failed to match one of [[]string string]"}
84 }
85
86 func (t OrPTooltipPLabel) MarshalJSON() ([]byte, error) {
87 switch x := t.Value.(type) {
88 case MarkupContent:
89 return json.Marshal(x)
90 case string:
91 return json.Marshal(x)
92 case nil:
93 return []byte("null"), nil
94 }
95 return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t)
96 }
97
98 func (t *OrPTooltipPLabel) UnmarshalJSON(x []byte) error {
99 if string(x) == "null" {
100 t.Value = nil
101 return nil
102 }
103 var h0 MarkupContent
104 if err := json.Unmarshal(x, &h0); err == nil {
105 t.Value = h0
106 return nil
107 }
108 var h1 string
109 if err := json.Unmarshal(x, &h1); err == nil {
110 t.Value = h1
111 return nil
112 }
113 return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"}
114 }
115
116 func (t OrPTooltip_textDocument_inlayHint) MarshalJSON() ([]byte, error) {
117 switch x := t.Value.(type) {
118 case MarkupContent:
119 return json.Marshal(x)
120 case string:
121 return json.Marshal(x)
122 case nil:
123 return []byte("null"), nil
124 }
125 return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t)
126 }
127
128 func (t *OrPTooltip_textDocument_inlayHint) UnmarshalJSON(x []byte) error {
129 if string(x) == "null" {
130 t.Value = nil
131 return nil
132 }
133 var h0 MarkupContent
134 if err := json.Unmarshal(x, &h0); err == nil {
135 t.Value = h0
136 return nil
137 }
138 var h1 string
139 if err := json.Unmarshal(x, &h1); err == nil {
140 t.Value = h1
141 return nil
142 }
143 return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"}
144 }
145
146 func (t Or_CancelParams_id) MarshalJSON() ([]byte, error) {
147 switch x := t.Value.(type) {
148 case int32:
149 return json.Marshal(x)
150 case string:
151 return json.Marshal(x)
152 case nil:
153 return []byte("null"), nil
154 }
155 return nil, fmt.Errorf("type %T not one of [int32 string]", t)
156 }
157
158 func (t *Or_CancelParams_id) UnmarshalJSON(x []byte) error {
159 if string(x) == "null" {
160 t.Value = nil
161 return nil
162 }
163 var h0 int32
164 if err := json.Unmarshal(x, &h0); err == nil {
165 t.Value = h0
166 return nil
167 }
168 var h1 string
169 if err := json.Unmarshal(x, &h1); err == nil {
170 t.Value = h1
171 return nil
172 }
173 return &UnmarshalError{"unmarshal failed to match one of [int32 string]"}
174 }
175
176 func (t Or_ClientSemanticTokensRequestOptions_full) MarshalJSON() ([]byte, error) {
177 switch x := t.Value.(type) {
178 case ClientSemanticTokensRequestFullDelta:
179 return json.Marshal(x)
180 case bool:
181 return json.Marshal(x)
182 case nil:
183 return []byte("null"), nil
184 }
185 return nil, fmt.Errorf("type %T not one of [ClientSemanticTokensRequestFullDelta bool]", t)
186 }
187
188 func (t *Or_ClientSemanticTokensRequestOptions_full) UnmarshalJSON(x []byte) error {
189 if string(x) == "null" {
190 t.Value = nil
191 return nil
192 }
193 var h0 ClientSemanticTokensRequestFullDelta
194 if err := json.Unmarshal(x, &h0); err == nil {
195 t.Value = h0
196 return nil
197 }
198 var h1 bool
199 if err := json.Unmarshal(x, &h1); err == nil {
200 t.Value = h1
201 return nil
202 }
203 return &UnmarshalError{"unmarshal failed to match one of [ClientSemanticTokensRequestFullDelta bool]"}
204 }
205
206 func (t Or_ClientSemanticTokensRequestOptions_range) MarshalJSON() ([]byte, error) {
207 switch x := t.Value.(type) {
208 case Lit_ClientSemanticTokensRequestOptions_range_Item1:
209 return json.Marshal(x)
210 case bool:
211 return json.Marshal(x)
212 case nil:
213 return []byte("null"), nil
214 }
215 return nil, fmt.Errorf("type %T not one of [Lit_ClientSemanticTokensRequestOptions_range_Item1 bool]", t)
216 }
217
218 func (t *Or_ClientSemanticTokensRequestOptions_range) UnmarshalJSON(x []byte) error {
219 if string(x) == "null" {
220 t.Value = nil
221 return nil
222 }
223 var h0 Lit_ClientSemanticTokensRequestOptions_range_Item1
224 if err := json.Unmarshal(x, &h0); err == nil {
225 t.Value = h0
226 return nil
227 }
228 var h1 bool
229 if err := json.Unmarshal(x, &h1); err == nil {
230 t.Value = h1
231 return nil
232 }
233 return &UnmarshalError{"unmarshal failed to match one of [Lit_ClientSemanticTokensRequestOptions_range_Item1 bool]"}
234 }
235
236 func (t Or_CompletionItemDefaults_editRange) MarshalJSON() ([]byte, error) {
237 switch x := t.Value.(type) {
238 case EditRangeWithInsertReplace:
239 return json.Marshal(x)
240 case Range:
241 return json.Marshal(x)
242 case nil:
243 return []byte("null"), nil
244 }
245 return nil, fmt.Errorf("type %T not one of [EditRangeWithInsertReplace Range]", t)
246 }
247
248 func (t *Or_CompletionItemDefaults_editRange) UnmarshalJSON(x []byte) error {
249 if string(x) == "null" {
250 t.Value = nil
251 return nil
252 }
253 var h0 EditRangeWithInsertReplace
254 if err := json.Unmarshal(x, &h0); err == nil {
255 t.Value = h0
256 return nil
257 }
258 var h1 Range
259 if err := json.Unmarshal(x, &h1); err == nil {
260 t.Value = h1
261 return nil
262 }
263 return &UnmarshalError{"unmarshal failed to match one of [EditRangeWithInsertReplace Range]"}
264 }
265
266 func (t Or_CompletionItem_documentation) MarshalJSON() ([]byte, error) {
267 switch x := t.Value.(type) {
268 case MarkupContent:
269 return json.Marshal(x)
270 case string:
271 return json.Marshal(x)
272 case nil:
273 return []byte("null"), nil
274 }
275 return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t)
276 }
277
278 func (t *Or_CompletionItem_documentation) UnmarshalJSON(x []byte) error {
279 if string(x) == "null" {
280 t.Value = nil
281 return nil
282 }
283 var h0 MarkupContent
284 if err := json.Unmarshal(x, &h0); err == nil {
285 t.Value = h0
286 return nil
287 }
288 var h1 string
289 if err := json.Unmarshal(x, &h1); err == nil {
290 t.Value = h1
291 return nil
292 }
293 return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"}
294 }
295
296 func (t Or_CompletionItem_textEdit) MarshalJSON() ([]byte, error) {
297 switch x := t.Value.(type) {
298 case InsertReplaceEdit:
299 return json.Marshal(x)
300 case TextEdit:
301 return json.Marshal(x)
302 case nil:
303 return []byte("null"), nil
304 }
305 return nil, fmt.Errorf("type %T not one of [InsertReplaceEdit TextEdit]", t)
306 }
307
308 func (t *Or_CompletionItem_textEdit) UnmarshalJSON(x []byte) error {
309 if string(x) == "null" {
310 t.Value = nil
311 return nil
312 }
313 var h0 InsertReplaceEdit
314 if err := json.Unmarshal(x, &h0); err == nil {
315 t.Value = h0
316 return nil
317 }
318 var h1 TextEdit
319 if err := json.Unmarshal(x, &h1); err == nil {
320 t.Value = h1
321 return nil
322 }
323 return &UnmarshalError{"unmarshal failed to match one of [InsertReplaceEdit TextEdit]"}
324 }
325
326 func (t Or_Definition) MarshalJSON() ([]byte, error) {
327 switch x := t.Value.(type) {
328 case Location:
329 return json.Marshal(x)
330 case []Location:
331 return json.Marshal(x)
332 case nil:
333 return []byte("null"), nil
334 }
335 return nil, fmt.Errorf("type %T not one of [Location []Location]", t)
336 }
337
338 func (t *Or_Definition) UnmarshalJSON(x []byte) error {
339 if string(x) == "null" {
340 t.Value = nil
341 return nil
342 }
343 var h0 Location
344 if err := json.Unmarshal(x, &h0); err == nil {
345 t.Value = h0
346 return nil
347 }
348 var h1 []Location
349 if err := json.Unmarshal(x, &h1); err == nil {
350 t.Value = h1
351 return nil
352 }
353 return &UnmarshalError{"unmarshal failed to match one of [Location []Location]"}
354 }
355
356 func (t Or_Diagnostic_code) MarshalJSON() ([]byte, error) {
357 switch x := t.Value.(type) {
358 case int32:
359 return json.Marshal(x)
360 case string:
361 return json.Marshal(x)
362 case nil:
363 return []byte("null"), nil
364 }
365 return nil, fmt.Errorf("type %T not one of [int32 string]", t)
366 }
367
368 func (t *Or_Diagnostic_code) UnmarshalJSON(x []byte) error {
369 if string(x) == "null" {
370 t.Value = nil
371 return nil
372 }
373 var h0 int32
374 if err := json.Unmarshal(x, &h0); err == nil {
375 t.Value = h0
376 return nil
377 }
378 var h1 string
379 if err := json.Unmarshal(x, &h1); err == nil {
380 t.Value = h1
381 return nil
382 }
383 return &UnmarshalError{"unmarshal failed to match one of [int32 string]"}
384 }
385
386 func (t Or_DocumentDiagnosticReport) MarshalJSON() ([]byte, error) {
387 switch x := t.Value.(type) {
388 case RelatedFullDocumentDiagnosticReport:
389 return json.Marshal(x)
390 case RelatedUnchangedDocumentDiagnosticReport:
391 return json.Marshal(x)
392 case nil:
393 return []byte("null"), nil
394 }
395 return nil, fmt.Errorf("type %T not one of [RelatedFullDocumentDiagnosticReport RelatedUnchangedDocumentDiagnosticReport]", t)
396 }
397
398 func (t *Or_DocumentDiagnosticReport) UnmarshalJSON(x []byte) error {
399 if string(x) == "null" {
400 t.Value = nil
401 return nil
402 }
403 var h0 RelatedFullDocumentDiagnosticReport
404 if err := json.Unmarshal(x, &h0); err == nil {
405 t.Value = h0
406 return nil
407 }
408 var h1 RelatedUnchangedDocumentDiagnosticReport
409 if err := json.Unmarshal(x, &h1); err == nil {
410 t.Value = h1
411 return nil
412 }
413 return &UnmarshalError{"unmarshal failed to match one of [RelatedFullDocumentDiagnosticReport RelatedUnchangedDocumentDiagnosticReport]"}
414 }
415
416 func (t Or_DocumentDiagnosticReportPartialResult_relatedDocuments_Value) MarshalJSON() ([]byte, error) {
417 switch x := t.Value.(type) {
418 case FullDocumentDiagnosticReport:
419 return json.Marshal(x)
420 case UnchangedDocumentDiagnosticReport:
421 return json.Marshal(x)
422 case nil:
423 return []byte("null"), nil
424 }
425 return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t)
426 }
427
428 func (t *Or_DocumentDiagnosticReportPartialResult_relatedDocuments_Value) UnmarshalJSON(x []byte) error {
429 if string(x) == "null" {
430 t.Value = nil
431 return nil
432 }
433 var h0 FullDocumentDiagnosticReport
434 if err := json.Unmarshal(x, &h0); err == nil {
435 t.Value = h0
436 return nil
437 }
438 var h1 UnchangedDocumentDiagnosticReport
439 if err := json.Unmarshal(x, &h1); err == nil {
440 t.Value = h1
441 return nil
442 }
443 return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"}
444 }
445
446 func (t Or_DocumentFilter) MarshalJSON() ([]byte, error) {
447 switch x := t.Value.(type) {
448 case NotebookCellTextDocumentFilter:
449 return json.Marshal(x)
450 case TextDocumentFilter:
451 return json.Marshal(x)
452 case nil:
453 return []byte("null"), nil
454 }
455 return nil, fmt.Errorf("type %T not one of [NotebookCellTextDocumentFilter TextDocumentFilter]", t)
456 }
457
458 func (t *Or_DocumentFilter) UnmarshalJSON(x []byte) error {
459 if string(x) == "null" {
460 t.Value = nil
461 return nil
462 }
463 var h0 NotebookCellTextDocumentFilter
464 if err := json.Unmarshal(x, &h0); err == nil {
465 t.Value = h0
466 return nil
467 }
468 var h1 TextDocumentFilter
469 if err := json.Unmarshal(x, &h1); err == nil {
470 t.Value = h1
471 return nil
472 }
473 return &UnmarshalError{"unmarshal failed to match one of [NotebookCellTextDocumentFilter TextDocumentFilter]"}
474 }
475
476 func (t Or_GlobPattern) MarshalJSON() ([]byte, error) {
477 switch x := t.Value.(type) {
478 case Pattern:
479 return json.Marshal(x)
480 case RelativePattern:
481 return json.Marshal(x)
482 case nil:
483 return []byte("null"), nil
484 }
485 return nil, fmt.Errorf("type %T not one of [Pattern RelativePattern]", t)
486 }
487
488 func (t *Or_GlobPattern) UnmarshalJSON(x []byte) error {
489 if string(x) == "null" {
490 t.Value = nil
491 return nil
492 }
493 var h0 Pattern
494 if err := json.Unmarshal(x, &h0); err == nil {
495 t.Value = h0
496 return nil
497 }
498 var h1 RelativePattern
499 if err := json.Unmarshal(x, &h1); err == nil {
500 t.Value = h1
501 return nil
502 }
503 return &UnmarshalError{"unmarshal failed to match one of [Pattern RelativePattern]"}
504 }
505
506 func (t Or_Hover_contents) MarshalJSON() ([]byte, error) {
507 switch x := t.Value.(type) {
508 case MarkedString:
509 return json.Marshal(x)
510 case MarkupContent:
511 return json.Marshal(x)
512 case []MarkedString:
513 return json.Marshal(x)
514 case nil:
515 return []byte("null"), nil
516 }
517 return nil, fmt.Errorf("type %T not one of [MarkedString MarkupContent []MarkedString]", t)
518 }
519
520 func (t *Or_Hover_contents) UnmarshalJSON(x []byte) error {
521 if string(x) == "null" {
522 t.Value = nil
523 return nil
524 }
525 var h0 MarkedString
526 if err := json.Unmarshal(x, &h0); err == nil {
527 t.Value = h0
528 return nil
529 }
530 var h1 MarkupContent
531 if err := json.Unmarshal(x, &h1); err == nil {
532 t.Value = h1
533 return nil
534 }
535 var h2 []MarkedString
536 if err := json.Unmarshal(x, &h2); err == nil {
537 t.Value = h2
538 return nil
539 }
540 return &UnmarshalError{"unmarshal failed to match one of [MarkedString MarkupContent []MarkedString]"}
541 }
542
543 func (t Or_InlayHint_label) MarshalJSON() ([]byte, error) {
544 switch x := t.Value.(type) {
545 case []InlayHintLabelPart:
546 return json.Marshal(x)
547 case string:
548 return json.Marshal(x)
549 case nil:
550 return []byte("null"), nil
551 }
552 return nil, fmt.Errorf("type %T not one of [[]InlayHintLabelPart string]", t)
553 }
554
555 func (t *Or_InlayHint_label) UnmarshalJSON(x []byte) error {
556 if string(x) == "null" {
557 t.Value = nil
558 return nil
559 }
560 var h0 []InlayHintLabelPart
561 if err := json.Unmarshal(x, &h0); err == nil {
562 t.Value = h0
563 return nil
564 }
565 var h1 string
566 if err := json.Unmarshal(x, &h1); err == nil {
567 t.Value = h1
568 return nil
569 }
570 return &UnmarshalError{"unmarshal failed to match one of [[]InlayHintLabelPart string]"}
571 }
572
573 func (t Or_InlineCompletionItem_insertText) MarshalJSON() ([]byte, error) {
574 switch x := t.Value.(type) {
575 case StringValue:
576 return json.Marshal(x)
577 case string:
578 return json.Marshal(x)
579 case nil:
580 return []byte("null"), nil
581 }
582 return nil, fmt.Errorf("type %T not one of [StringValue string]", t)
583 }
584
585 func (t *Or_InlineCompletionItem_insertText) UnmarshalJSON(x []byte) error {
586 if string(x) == "null" {
587 t.Value = nil
588 return nil
589 }
590 var h0 StringValue
591 if err := json.Unmarshal(x, &h0); err == nil {
592 t.Value = h0
593 return nil
594 }
595 var h1 string
596 if err := json.Unmarshal(x, &h1); err == nil {
597 t.Value = h1
598 return nil
599 }
600 return &UnmarshalError{"unmarshal failed to match one of [StringValue string]"}
601 }
602
603 func (t Or_InlineValue) MarshalJSON() ([]byte, error) {
604 switch x := t.Value.(type) {
605 case InlineValueEvaluatableExpression:
606 return json.Marshal(x)
607 case InlineValueText:
608 return json.Marshal(x)
609 case InlineValueVariableLookup:
610 return json.Marshal(x)
611 case nil:
612 return []byte("null"), nil
613 }
614 return nil, fmt.Errorf("type %T not one of [InlineValueEvaluatableExpression InlineValueText InlineValueVariableLookup]", t)
615 }
616
617 func (t *Or_InlineValue) UnmarshalJSON(x []byte) error {
618 if string(x) == "null" {
619 t.Value = nil
620 return nil
621 }
622 var h0 InlineValueEvaluatableExpression
623 if err := json.Unmarshal(x, &h0); err == nil {
624 t.Value = h0
625 return nil
626 }
627 var h1 InlineValueText
628 if err := json.Unmarshal(x, &h1); err == nil {
629 t.Value = h1
630 return nil
631 }
632 var h2 InlineValueVariableLookup
633 if err := json.Unmarshal(x, &h2); err == nil {
634 t.Value = h2
635 return nil
636 }
637 return &UnmarshalError{"unmarshal failed to match one of [InlineValueEvaluatableExpression InlineValueText InlineValueVariableLookup]"}
638 }
639
640 func (t Or_MarkedString) MarshalJSON() ([]byte, error) {
641 switch x := t.Value.(type) {
642 case MarkedStringWithLanguage:
643 return json.Marshal(x)
644 case string:
645 return json.Marshal(x)
646 case nil:
647 return []byte("null"), nil
648 }
649 return nil, fmt.Errorf("type %T not one of [MarkedStringWithLanguage string]", t)
650 }
651
652 func (t *Or_MarkedString) UnmarshalJSON(x []byte) error {
653 if string(x) == "null" {
654 t.Value = nil
655 return nil
656 }
657 var h0 MarkedStringWithLanguage
658 if err := json.Unmarshal(x, &h0); err == nil {
659 t.Value = h0
660 return nil
661 }
662 var h1 string
663 if err := json.Unmarshal(x, &h1); err == nil {
664 t.Value = h1
665 return nil
666 }
667 return &UnmarshalError{"unmarshal failed to match one of [MarkedStringWithLanguage string]"}
668 }
669
670 func (t Or_NotebookCellTextDocumentFilter_notebook) MarshalJSON() ([]byte, error) {
671 switch x := t.Value.(type) {
672 case NotebookDocumentFilter:
673 return json.Marshal(x)
674 case string:
675 return json.Marshal(x)
676 case nil:
677 return []byte("null"), nil
678 }
679 return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t)
680 }
681
682 func (t *Or_NotebookCellTextDocumentFilter_notebook) UnmarshalJSON(x []byte) error {
683 if string(x) == "null" {
684 t.Value = nil
685 return nil
686 }
687 var h0 NotebookDocumentFilter
688 if err := json.Unmarshal(x, &h0); err == nil {
689 t.Value = h0
690 return nil
691 }
692 var h1 string
693 if err := json.Unmarshal(x, &h1); err == nil {
694 t.Value = h1
695 return nil
696 }
697 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"}
698 }
699
700 func (t Or_NotebookDocumentFilter) MarshalJSON() ([]byte, error) {
701 switch x := t.Value.(type) {
702 case NotebookDocumentFilterNotebookType:
703 return json.Marshal(x)
704 case NotebookDocumentFilterPattern:
705 return json.Marshal(x)
706 case NotebookDocumentFilterScheme:
707 return json.Marshal(x)
708 case nil:
709 return []byte("null"), nil
710 }
711 return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilterNotebookType NotebookDocumentFilterPattern NotebookDocumentFilterScheme]", t)
712 }
713
714 func (t *Or_NotebookDocumentFilter) UnmarshalJSON(x []byte) error {
715 if string(x) == "null" {
716 t.Value = nil
717 return nil
718 }
719 var h0 NotebookDocumentFilterNotebookType
720 if err := json.Unmarshal(x, &h0); err == nil {
721 t.Value = h0
722 return nil
723 }
724 var h1 NotebookDocumentFilterPattern
725 if err := json.Unmarshal(x, &h1); err == nil {
726 t.Value = h1
727 return nil
728 }
729 var h2 NotebookDocumentFilterScheme
730 if err := json.Unmarshal(x, &h2); err == nil {
731 t.Value = h2
732 return nil
733 }
734 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilterNotebookType NotebookDocumentFilterPattern NotebookDocumentFilterScheme]"}
735 }
736
737 func (t Or_NotebookDocumentFilterWithCells_notebook) MarshalJSON() ([]byte, error) {
738 switch x := t.Value.(type) {
739 case NotebookDocumentFilter:
740 return json.Marshal(x)
741 case string:
742 return json.Marshal(x)
743 case nil:
744 return []byte("null"), nil
745 }
746 return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t)
747 }
748
749 func (t *Or_NotebookDocumentFilterWithCells_notebook) UnmarshalJSON(x []byte) error {
750 if string(x) == "null" {
751 t.Value = nil
752 return nil
753 }
754 var h0 NotebookDocumentFilter
755 if err := json.Unmarshal(x, &h0); err == nil {
756 t.Value = h0
757 return nil
758 }
759 var h1 string
760 if err := json.Unmarshal(x, &h1); err == nil {
761 t.Value = h1
762 return nil
763 }
764 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"}
765 }
766
767 func (t Or_NotebookDocumentFilterWithNotebook_notebook) MarshalJSON() ([]byte, error) {
768 switch x := t.Value.(type) {
769 case NotebookDocumentFilter:
770 return json.Marshal(x)
771 case string:
772 return json.Marshal(x)
773 case nil:
774 return []byte("null"), nil
775 }
776 return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilter string]", t)
777 }
778
779 func (t *Or_NotebookDocumentFilterWithNotebook_notebook) UnmarshalJSON(x []byte) error {
780 if string(x) == "null" {
781 t.Value = nil
782 return nil
783 }
784 var h0 NotebookDocumentFilter
785 if err := json.Unmarshal(x, &h0); err == nil {
786 t.Value = h0
787 return nil
788 }
789 var h1 string
790 if err := json.Unmarshal(x, &h1); err == nil {
791 t.Value = h1
792 return nil
793 }
794 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilter string]"}
795 }
796
797 func (t Or_NotebookDocumentSyncOptions_notebookSelector_Elem) MarshalJSON() ([]byte, error) {
798 switch x := t.Value.(type) {
799 case NotebookDocumentFilterWithCells:
800 return json.Marshal(x)
801 case NotebookDocumentFilterWithNotebook:
802 return json.Marshal(x)
803 case nil:
804 return []byte("null"), nil
805 }
806 return nil, fmt.Errorf("type %T not one of [NotebookDocumentFilterWithCells NotebookDocumentFilterWithNotebook]", t)
807 }
808
809 func (t *Or_NotebookDocumentSyncOptions_notebookSelector_Elem) UnmarshalJSON(x []byte) error {
810 if string(x) == "null" {
811 t.Value = nil
812 return nil
813 }
814 var h0 NotebookDocumentFilterWithCells
815 if err := json.Unmarshal(x, &h0); err == nil {
816 t.Value = h0
817 return nil
818 }
819 var h1 NotebookDocumentFilterWithNotebook
820 if err := json.Unmarshal(x, &h1); err == nil {
821 t.Value = h1
822 return nil
823 }
824 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentFilterWithCells NotebookDocumentFilterWithNotebook]"}
825 }
826
827 func (t Or_RelatedFullDocumentDiagnosticReport_relatedDocuments_Value) MarshalJSON() ([]byte, error) {
828 switch x := t.Value.(type) {
829 case FullDocumentDiagnosticReport:
830 return json.Marshal(x)
831 case UnchangedDocumentDiagnosticReport:
832 return json.Marshal(x)
833 case nil:
834 return []byte("null"), nil
835 }
836 return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t)
837 }
838
839 func (t *Or_RelatedFullDocumentDiagnosticReport_relatedDocuments_Value) UnmarshalJSON(x []byte) error {
840 if string(x) == "null" {
841 t.Value = nil
842 return nil
843 }
844 var h0 FullDocumentDiagnosticReport
845 if err := json.Unmarshal(x, &h0); err == nil {
846 t.Value = h0
847 return nil
848 }
849 var h1 UnchangedDocumentDiagnosticReport
850 if err := json.Unmarshal(x, &h1); err == nil {
851 t.Value = h1
852 return nil
853 }
854 return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"}
855 }
856
857 func (t Or_RelatedUnchangedDocumentDiagnosticReport_relatedDocuments_Value) MarshalJSON() ([]byte, error) {
858 switch x := t.Value.(type) {
859 case FullDocumentDiagnosticReport:
860 return json.Marshal(x)
861 case UnchangedDocumentDiagnosticReport:
862 return json.Marshal(x)
863 case nil:
864 return []byte("null"), nil
865 }
866 return nil, fmt.Errorf("type %T not one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]", t)
867 }
868
869 func (t *Or_RelatedUnchangedDocumentDiagnosticReport_relatedDocuments_Value) UnmarshalJSON(x []byte) error {
870 if string(x) == "null" {
871 t.Value = nil
872 return nil
873 }
874 var h0 FullDocumentDiagnosticReport
875 if err := json.Unmarshal(x, &h0); err == nil {
876 t.Value = h0
877 return nil
878 }
879 var h1 UnchangedDocumentDiagnosticReport
880 if err := json.Unmarshal(x, &h1); err == nil {
881 t.Value = h1
882 return nil
883 }
884 return &UnmarshalError{"unmarshal failed to match one of [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]"}
885 }
886
887 func (t Or_Result_textDocument_codeAction_Item0_Elem) MarshalJSON() ([]byte, error) {
888 switch x := t.Value.(type) {
889 case CodeAction:
890 return json.Marshal(x)
891 case Command:
892 return json.Marshal(x)
893 case nil:
894 return []byte("null"), nil
895 }
896 return nil, fmt.Errorf("type %T not one of [CodeAction Command]", t)
897 }
898
899 func (t *Or_Result_textDocument_codeAction_Item0_Elem) UnmarshalJSON(x []byte) error {
900 if string(x) == "null" {
901 t.Value = nil
902 return nil
903 }
904 var h0 CodeAction
905 if err := json.Unmarshal(x, &h0); err == nil {
906 t.Value = h0
907 return nil
908 }
909 var h1 Command
910 if err := json.Unmarshal(x, &h1); err == nil {
911 t.Value = h1
912 return nil
913 }
914 return &UnmarshalError{"unmarshal failed to match one of [CodeAction Command]"}
915 }
916
917 func (t Or_Result_textDocument_inlineCompletion) MarshalJSON() ([]byte, error) {
918 switch x := t.Value.(type) {
919 case InlineCompletionList:
920 return json.Marshal(x)
921 case []InlineCompletionItem:
922 return json.Marshal(x)
923 case nil:
924 return []byte("null"), nil
925 }
926 return nil, fmt.Errorf("type %T not one of [InlineCompletionList []InlineCompletionItem]", t)
927 }
928
929 func (t *Or_Result_textDocument_inlineCompletion) UnmarshalJSON(x []byte) error {
930 if string(x) == "null" {
931 t.Value = nil
932 return nil
933 }
934 var h0 InlineCompletionList
935 if err := json.Unmarshal(x, &h0); err == nil {
936 t.Value = h0
937 return nil
938 }
939 var h1 []InlineCompletionItem
940 if err := json.Unmarshal(x, &h1); err == nil {
941 t.Value = h1
942 return nil
943 }
944 return &UnmarshalError{"unmarshal failed to match one of [InlineCompletionList []InlineCompletionItem]"}
945 }
946
947 func (t Or_SemanticTokensOptions_full) MarshalJSON() ([]byte, error) {
948 switch x := t.Value.(type) {
949 case SemanticTokensFullDelta:
950 return json.Marshal(x)
951 case bool:
952 return json.Marshal(x)
953 case nil:
954 return []byte("null"), nil
955 }
956 return nil, fmt.Errorf("type %T not one of [SemanticTokensFullDelta bool]", t)
957 }
958
959 func (t *Or_SemanticTokensOptions_full) UnmarshalJSON(x []byte) error {
960 if string(x) == "null" {
961 t.Value = nil
962 return nil
963 }
964 var h0 SemanticTokensFullDelta
965 if err := json.Unmarshal(x, &h0); err == nil {
966 t.Value = h0
967 return nil
968 }
969 var h1 bool
970 if err := json.Unmarshal(x, &h1); err == nil {
971 t.Value = h1
972 return nil
973 }
974 return &UnmarshalError{"unmarshal failed to match one of [SemanticTokensFullDelta bool]"}
975 }
976
977 func (t Or_SemanticTokensOptions_range) MarshalJSON() ([]byte, error) {
978 switch x := t.Value.(type) {
979 case PRangeESemanticTokensOptions:
980 return json.Marshal(x)
981 case bool:
982 return json.Marshal(x)
983 case nil:
984 return []byte("null"), nil
985 }
986 return nil, fmt.Errorf("type %T not one of [PRangeESemanticTokensOptions bool]", t)
987 }
988
989 func (t *Or_SemanticTokensOptions_range) UnmarshalJSON(x []byte) error {
990 if string(x) == "null" {
991 t.Value = nil
992 return nil
993 }
994 var h0 PRangeESemanticTokensOptions
995 if err := json.Unmarshal(x, &h0); err == nil {
996 t.Value = h0
997 return nil
998 }
999 var h1 bool
1000 if err := json.Unmarshal(x, &h1); err == nil {
1001 t.Value = h1
1002 return nil
1003 }
1004 return &UnmarshalError{"unmarshal failed to match one of [PRangeESemanticTokensOptions bool]"}
1005 }
1006
1007 func (t Or_ServerCapabilities_callHierarchyProvider) MarshalJSON() ([]byte, error) {
1008 switch x := t.Value.(type) {
1009 case CallHierarchyOptions:
1010 return json.Marshal(x)
1011 case CallHierarchyRegistrationOptions:
1012 return json.Marshal(x)
1013 case bool:
1014 return json.Marshal(x)
1015 case nil:
1016 return []byte("null"), nil
1017 }
1018 return nil, fmt.Errorf("type %T not one of [CallHierarchyOptions CallHierarchyRegistrationOptions bool]", t)
1019 }
1020
1021 func (t *Or_ServerCapabilities_callHierarchyProvider) UnmarshalJSON(x []byte) error {
1022 if string(x) == "null" {
1023 t.Value = nil
1024 return nil
1025 }
1026 var h0 CallHierarchyOptions
1027 if err := json.Unmarshal(x, &h0); err == nil {
1028 t.Value = h0
1029 return nil
1030 }
1031 var h1 CallHierarchyRegistrationOptions
1032 if err := json.Unmarshal(x, &h1); err == nil {
1033 t.Value = h1
1034 return nil
1035 }
1036 var h2 bool
1037 if err := json.Unmarshal(x, &h2); err == nil {
1038 t.Value = h2
1039 return nil
1040 }
1041 return &UnmarshalError{"unmarshal failed to match one of [CallHierarchyOptions CallHierarchyRegistrationOptions bool]"}
1042 }
1043
1044 func (t Or_ServerCapabilities_codeActionProvider) MarshalJSON() ([]byte, error) {
1045 switch x := t.Value.(type) {
1046 case CodeActionOptions:
1047 return json.Marshal(x)
1048 case bool:
1049 return json.Marshal(x)
1050 case nil:
1051 return []byte("null"), nil
1052 }
1053 return nil, fmt.Errorf("type %T not one of [CodeActionOptions bool]", t)
1054 }
1055
1056 func (t *Or_ServerCapabilities_codeActionProvider) UnmarshalJSON(x []byte) error {
1057 if string(x) == "null" {
1058 t.Value = nil
1059 return nil
1060 }
1061 var h0 CodeActionOptions
1062 if err := json.Unmarshal(x, &h0); err == nil {
1063 t.Value = h0
1064 return nil
1065 }
1066 var h1 bool
1067 if err := json.Unmarshal(x, &h1); err == nil {
1068 t.Value = h1
1069 return nil
1070 }
1071 return &UnmarshalError{"unmarshal failed to match one of [CodeActionOptions bool]"}
1072 }
1073
1074 func (t Or_ServerCapabilities_colorProvider) MarshalJSON() ([]byte, error) {
1075 switch x := t.Value.(type) {
1076 case DocumentColorOptions:
1077 return json.Marshal(x)
1078 case DocumentColorRegistrationOptions:
1079 return json.Marshal(x)
1080 case bool:
1081 return json.Marshal(x)
1082 case nil:
1083 return []byte("null"), nil
1084 }
1085 return nil, fmt.Errorf("type %T not one of [DocumentColorOptions DocumentColorRegistrationOptions bool]", t)
1086 }
1087
1088 func (t *Or_ServerCapabilities_colorProvider) UnmarshalJSON(x []byte) error {
1089 if string(x) == "null" {
1090 t.Value = nil
1091 return nil
1092 }
1093 var h0 DocumentColorOptions
1094 if err := json.Unmarshal(x, &h0); err == nil {
1095 t.Value = h0
1096 return nil
1097 }
1098 var h1 DocumentColorRegistrationOptions
1099 if err := json.Unmarshal(x, &h1); err == nil {
1100 t.Value = h1
1101 return nil
1102 }
1103 var h2 bool
1104 if err := json.Unmarshal(x, &h2); err == nil {
1105 t.Value = h2
1106 return nil
1107 }
1108 return &UnmarshalError{"unmarshal failed to match one of [DocumentColorOptions DocumentColorRegistrationOptions bool]"}
1109 }
1110
1111 func (t Or_ServerCapabilities_declarationProvider) MarshalJSON() ([]byte, error) {
1112 switch x := t.Value.(type) {
1113 case DeclarationOptions:
1114 return json.Marshal(x)
1115 case DeclarationRegistrationOptions:
1116 return json.Marshal(x)
1117 case bool:
1118 return json.Marshal(x)
1119 case nil:
1120 return []byte("null"), nil
1121 }
1122 return nil, fmt.Errorf("type %T not one of [DeclarationOptions DeclarationRegistrationOptions bool]", t)
1123 }
1124
1125 func (t *Or_ServerCapabilities_declarationProvider) UnmarshalJSON(x []byte) error {
1126 if string(x) == "null" {
1127 t.Value = nil
1128 return nil
1129 }
1130 var h0 DeclarationOptions
1131 if err := json.Unmarshal(x, &h0); err == nil {
1132 t.Value = h0
1133 return nil
1134 }
1135 var h1 DeclarationRegistrationOptions
1136 if err := json.Unmarshal(x, &h1); err == nil {
1137 t.Value = h1
1138 return nil
1139 }
1140 var h2 bool
1141 if err := json.Unmarshal(x, &h2); err == nil {
1142 t.Value = h2
1143 return nil
1144 }
1145 return &UnmarshalError{"unmarshal failed to match one of [DeclarationOptions DeclarationRegistrationOptions bool]"}
1146 }
1147
1148 func (t Or_ServerCapabilities_definitionProvider) MarshalJSON() ([]byte, error) {
1149 switch x := t.Value.(type) {
1150 case DefinitionOptions:
1151 return json.Marshal(x)
1152 case bool:
1153 return json.Marshal(x)
1154 case nil:
1155 return []byte("null"), nil
1156 }
1157 return nil, fmt.Errorf("type %T not one of [DefinitionOptions bool]", t)
1158 }
1159
1160 func (t *Or_ServerCapabilities_definitionProvider) UnmarshalJSON(x []byte) error {
1161 if string(x) == "null" {
1162 t.Value = nil
1163 return nil
1164 }
1165 var h0 DefinitionOptions
1166 if err := json.Unmarshal(x, &h0); err == nil {
1167 t.Value = h0
1168 return nil
1169 }
1170 var h1 bool
1171 if err := json.Unmarshal(x, &h1); err == nil {
1172 t.Value = h1
1173 return nil
1174 }
1175 return &UnmarshalError{"unmarshal failed to match one of [DefinitionOptions bool]"}
1176 }
1177
1178 func (t Or_ServerCapabilities_diagnosticProvider) MarshalJSON() ([]byte, error) {
1179 switch x := t.Value.(type) {
1180 case DiagnosticOptions:
1181 return json.Marshal(x)
1182 case DiagnosticRegistrationOptions:
1183 return json.Marshal(x)
1184 case nil:
1185 return []byte("null"), nil
1186 }
1187 return nil, fmt.Errorf("type %T not one of [DiagnosticOptions DiagnosticRegistrationOptions]", t)
1188 }
1189
1190 func (t *Or_ServerCapabilities_diagnosticProvider) UnmarshalJSON(x []byte) error {
1191 if string(x) == "null" {
1192 t.Value = nil
1193 return nil
1194 }
1195 var h0 DiagnosticOptions
1196 if err := json.Unmarshal(x, &h0); err == nil {
1197 t.Value = h0
1198 return nil
1199 }
1200 var h1 DiagnosticRegistrationOptions
1201 if err := json.Unmarshal(x, &h1); err == nil {
1202 t.Value = h1
1203 return nil
1204 }
1205 return &UnmarshalError{"unmarshal failed to match one of [DiagnosticOptions DiagnosticRegistrationOptions]"}
1206 }
1207
1208 func (t Or_ServerCapabilities_documentFormattingProvider) MarshalJSON() ([]byte, error) {
1209 switch x := t.Value.(type) {
1210 case DocumentFormattingOptions:
1211 return json.Marshal(x)
1212 case bool:
1213 return json.Marshal(x)
1214 case nil:
1215 return []byte("null"), nil
1216 }
1217 return nil, fmt.Errorf("type %T not one of [DocumentFormattingOptions bool]", t)
1218 }
1219
1220 func (t *Or_ServerCapabilities_documentFormattingProvider) UnmarshalJSON(x []byte) error {
1221 if string(x) == "null" {
1222 t.Value = nil
1223 return nil
1224 }
1225 var h0 DocumentFormattingOptions
1226 if err := json.Unmarshal(x, &h0); err == nil {
1227 t.Value = h0
1228 return nil
1229 }
1230 var h1 bool
1231 if err := json.Unmarshal(x, &h1); err == nil {
1232 t.Value = h1
1233 return nil
1234 }
1235 return &UnmarshalError{"unmarshal failed to match one of [DocumentFormattingOptions bool]"}
1236 }
1237
1238 func (t Or_ServerCapabilities_documentHighlightProvider) MarshalJSON() ([]byte, error) {
1239 switch x := t.Value.(type) {
1240 case DocumentHighlightOptions:
1241 return json.Marshal(x)
1242 case bool:
1243 return json.Marshal(x)
1244 case nil:
1245 return []byte("null"), nil
1246 }
1247 return nil, fmt.Errorf("type %T not one of [DocumentHighlightOptions bool]", t)
1248 }
1249
1250 func (t *Or_ServerCapabilities_documentHighlightProvider) UnmarshalJSON(x []byte) error {
1251 if string(x) == "null" {
1252 t.Value = nil
1253 return nil
1254 }
1255 var h0 DocumentHighlightOptions
1256 if err := json.Unmarshal(x, &h0); err == nil {
1257 t.Value = h0
1258 return nil
1259 }
1260 var h1 bool
1261 if err := json.Unmarshal(x, &h1); err == nil {
1262 t.Value = h1
1263 return nil
1264 }
1265 return &UnmarshalError{"unmarshal failed to match one of [DocumentHighlightOptions bool]"}
1266 }
1267
1268 func (t Or_ServerCapabilities_documentRangeFormattingProvider) MarshalJSON() ([]byte, error) {
1269 switch x := t.Value.(type) {
1270 case DocumentRangeFormattingOptions:
1271 return json.Marshal(x)
1272 case bool:
1273 return json.Marshal(x)
1274 case nil:
1275 return []byte("null"), nil
1276 }
1277 return nil, fmt.Errorf("type %T not one of [DocumentRangeFormattingOptions bool]", t)
1278 }
1279
1280 func (t *Or_ServerCapabilities_documentRangeFormattingProvider) UnmarshalJSON(x []byte) error {
1281 if string(x) == "null" {
1282 t.Value = nil
1283 return nil
1284 }
1285 var h0 DocumentRangeFormattingOptions
1286 if err := json.Unmarshal(x, &h0); err == nil {
1287 t.Value = h0
1288 return nil
1289 }
1290 var h1 bool
1291 if err := json.Unmarshal(x, &h1); err == nil {
1292 t.Value = h1
1293 return nil
1294 }
1295 return &UnmarshalError{"unmarshal failed to match one of [DocumentRangeFormattingOptions bool]"}
1296 }
1297
1298 func (t Or_ServerCapabilities_documentSymbolProvider) MarshalJSON() ([]byte, error) {
1299 switch x := t.Value.(type) {
1300 case DocumentSymbolOptions:
1301 return json.Marshal(x)
1302 case bool:
1303 return json.Marshal(x)
1304 case nil:
1305 return []byte("null"), nil
1306 }
1307 return nil, fmt.Errorf("type %T not one of [DocumentSymbolOptions bool]", t)
1308 }
1309
1310 func (t *Or_ServerCapabilities_documentSymbolProvider) UnmarshalJSON(x []byte) error {
1311 if string(x) == "null" {
1312 t.Value = nil
1313 return nil
1314 }
1315 var h0 DocumentSymbolOptions
1316 if err := json.Unmarshal(x, &h0); err == nil {
1317 t.Value = h0
1318 return nil
1319 }
1320 var h1 bool
1321 if err := json.Unmarshal(x, &h1); err == nil {
1322 t.Value = h1
1323 return nil
1324 }
1325 return &UnmarshalError{"unmarshal failed to match one of [DocumentSymbolOptions bool]"}
1326 }
1327
1328 func (t Or_ServerCapabilities_foldingRangeProvider) MarshalJSON() ([]byte, error) {
1329 switch x := t.Value.(type) {
1330 case FoldingRangeOptions:
1331 return json.Marshal(x)
1332 case FoldingRangeRegistrationOptions:
1333 return json.Marshal(x)
1334 case bool:
1335 return json.Marshal(x)
1336 case nil:
1337 return []byte("null"), nil
1338 }
1339 return nil, fmt.Errorf("type %T not one of [FoldingRangeOptions FoldingRangeRegistrationOptions bool]", t)
1340 }
1341
1342 func (t *Or_ServerCapabilities_foldingRangeProvider) UnmarshalJSON(x []byte) error {
1343 if string(x) == "null" {
1344 t.Value = nil
1345 return nil
1346 }
1347 var h0 FoldingRangeOptions
1348 if err := json.Unmarshal(x, &h0); err == nil {
1349 t.Value = h0
1350 return nil
1351 }
1352 var h1 FoldingRangeRegistrationOptions
1353 if err := json.Unmarshal(x, &h1); err == nil {
1354 t.Value = h1
1355 return nil
1356 }
1357 var h2 bool
1358 if err := json.Unmarshal(x, &h2); err == nil {
1359 t.Value = h2
1360 return nil
1361 }
1362 return &UnmarshalError{"unmarshal failed to match one of [FoldingRangeOptions FoldingRangeRegistrationOptions bool]"}
1363 }
1364
1365 func (t Or_ServerCapabilities_hoverProvider) MarshalJSON() ([]byte, error) {
1366 switch x := t.Value.(type) {
1367 case HoverOptions:
1368 return json.Marshal(x)
1369 case bool:
1370 return json.Marshal(x)
1371 case nil:
1372 return []byte("null"), nil
1373 }
1374 return nil, fmt.Errorf("type %T not one of [HoverOptions bool]", t)
1375 }
1376
1377 func (t *Or_ServerCapabilities_hoverProvider) UnmarshalJSON(x []byte) error {
1378 if string(x) == "null" {
1379 t.Value = nil
1380 return nil
1381 }
1382 var h0 HoverOptions
1383 if err := json.Unmarshal(x, &h0); err == nil {
1384 t.Value = h0
1385 return nil
1386 }
1387 var h1 bool
1388 if err := json.Unmarshal(x, &h1); err == nil {
1389 t.Value = h1
1390 return nil
1391 }
1392 return &UnmarshalError{"unmarshal failed to match one of [HoverOptions bool]"}
1393 }
1394
1395 func (t Or_ServerCapabilities_implementationProvider) MarshalJSON() ([]byte, error) {
1396 switch x := t.Value.(type) {
1397 case ImplementationOptions:
1398 return json.Marshal(x)
1399 case ImplementationRegistrationOptions:
1400 return json.Marshal(x)
1401 case bool:
1402 return json.Marshal(x)
1403 case nil:
1404 return []byte("null"), nil
1405 }
1406 return nil, fmt.Errorf("type %T not one of [ImplementationOptions ImplementationRegistrationOptions bool]", t)
1407 }
1408
1409 func (t *Or_ServerCapabilities_implementationProvider) UnmarshalJSON(x []byte) error {
1410 if string(x) == "null" {
1411 t.Value = nil
1412 return nil
1413 }
1414 var h0 ImplementationOptions
1415 if err := json.Unmarshal(x, &h0); err == nil {
1416 t.Value = h0
1417 return nil
1418 }
1419 var h1 ImplementationRegistrationOptions
1420 if err := json.Unmarshal(x, &h1); err == nil {
1421 t.Value = h1
1422 return nil
1423 }
1424 var h2 bool
1425 if err := json.Unmarshal(x, &h2); err == nil {
1426 t.Value = h2
1427 return nil
1428 }
1429 return &UnmarshalError{"unmarshal failed to match one of [ImplementationOptions ImplementationRegistrationOptions bool]"}
1430 }
1431
1432 func (t Or_ServerCapabilities_inlayHintProvider) MarshalJSON() ([]byte, error) {
1433 switch x := t.Value.(type) {
1434 case InlayHintOptions:
1435 return json.Marshal(x)
1436 case InlayHintRegistrationOptions:
1437 return json.Marshal(x)
1438 case bool:
1439 return json.Marshal(x)
1440 case nil:
1441 return []byte("null"), nil
1442 }
1443 return nil, fmt.Errorf("type %T not one of [InlayHintOptions InlayHintRegistrationOptions bool]", t)
1444 }
1445
1446 func (t *Or_ServerCapabilities_inlayHintProvider) UnmarshalJSON(x []byte) error {
1447 if string(x) == "null" {
1448 t.Value = nil
1449 return nil
1450 }
1451 var h0 InlayHintOptions
1452 if err := json.Unmarshal(x, &h0); err == nil {
1453 t.Value = h0
1454 return nil
1455 }
1456 var h1 InlayHintRegistrationOptions
1457 if err := json.Unmarshal(x, &h1); err == nil {
1458 t.Value = h1
1459 return nil
1460 }
1461 var h2 bool
1462 if err := json.Unmarshal(x, &h2); err == nil {
1463 t.Value = h2
1464 return nil
1465 }
1466 return &UnmarshalError{"unmarshal failed to match one of [InlayHintOptions InlayHintRegistrationOptions bool]"}
1467 }
1468
1469 func (t Or_ServerCapabilities_inlineCompletionProvider) MarshalJSON() ([]byte, error) {
1470 switch x := t.Value.(type) {
1471 case InlineCompletionOptions:
1472 return json.Marshal(x)
1473 case bool:
1474 return json.Marshal(x)
1475 case nil:
1476 return []byte("null"), nil
1477 }
1478 return nil, fmt.Errorf("type %T not one of [InlineCompletionOptions bool]", t)
1479 }
1480
1481 func (t *Or_ServerCapabilities_inlineCompletionProvider) UnmarshalJSON(x []byte) error {
1482 if string(x) == "null" {
1483 t.Value = nil
1484 return nil
1485 }
1486 var h0 InlineCompletionOptions
1487 if err := json.Unmarshal(x, &h0); err == nil {
1488 t.Value = h0
1489 return nil
1490 }
1491 var h1 bool
1492 if err := json.Unmarshal(x, &h1); err == nil {
1493 t.Value = h1
1494 return nil
1495 }
1496 return &UnmarshalError{"unmarshal failed to match one of [InlineCompletionOptions bool]"}
1497 }
1498
1499 func (t Or_ServerCapabilities_inlineValueProvider) MarshalJSON() ([]byte, error) {
1500 switch x := t.Value.(type) {
1501 case InlineValueOptions:
1502 return json.Marshal(x)
1503 case InlineValueRegistrationOptions:
1504 return json.Marshal(x)
1505 case bool:
1506 return json.Marshal(x)
1507 case nil:
1508 return []byte("null"), nil
1509 }
1510 return nil, fmt.Errorf("type %T not one of [InlineValueOptions InlineValueRegistrationOptions bool]", t)
1511 }
1512
1513 func (t *Or_ServerCapabilities_inlineValueProvider) UnmarshalJSON(x []byte) error {
1514 if string(x) == "null" {
1515 t.Value = nil
1516 return nil
1517 }
1518 var h0 InlineValueOptions
1519 if err := json.Unmarshal(x, &h0); err == nil {
1520 t.Value = h0
1521 return nil
1522 }
1523 var h1 InlineValueRegistrationOptions
1524 if err := json.Unmarshal(x, &h1); err == nil {
1525 t.Value = h1
1526 return nil
1527 }
1528 var h2 bool
1529 if err := json.Unmarshal(x, &h2); err == nil {
1530 t.Value = h2
1531 return nil
1532 }
1533 return &UnmarshalError{"unmarshal failed to match one of [InlineValueOptions InlineValueRegistrationOptions bool]"}
1534 }
1535
1536 func (t Or_ServerCapabilities_linkedEditingRangeProvider) MarshalJSON() ([]byte, error) {
1537 switch x := t.Value.(type) {
1538 case LinkedEditingRangeOptions:
1539 return json.Marshal(x)
1540 case LinkedEditingRangeRegistrationOptions:
1541 return json.Marshal(x)
1542 case bool:
1543 return json.Marshal(x)
1544 case nil:
1545 return []byte("null"), nil
1546 }
1547 return nil, fmt.Errorf("type %T not one of [LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions bool]", t)
1548 }
1549
1550 func (t *Or_ServerCapabilities_linkedEditingRangeProvider) UnmarshalJSON(x []byte) error {
1551 if string(x) == "null" {
1552 t.Value = nil
1553 return nil
1554 }
1555 var h0 LinkedEditingRangeOptions
1556 if err := json.Unmarshal(x, &h0); err == nil {
1557 t.Value = h0
1558 return nil
1559 }
1560 var h1 LinkedEditingRangeRegistrationOptions
1561 if err := json.Unmarshal(x, &h1); err == nil {
1562 t.Value = h1
1563 return nil
1564 }
1565 var h2 bool
1566 if err := json.Unmarshal(x, &h2); err == nil {
1567 t.Value = h2
1568 return nil
1569 }
1570 return &UnmarshalError{"unmarshal failed to match one of [LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions bool]"}
1571 }
1572
1573 func (t Or_ServerCapabilities_monikerProvider) MarshalJSON() ([]byte, error) {
1574 switch x := t.Value.(type) {
1575 case MonikerOptions:
1576 return json.Marshal(x)
1577 case MonikerRegistrationOptions:
1578 return json.Marshal(x)
1579 case bool:
1580 return json.Marshal(x)
1581 case nil:
1582 return []byte("null"), nil
1583 }
1584 return nil, fmt.Errorf("type %T not one of [MonikerOptions MonikerRegistrationOptions bool]", t)
1585 }
1586
1587 func (t *Or_ServerCapabilities_monikerProvider) UnmarshalJSON(x []byte) error {
1588 if string(x) == "null" {
1589 t.Value = nil
1590 return nil
1591 }
1592 var h0 MonikerOptions
1593 if err := json.Unmarshal(x, &h0); err == nil {
1594 t.Value = h0
1595 return nil
1596 }
1597 var h1 MonikerRegistrationOptions
1598 if err := json.Unmarshal(x, &h1); err == nil {
1599 t.Value = h1
1600 return nil
1601 }
1602 var h2 bool
1603 if err := json.Unmarshal(x, &h2); err == nil {
1604 t.Value = h2
1605 return nil
1606 }
1607 return &UnmarshalError{"unmarshal failed to match one of [MonikerOptions MonikerRegistrationOptions bool]"}
1608 }
1609
1610 func (t Or_ServerCapabilities_notebookDocumentSync) MarshalJSON() ([]byte, error) {
1611 switch x := t.Value.(type) {
1612 case NotebookDocumentSyncOptions:
1613 return json.Marshal(x)
1614 case NotebookDocumentSyncRegistrationOptions:
1615 return json.Marshal(x)
1616 case nil:
1617 return []byte("null"), nil
1618 }
1619 return nil, fmt.Errorf("type %T not one of [NotebookDocumentSyncOptions NotebookDocumentSyncRegistrationOptions]", t)
1620 }
1621
1622 func (t *Or_ServerCapabilities_notebookDocumentSync) UnmarshalJSON(x []byte) error {
1623 if string(x) == "null" {
1624 t.Value = nil
1625 return nil
1626 }
1627 var h0 NotebookDocumentSyncOptions
1628 if err := json.Unmarshal(x, &h0); err == nil {
1629 t.Value = h0
1630 return nil
1631 }
1632 var h1 NotebookDocumentSyncRegistrationOptions
1633 if err := json.Unmarshal(x, &h1); err == nil {
1634 t.Value = h1
1635 return nil
1636 }
1637 return &UnmarshalError{"unmarshal failed to match one of [NotebookDocumentSyncOptions NotebookDocumentSyncRegistrationOptions]"}
1638 }
1639
1640 func (t Or_ServerCapabilities_referencesProvider) MarshalJSON() ([]byte, error) {
1641 switch x := t.Value.(type) {
1642 case ReferenceOptions:
1643 return json.Marshal(x)
1644 case bool:
1645 return json.Marshal(x)
1646 case nil:
1647 return []byte("null"), nil
1648 }
1649 return nil, fmt.Errorf("type %T not one of [ReferenceOptions bool]", t)
1650 }
1651
1652 func (t *Or_ServerCapabilities_referencesProvider) UnmarshalJSON(x []byte) error {
1653 if string(x) == "null" {
1654 t.Value = nil
1655 return nil
1656 }
1657 var h0 ReferenceOptions
1658 if err := json.Unmarshal(x, &h0); err == nil {
1659 t.Value = h0
1660 return nil
1661 }
1662 var h1 bool
1663 if err := json.Unmarshal(x, &h1); err == nil {
1664 t.Value = h1
1665 return nil
1666 }
1667 return &UnmarshalError{"unmarshal failed to match one of [ReferenceOptions bool]"}
1668 }
1669
1670 func (t Or_ServerCapabilities_renameProvider) MarshalJSON() ([]byte, error) {
1671 switch x := t.Value.(type) {
1672 case RenameOptions:
1673 return json.Marshal(x)
1674 case bool:
1675 return json.Marshal(x)
1676 case nil:
1677 return []byte("null"), nil
1678 }
1679 return nil, fmt.Errorf("type %T not one of [RenameOptions bool]", t)
1680 }
1681
1682 func (t *Or_ServerCapabilities_renameProvider) UnmarshalJSON(x []byte) error {
1683 if string(x) == "null" {
1684 t.Value = nil
1685 return nil
1686 }
1687 var h0 RenameOptions
1688 if err := json.Unmarshal(x, &h0); err == nil {
1689 t.Value = h0
1690 return nil
1691 }
1692 var h1 bool
1693 if err := json.Unmarshal(x, &h1); err == nil {
1694 t.Value = h1
1695 return nil
1696 }
1697 return &UnmarshalError{"unmarshal failed to match one of [RenameOptions bool]"}
1698 }
1699
1700 func (t Or_ServerCapabilities_selectionRangeProvider) MarshalJSON() ([]byte, error) {
1701 switch x := t.Value.(type) {
1702 case SelectionRangeOptions:
1703 return json.Marshal(x)
1704 case SelectionRangeRegistrationOptions:
1705 return json.Marshal(x)
1706 case bool:
1707 return json.Marshal(x)
1708 case nil:
1709 return []byte("null"), nil
1710 }
1711 return nil, fmt.Errorf("type %T not one of [SelectionRangeOptions SelectionRangeRegistrationOptions bool]", t)
1712 }
1713
1714 func (t *Or_ServerCapabilities_selectionRangeProvider) UnmarshalJSON(x []byte) error {
1715 if string(x) == "null" {
1716 t.Value = nil
1717 return nil
1718 }
1719 var h0 SelectionRangeOptions
1720 if err := json.Unmarshal(x, &h0); err == nil {
1721 t.Value = h0
1722 return nil
1723 }
1724 var h1 SelectionRangeRegistrationOptions
1725 if err := json.Unmarshal(x, &h1); err == nil {
1726 t.Value = h1
1727 return nil
1728 }
1729 var h2 bool
1730 if err := json.Unmarshal(x, &h2); err == nil {
1731 t.Value = h2
1732 return nil
1733 }
1734 return &UnmarshalError{"unmarshal failed to match one of [SelectionRangeOptions SelectionRangeRegistrationOptions bool]"}
1735 }
1736
1737 func (t Or_ServerCapabilities_semanticTokensProvider) MarshalJSON() ([]byte, error) {
1738 switch x := t.Value.(type) {
1739 case SemanticTokensOptions:
1740 return json.Marshal(x)
1741 case SemanticTokensRegistrationOptions:
1742 return json.Marshal(x)
1743 case nil:
1744 return []byte("null"), nil
1745 }
1746 return nil, fmt.Errorf("type %T not one of [SemanticTokensOptions SemanticTokensRegistrationOptions]", t)
1747 }
1748
1749 func (t *Or_ServerCapabilities_semanticTokensProvider) UnmarshalJSON(x []byte) error {
1750 if string(x) == "null" {
1751 t.Value = nil
1752 return nil
1753 }
1754 var h0 SemanticTokensOptions
1755 if err := json.Unmarshal(x, &h0); err == nil {
1756 t.Value = h0
1757 return nil
1758 }
1759 var h1 SemanticTokensRegistrationOptions
1760 if err := json.Unmarshal(x, &h1); err == nil {
1761 t.Value = h1
1762 return nil
1763 }
1764 return &UnmarshalError{"unmarshal failed to match one of [SemanticTokensOptions SemanticTokensRegistrationOptions]"}
1765 }
1766
1767 func (t Or_ServerCapabilities_textDocumentSync) MarshalJSON() ([]byte, error) {
1768 switch x := t.Value.(type) {
1769 case TextDocumentSyncKind:
1770 return json.Marshal(x)
1771 case TextDocumentSyncOptions:
1772 return json.Marshal(x)
1773 case nil:
1774 return []byte("null"), nil
1775 }
1776 return nil, fmt.Errorf("type %T not one of [TextDocumentSyncKind TextDocumentSyncOptions]", t)
1777 }
1778
1779 func (t *Or_ServerCapabilities_textDocumentSync) UnmarshalJSON(x []byte) error {
1780 if string(x) == "null" {
1781 t.Value = nil
1782 return nil
1783 }
1784 var h0 TextDocumentSyncKind
1785 if err := json.Unmarshal(x, &h0); err == nil {
1786 t.Value = h0
1787 return nil
1788 }
1789 var h1 TextDocumentSyncOptions
1790 if err := json.Unmarshal(x, &h1); err == nil {
1791 t.Value = h1
1792 return nil
1793 }
1794 return &UnmarshalError{"unmarshal failed to match one of [TextDocumentSyncKind TextDocumentSyncOptions]"}
1795 }
1796
1797 func (t Or_ServerCapabilities_typeDefinitionProvider) MarshalJSON() ([]byte, error) {
1798 switch x := t.Value.(type) {
1799 case TypeDefinitionOptions:
1800 return json.Marshal(x)
1801 case TypeDefinitionRegistrationOptions:
1802 return json.Marshal(x)
1803 case bool:
1804 return json.Marshal(x)
1805 case nil:
1806 return []byte("null"), nil
1807 }
1808 return nil, fmt.Errorf("type %T not one of [TypeDefinitionOptions TypeDefinitionRegistrationOptions bool]", t)
1809 }
1810
1811 func (t *Or_ServerCapabilities_typeDefinitionProvider) UnmarshalJSON(x []byte) error {
1812 if string(x) == "null" {
1813 t.Value = nil
1814 return nil
1815 }
1816 var h0 TypeDefinitionOptions
1817 if err := json.Unmarshal(x, &h0); err == nil {
1818 t.Value = h0
1819 return nil
1820 }
1821 var h1 TypeDefinitionRegistrationOptions
1822 if err := json.Unmarshal(x, &h1); err == nil {
1823 t.Value = h1
1824 return nil
1825 }
1826 var h2 bool
1827 if err := json.Unmarshal(x, &h2); err == nil {
1828 t.Value = h2
1829 return nil
1830 }
1831 return &UnmarshalError{"unmarshal failed to match one of [TypeDefinitionOptions TypeDefinitionRegistrationOptions bool]"}
1832 }
1833
1834 func (t Or_ServerCapabilities_typeHierarchyProvider) MarshalJSON() ([]byte, error) {
1835 switch x := t.Value.(type) {
1836 case TypeHierarchyOptions:
1837 return json.Marshal(x)
1838 case TypeHierarchyRegistrationOptions:
1839 return json.Marshal(x)
1840 case bool:
1841 return json.Marshal(x)
1842 case nil:
1843 return []byte("null"), nil
1844 }
1845 return nil, fmt.Errorf("type %T not one of [TypeHierarchyOptions TypeHierarchyRegistrationOptions bool]", t)
1846 }
1847
1848 func (t *Or_ServerCapabilities_typeHierarchyProvider) UnmarshalJSON(x []byte) error {
1849 if string(x) == "null" {
1850 t.Value = nil
1851 return nil
1852 }
1853 var h0 TypeHierarchyOptions
1854 if err := json.Unmarshal(x, &h0); err == nil {
1855 t.Value = h0
1856 return nil
1857 }
1858 var h1 TypeHierarchyRegistrationOptions
1859 if err := json.Unmarshal(x, &h1); err == nil {
1860 t.Value = h1
1861 return nil
1862 }
1863 var h2 bool
1864 if err := json.Unmarshal(x, &h2); err == nil {
1865 t.Value = h2
1866 return nil
1867 }
1868 return &UnmarshalError{"unmarshal failed to match one of [TypeHierarchyOptions TypeHierarchyRegistrationOptions bool]"}
1869 }
1870
1871 func (t Or_ServerCapabilities_workspaceSymbolProvider) MarshalJSON() ([]byte, error) {
1872 switch x := t.Value.(type) {
1873 case WorkspaceSymbolOptions:
1874 return json.Marshal(x)
1875 case bool:
1876 return json.Marshal(x)
1877 case nil:
1878 return []byte("null"), nil
1879 }
1880 return nil, fmt.Errorf("type %T not one of [WorkspaceSymbolOptions bool]", t)
1881 }
1882
1883 func (t *Or_ServerCapabilities_workspaceSymbolProvider) UnmarshalJSON(x []byte) error {
1884 if string(x) == "null" {
1885 t.Value = nil
1886 return nil
1887 }
1888 var h0 WorkspaceSymbolOptions
1889 if err := json.Unmarshal(x, &h0); err == nil {
1890 t.Value = h0
1891 return nil
1892 }
1893 var h1 bool
1894 if err := json.Unmarshal(x, &h1); err == nil {
1895 t.Value = h1
1896 return nil
1897 }
1898 return &UnmarshalError{"unmarshal failed to match one of [WorkspaceSymbolOptions bool]"}
1899 }
1900
1901 func (t Or_SignatureInformation_documentation) MarshalJSON() ([]byte, error) {
1902 switch x := t.Value.(type) {
1903 case MarkupContent:
1904 return json.Marshal(x)
1905 case string:
1906 return json.Marshal(x)
1907 case nil:
1908 return []byte("null"), nil
1909 }
1910 return nil, fmt.Errorf("type %T not one of [MarkupContent string]", t)
1911 }
1912
1913 func (t *Or_SignatureInformation_documentation) UnmarshalJSON(x []byte) error {
1914 if string(x) == "null" {
1915 t.Value = nil
1916 return nil
1917 }
1918 var h0 MarkupContent
1919 if err := json.Unmarshal(x, &h0); err == nil {
1920 t.Value = h0
1921 return nil
1922 }
1923 var h1 string
1924 if err := json.Unmarshal(x, &h1); err == nil {
1925 t.Value = h1
1926 return nil
1927 }
1928 return &UnmarshalError{"unmarshal failed to match one of [MarkupContent string]"}
1929 }
1930
1931 func (t Or_TextDocumentEdit_edits_Elem) MarshalJSON() ([]byte, error) {
1932 switch x := t.Value.(type) {
1933 case AnnotatedTextEdit:
1934 return json.Marshal(x)
1935 case SnippetTextEdit:
1936 return json.Marshal(x)
1937 case TextEdit:
1938 return json.Marshal(x)
1939 case nil:
1940 return []byte("null"), nil
1941 }
1942 return nil, fmt.Errorf("type %T not one of [AnnotatedTextEdit SnippetTextEdit TextEdit]", t)
1943 }
1944
1945 func (t *Or_TextDocumentEdit_edits_Elem) UnmarshalJSON(x []byte) error {
1946 if string(x) == "null" {
1947 t.Value = nil
1948 return nil
1949 }
1950 var h0 AnnotatedTextEdit
1951 if err := json.Unmarshal(x, &h0); err == nil {
1952 t.Value = h0
1953 return nil
1954 }
1955 var h1 SnippetTextEdit
1956 if err := json.Unmarshal(x, &h1); err == nil {
1957 t.Value = h1
1958 return nil
1959 }
1960 var h2 TextEdit
1961 if err := json.Unmarshal(x, &h2); err == nil {
1962 t.Value = h2
1963 return nil
1964 }
1965 return &UnmarshalError{"unmarshal failed to match one of [AnnotatedTextEdit SnippetTextEdit TextEdit]"}
1966 }
1967
1968 func (t Or_TextDocumentFilter) MarshalJSON() ([]byte, error) {
1969 switch x := t.Value.(type) {
1970 case TextDocumentFilterLanguage:
1971 return json.Marshal(x)
1972 case TextDocumentFilterPattern:
1973 return json.Marshal(x)
1974 case TextDocumentFilterScheme:
1975 return json.Marshal(x)
1976 case nil:
1977 return []byte("null"), nil
1978 }
1979 return nil, fmt.Errorf("type %T not one of [TextDocumentFilterLanguage TextDocumentFilterPattern TextDocumentFilterScheme]", t)
1980 }
1981
1982 func (t *Or_TextDocumentFilter) UnmarshalJSON(x []byte) error {
1983 if string(x) == "null" {
1984 t.Value = nil
1985 return nil
1986 }
1987 var h0 TextDocumentFilterLanguage
1988 if err := json.Unmarshal(x, &h0); err == nil {
1989 t.Value = h0
1990 return nil
1991 }
1992 var h1 TextDocumentFilterPattern
1993 if err := json.Unmarshal(x, &h1); err == nil {
1994 t.Value = h1
1995 return nil
1996 }
1997 var h2 TextDocumentFilterScheme
1998 if err := json.Unmarshal(x, &h2); err == nil {
1999 t.Value = h2
2000 return nil
2001 }
2002 return &UnmarshalError{"unmarshal failed to match one of [TextDocumentFilterLanguage TextDocumentFilterPattern TextDocumentFilterScheme]"}
2003 }
2004
2005 func (t Or_TextDocumentSyncOptions_save) MarshalJSON() ([]byte, error) {
2006 switch x := t.Value.(type) {
2007 case SaveOptions:
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 [SaveOptions bool]", t)
2015 }
2016
2017 func (t *Or_TextDocumentSyncOptions_save) UnmarshalJSON(x []byte) error {
2018 if string(x) == "null" {
2019 t.Value = nil
2020 return nil
2021 }
2022 var h0 SaveOptions
2023 if err := json.Unmarshal(x, &h0); err == nil {
2024 t.Value = h0
2025 return nil
2026 }
2027 var h1 bool
2028 if err := json.Unmarshal(x, &h1); err == nil {
2029 t.Value = h1
2030 return nil
2031 }
2032 return &UnmarshalError{"unmarshal failed to match one of [SaveOptions bool]"}
2033 }
2034
2035 func (t Or_WorkspaceDocumentDiagnosticReport) MarshalJSON() ([]byte, error) {
2036 switch x := t.Value.(type) {
2037 case WorkspaceFullDocumentDiagnosticReport:
2038 return json.Marshal(x)
2039 case WorkspaceUnchangedDocumentDiagnosticReport:
2040 return json.Marshal(x)
2041 case nil:
2042 return []byte("null"), nil
2043 }
2044 return nil, fmt.Errorf("type %T not one of [WorkspaceFullDocumentDiagnosticReport WorkspaceUnchangedDocumentDiagnosticReport]", t)
2045 }
2046
2047 func (t *Or_WorkspaceDocumentDiagnosticReport) UnmarshalJSON(x []byte) error {
2048 if string(x) == "null" {
2049 t.Value = nil
2050 return nil
2051 }
2052 var h0 WorkspaceFullDocumentDiagnosticReport
2053 if err := json.Unmarshal(x, &h0); err == nil {
2054 t.Value = h0
2055 return nil
2056 }
2057 var h1 WorkspaceUnchangedDocumentDiagnosticReport
2058 if err := json.Unmarshal(x, &h1); err == nil {
2059 t.Value = h1
2060 return nil
2061 }
2062 return &UnmarshalError{"unmarshal failed to match one of [WorkspaceFullDocumentDiagnosticReport WorkspaceUnchangedDocumentDiagnosticReport]"}
2063 }
2064
2065 func (t Or_WorkspaceEdit_documentChanges_Elem) MarshalJSON() ([]byte, error) {
2066 switch x := t.Value.(type) {
2067 case CreateFile:
2068 return json.Marshal(x)
2069 case DeleteFile:
2070 return json.Marshal(x)
2071 case RenameFile:
2072 return json.Marshal(x)
2073 case TextDocumentEdit:
2074 return json.Marshal(x)
2075 case nil:
2076 return []byte("null"), nil
2077 }
2078 return nil, fmt.Errorf("type %T not one of [CreateFile DeleteFile RenameFile TextDocumentEdit]", t)
2079 }
2080
2081 func (t *Or_WorkspaceEdit_documentChanges_Elem) UnmarshalJSON(x []byte) error {
2082 if string(x) == "null" {
2083 t.Value = nil
2084 return nil
2085 }
2086 var h0 CreateFile
2087 if err := json.Unmarshal(x, &h0); err == nil {
2088 t.Value = h0
2089 return nil
2090 }
2091 var h1 DeleteFile
2092 if err := json.Unmarshal(x, &h1); err == nil {
2093 t.Value = h1
2094 return nil
2095 }
2096 var h2 RenameFile
2097 if err := json.Unmarshal(x, &h2); err == nil {
2098 t.Value = h2
2099 return nil
2100 }
2101 var h3 TextDocumentEdit
2102 if err := json.Unmarshal(x, &h3); err == nil {
2103 t.Value = h3
2104 return nil
2105 }
2106 return &UnmarshalError{"unmarshal failed to match one of [CreateFile DeleteFile RenameFile TextDocumentEdit]"}
2107 }
2108
2109 func (t Or_WorkspaceOptions_textDocumentContent) MarshalJSON() ([]byte, error) {
2110 switch x := t.Value.(type) {
2111 case TextDocumentContentOptions:
2112 return json.Marshal(x)
2113 case TextDocumentContentRegistrationOptions:
2114 return json.Marshal(x)
2115 case nil:
2116 return []byte("null"), nil
2117 }
2118 return nil, fmt.Errorf("type %T not one of [TextDocumentContentOptions TextDocumentContentRegistrationOptions]", t)
2119 }
2120
2121 func (t *Or_WorkspaceOptions_textDocumentContent) UnmarshalJSON(x []byte) error {
2122 if string(x) == "null" {
2123 t.Value = nil
2124 return nil
2125 }
2126 var h0 TextDocumentContentOptions
2127 if err := json.Unmarshal(x, &h0); err == nil {
2128 t.Value = h0
2129 return nil
2130 }
2131 var h1 TextDocumentContentRegistrationOptions
2132 if err := json.Unmarshal(x, &h1); err == nil {
2133 t.Value = h1
2134 return nil
2135 }
2136 return &UnmarshalError{"unmarshal failed to match one of [TextDocumentContentOptions TextDocumentContentRegistrationOptions]"}
2137 }
2138
2139 func (t Or_textDocument_declaration) MarshalJSON() ([]byte, error) {
2140 switch x := t.Value.(type) {
2141 case Declaration:
2142 return json.Marshal(x)
2143 case []DeclarationLink:
2144 return json.Marshal(x)
2145 case nil:
2146 return []byte("null"), nil
2147 }
2148 return nil, fmt.Errorf("type %T not one of [Declaration []DeclarationLink]", t)
2149 }
2150
2151 func (t *Or_textDocument_declaration) UnmarshalJSON(x []byte) error {
2152 if string(x) == "null" {
2153 t.Value = nil
2154 return nil
2155 }
2156 var h0 Declaration
2157 if err := json.Unmarshal(x, &h0); err == nil {
2158 t.Value = h0
2159 return nil
2160 }
2161 var h1 []DeclarationLink
2162 if err := json.Unmarshal(x, &h1); err == nil {
2163 t.Value = h1
2164 return nil
2165 }
2166 return &UnmarshalError{"unmarshal failed to match one of [Declaration []DeclarationLink]"}
2167 }