tsjson.go 87 KB

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