@eihrteam/xml-lsp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +47 -2
  3. package/dist/npm/LICENSE +201 -0
  4. package/dist/npm/ThirdPartyNotices.txt +384 -0
  5. package/dist/npm/ace-client/index.d.ts +12 -0
  6. package/dist/npm/ace-client/index.js +15 -0
  7. package/dist/npm/browser-client/index.d.ts +33 -0
  8. package/dist/npm/browser-client/index.js +12 -0
  9. package/dist/npm/cli.js +3 -0
  10. package/dist/npm/language-server/browser.d.ts +2 -0
  11. package/dist/npm/language-server/browser.js +41 -0
  12. package/dist/npm/language-server/index.d.ts +1 -0
  13. package/dist/npm/language-server/index.js +28 -0
  14. package/dist/npm/language-server/node-api.d.ts +2 -0
  15. package/dist/npm/language-server/node-api.js +43 -0
  16. package/dist/npm/language-server/server.d.ts +9 -0
  17. package/dist/npm/language-server/worker.d.ts +1 -0
  18. package/dist/npm/language-server/worker.js +41 -0
  19. package/dist/npm/language-service/content-model.d.ts +18 -0
  20. package/dist/npm/language-service/document.d.ts +32 -0
  21. package/dist/npm/language-service/edits.d.ts +14 -0
  22. package/dist/npm/language-service/index.d.ts +24 -0
  23. package/dist/npm/language-service/index.js +28 -0
  24. package/dist/npm/language-service/intelligence.d.ts +8 -0
  25. package/dist/npm/language-service/parser.d.ts +68 -0
  26. package/dist/npm/language-service/schema-model.d.ts +43 -0
  27. package/dist/npm/language-service/schema.generated.d.ts +2 -0
  28. package/dist/npm/language-service/validation.d.ts +9 -0
  29. package/dist/npm/monaco-client/index.d.ts +7 -0
  30. package/dist/npm/monaco-client/index.js +14 -0
  31. package/docs/api.md +48 -0
  32. package/docs/architecture.md +45 -0
  33. package/docs/editor-integration.md +51 -0
  34. package/docs/implementation.md +57 -0
  35. package/docs/releasing.md +30 -0
  36. package/package.json +128 -4
@@ -0,0 +1,384 @@
1
+ @eihrteam/xml@1.0.0
2
+ ===================
3
+ LICENSE
4
+ MIT License
5
+
6
+ Copyright (c) 2026 EIHRTeam
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+
26
+ @lezer/common@1.5.0
27
+ ===================
28
+ LICENSE
29
+ MIT License
30
+
31
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy
34
+ of this software and associated documentation files (the "Software"), to deal
35
+ in the Software without restriction, including without limitation the rights
36
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
+ copies of the Software, and to permit persons to whom the Software is
38
+ furnished to do so, subject to the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be included in
41
+ all copies or substantial portions of the Software.
42
+
43
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
49
+ THE SOFTWARE.
50
+
51
+ @lezer/highlight@1.2.5
52
+ ======================
53
+ LICENSE
54
+ MIT License
55
+
56
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy
59
+ of this software and associated documentation files (the "Software"), to deal
60
+ in the Software without restriction, including without limitation the rights
61
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
+ copies of the Software, and to permit persons to whom the Software is
63
+ furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in
66
+ all copies or substantial portions of the Software.
67
+
68
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
74
+ THE SOFTWARE.
75
+
76
+ @lezer/lr@1.4.12
77
+ ================
78
+ LICENSE
79
+ MIT License
80
+
81
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
82
+
83
+ Permission is hereby granted, free of charge, to any person obtaining a copy
84
+ of this software and associated documentation files (the "Software"), to deal
85
+ in the Software without restriction, including without limitation the rights
86
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
87
+ copies of the Software, and to permit persons to whom the Software is
88
+ furnished to do so, subject to the following conditions:
89
+
90
+ The above copyright notice and this permission notice shall be included in
91
+ all copies or substantial portions of the Software.
92
+
93
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
99
+ THE SOFTWARE.
100
+
101
+ @lezer/xml@1.0.6
102
+ ================
103
+ LICENSE
104
+ MIT License
105
+
106
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
107
+
108
+ Permission is hereby granted, free of charge, to any person obtaining a copy
109
+ of this software and associated documentation files (the "Software"), to deal
110
+ in the Software without restriction, including without limitation the rights
111
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
112
+ copies of the Software, and to permit persons to whom the Software is
113
+ furnished to do so, subject to the following conditions:
114
+
115
+ The above copyright notice and this permission notice shall be included in
116
+ all copies or substantial portions of the Software.
117
+
118
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
119
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
120
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
121
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
122
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
123
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
124
+ THE SOFTWARE.
125
+
126
+ @xmldom/xmldom@0.9.12
127
+ =====================
128
+ LICENSE
129
+ Copyright 2019 - present Christopher J. Brody and other contributors, as listed in: https://github.com/xmldom/xmldom/graphs/contributors
130
+ Copyright 2012 - 2017 @jindw <jindw@xidea.org> and other contributors, as listed in: https://github.com/jindw/xmldom/graphs/contributors
131
+
132
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
133
+
134
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
135
+
136
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
137
+
138
+ vscode-jsonrpc@8.2.0
139
+ ====================
140
+ License.txt
141
+ Copyright (c) Microsoft Corporation
142
+
143
+ All rights reserved.
144
+
145
+ MIT License
146
+
147
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
148
+
149
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
152
+
153
+ thirdpartynotices.txt
154
+ NOTICES AND INFORMATION
155
+ Do Not Translate or Localize
156
+
157
+ This software incorporates material from third parties.
158
+ Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
159
+ or you may send a check or money order for US $5.00, including the product name,
160
+ the open source component name, platform, and version number, to:
161
+
162
+ Source Code Compliance Team
163
+ Microsoft Corporation
164
+ One Microsoft Way
165
+ Redmond, WA 98052
166
+ USA
167
+
168
+ Notwithstanding any other terms, you may reverse engineer this software to the extent
169
+ required to debug changes to any libraries licensed under the GNU Lesser General Public License.
170
+
171
+ vscode-languageserver-protocol@3.17.5
172
+ =====================================
173
+ License.txt
174
+ Copyright (c) Microsoft Corporation
175
+
176
+ All rights reserved.
177
+
178
+ MIT License
179
+
180
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
181
+
182
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
183
+
184
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
185
+
186
+ thirdpartynotices.txt
187
+ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
188
+ For Microsoft vscode-languageclient
189
+
190
+ This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
191
+ Microsoft is not the original author of the Third Party Code. The original copyright notice and license
192
+ under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
193
+ to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
194
+ granted, whether by implication, estoppel or otherwise.
195
+
196
+ 1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
197
+
198
+ This project is licensed under the MIT license.
199
+ Copyrights are respective of each contributor listed at the beginning of each definition file.
200
+
201
+ Permission is hereby granted, free of charge, to any person obtaining a copy
202
+ of this software and associated documentation files (the "Software"), to deal
203
+ in the Software without restriction, including without limitation the rights
204
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
205
+ copies of the Software, and to permit persons to whom the Software is
206
+ furnished to do so, subject to the following conditions:
207
+
208
+ The above copyright notice and this permission notice shall be included in
209
+ all copies or substantial portions of the Software.
210
+
211
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
212
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
213
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
214
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
215
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
216
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
217
+ THE SOFTWARE.
218
+
219
+ vscode-languageserver-textdocument@1.0.12
220
+ =========================================
221
+ License.txt
222
+ Copyright (c) Microsoft Corporation
223
+
224
+ All rights reserved.
225
+
226
+ MIT License
227
+
228
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
229
+
230
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
231
+
232
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
233
+
234
+ thirdpartynotices.txt
235
+ NOTICES AND INFORMATION
236
+ Do Not Translate or Localize
237
+
238
+ This software incorporates material from third parties.
239
+ Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
240
+ or you may send a check or money order for US $5.00, including the product name,
241
+ the open source component name, platform, and version number, to:
242
+
243
+ Source Code Compliance Team
244
+ Microsoft Corporation
245
+ One Microsoft Way
246
+ Redmond, WA 98052
247
+ USA
248
+
249
+ Notwithstanding any other terms, you may reverse engineer this software to the extent
250
+ required to debug changes to any libraries licensed under the GNU Lesser General Public License.
251
+
252
+ vscode-languageserver-types@3.17.5
253
+ ==================================
254
+ License.txt
255
+ Copyright (c) Microsoft Corporation
256
+
257
+ All rights reserved.
258
+
259
+ MIT License
260
+
261
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
262
+
263
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
264
+
265
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
266
+
267
+ thirdpartynotices.txt
268
+ NOTICES AND INFORMATION
269
+ Do Not Translate or Localize
270
+
271
+ This software incorporates material from third parties.
272
+ Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
273
+ or you may send a check or money order for US $5.00, including the product name,
274
+ the open source component name, platform, and version number, to:
275
+
276
+ Source Code Compliance Team
277
+ Microsoft Corporation
278
+ One Microsoft Way
279
+ Redmond, WA 98052
280
+ USA
281
+
282
+ Notwithstanding any other terms, you may reverse engineer this software to the extent
283
+ required to debug changes to any libraries licensed under the GNU Lesser General Public License.
284
+
285
+ vscode-languageserver@9.0.1
286
+ ===========================
287
+ License.txt
288
+ Copyright (c) Microsoft Corporation
289
+
290
+ All rights reserved.
291
+
292
+ MIT License
293
+
294
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
295
+
296
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
297
+
298
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
299
+
300
+ thirdpartynotices.txt
301
+ NOTICES AND INFORMATION
302
+ Do Not Translate or Localize
303
+
304
+ This software incorporates material from third parties.
305
+ Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
306
+ or you may send a check or money order for US $5.00, including the product name,
307
+ the open source component name, platform, and version number, to:
308
+
309
+ Source Code Compliance Team
310
+ Microsoft Corporation
311
+ One Microsoft Way
312
+ Redmond, WA 98052
313
+ USA
314
+
315
+ Notwithstanding any other terms, you may reverse engineer this software to the extent
316
+ required to debug changes to any libraries licensed under the GNU Lesser General Public License.
317
+
318
+
319
+ ---------------------------------------------------------
320
+
321
+ vscode-jsonrpc - MIT
322
+ https://github.com/Microsoft/vscode-languageserver-node#readme
323
+
324
+ Copyright (c) Microsoft Corporation.
325
+
326
+ Copyright (c) Microsoft Corporation
327
+
328
+ All rights reserved.
329
+
330
+ MIT License
331
+
332
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
333
+
334
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
335
+
336
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
337
+
338
+
339
+ ---------------------------------------------------------
340
+
341
+ ---------------------------------------------------------
342
+
343
+ vscode-languageserver-protocol - MIT
344
+ https://github.com/Microsoft/vscode-languageserver-node#readme
345
+
346
+ Copyright (c) TypeFox and others.
347
+ Copyright (c) Microsoft Corporation.
348
+
349
+ Copyright (c) Microsoft Corporation
350
+
351
+ All rights reserved.
352
+
353
+ MIT License
354
+
355
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
356
+
357
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
358
+
359
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
360
+
361
+
362
+ ---------------------------------------------------------
363
+
364
+ ---------------------------------------------------------
365
+
366
+ vscode-languageserver-types - MIT
367
+ https://github.com/Microsoft/vscode-languageserver-node#readme
368
+
369
+ Copyright (c) Microsoft Corporation.
370
+
371
+ Copyright (c) Microsoft Corporation
372
+
373
+ All rights reserved.
374
+
375
+ MIT License
376
+
377
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
378
+
379
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
380
+
381
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
382
+
383
+
384
+ ---------------------------------------------------------
@@ -0,0 +1,12 @@
1
+ import type * as AceModule from 'ace-builds';
2
+ import type { Ace } from 'ace-builds';
3
+ export interface AceAttachment {
4
+ format(selectionOnly?: boolean): Promise<void>;
5
+ dispose(): void;
6
+ }
7
+ export interface AceClient {
8
+ attachEditor(editor: Ace.Editor, uri: string | ((session: Ace.EditSession) => string)): AceAttachment;
9
+ dispose(): Promise<void>;
10
+ }
11
+ /** Load Ace's ext-language_tools before attaching an editor. */
12
+ export declare function createAceClient(ace: typeof AceModule, worker: Worker): Promise<AceClient>;
@@ -0,0 +1,15 @@
1
+ var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),t=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error},e.func=function(e){return typeof e==`function`};function n(e){return Array.isArray(e)}e.array=n,e.stringArray=function(e){return n(e)&&e.every(e=>t(e))}})),n=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;let n=t();var r;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={})),e.ResponseError=class e extends Error{constructor(t,i,a){super(i),this.code=n.number(t)?t:r.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var i=class e{constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=i,i.auto=new i(`auto`),i.byPosition=new i(`byPosition`),i.byName=new i(`byName`);var a=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return i.auto}};e.AbstractMessageSignature=a,e.RequestType0=class extends a{constructor(e){super(e,0)}},e.RequestType=class extends a{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends a{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends a{constructor(e){super(e,2)}},e.RequestType3=class extends a{constructor(e){super(e,3)}},e.RequestType4=class extends a{constructor(e){super(e,4)}},e.RequestType5=class extends a{constructor(e){super(e,5)}},e.RequestType6=class extends a{constructor(e){super(e,6)}},e.RequestType7=class extends a{constructor(e){super(e,7)}},e.RequestType8=class extends a{constructor(e){super(e,8)}},e.RequestType9=class extends a{constructor(e){super(e,9)}},e.NotificationType=class extends a{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends a{constructor(e){super(e,0)}},e.NotificationType1=class extends a{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends a{constructor(e){super(e,2)}},e.NotificationType3=class extends a{constructor(e){super(e,3)}},e.NotificationType4=class extends a{constructor(e){super(e,4)}},e.NotificationType5=class extends a{constructor(e){super(e,5)}},e.NotificationType6=class extends a{constructor(e){super(e,6)}},e.NotificationType7=class extends a{constructor(e){super(e,7)}},e.NotificationType8=class extends a{constructor(e){super(e,8)}},e.NotificationType9=class extends a{constructor(e){super(e,9)}};var o;(function(e){e.isRequest=function(e){let t=e;return t&&n.string(t.method)&&(n.string(t.id)||n.number(t.id))},e.isNotification=function(e){let t=e;return t&&n.string(t.method)&&e.id===void 0},e.isResponse=function(e){let t=e;return t&&(t.result!==void 0||!!t.error)&&(n.string(t.id)||n.number(t.id)||t.id===null)}})(o||(e.Message=o={}))})),r=/* @__PURE__ */ e((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{constructor(){this[t]=`LinkedMap`,this._map=/* @__PURE__ */ new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(t===n.First||t===n.Last){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),i=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(e){e.create=function(e){return{dispose:e}}})(t||(e.Disposable=t={}))})),a=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){e.install=function(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}})(n||={}),e.default=n})),o=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;let t=a();var n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}n=!0}if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{n.push(r[a].apply(i[a],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class e{constructor(e){this._options=e}get event(){return this._event||=(t,n,i)=>{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}})),s=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;let n=a(),r=t(),i=o();var s;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),e.is=function(t){let n=t;return n&&(n===e.None||n===e.Cancelled||r.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}})(s||(e.CancellationToken=s={}));let c=Object.freeze(function(e,t){let r=(0,n.default)().timer.setTimeout(e.bind(t),0);return{dispose(){r.dispose()}}});var l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||=new i.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{get token(){return this._token||=new l,this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof l&&this._token.dispose():this._token=s.None}}})),c=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;let t=s();var n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{constructor(){this.buffers=/* @__PURE__ */ new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),l=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;let t=a();e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length!==0&&this._active!==this._capacity&&(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),u=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;let n=a(),r=t(),i=o(),s=l();var c;(function(e){e.is=function(e){let t=e;return t&&r.func(t.listen)&&r.func(t.dispose)&&r.func(t.onError)&&r.func(t.onClose)&&r.func(t.onPartialMessage)}})(c||(e.MessageReader=c={}));var u=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:/* @__PURE__ */ Error(`Reader received error. Reason: ${r.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=u;var d;(function(e){e.fromOptions=function(e){let t,r,i=/* @__PURE__ */ new Map,a,o=/* @__PURE__ */ new Map;if(e===void 0||typeof e==`string`)t=e??`utf-8`;else{if(t=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,n.default)().applicationJson.decoder,o.set(a.name,a)),{charset:t,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}})(d||={}),e.ReadableStreamMessageReader=class extends u{constructor(e,t){super(),this.readable=e,this.options=d.fromOptions(t),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(/* @__PURE__ */ Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(/* @__PURE__ */ Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,n.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),d=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;let n=a(),r=t(),i=l(),s=o();var c;(function(e){e.is=function(e){let t=e;return t&&r.func(t.dispose)&&r.func(t.onClose)&&r.func(t.onError)&&r.func(t.write)}})(c||(e.MessageWriter=c={}));var u=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:/* @__PURE__ */ Error(`Writer received error. Reason: ${r.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=u;var d;(function(e){e.fromOptions=function(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}})(d||={}),e.WriteableStreamMessageWriter=class extends u{constructor(e,t){super(),this.writable=e,this.options=d.fromOptions(t),this.errorCount=0,this.writeSemaphore=new i.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(`Content-Length: `,t.byteLength.toString(),`\r
2
+ `),n.push(`\r
3
+ `),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}})),f=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0,e.AbstractMessageBuffer=class{constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){let e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(t!==4)return;let a=this._read(i+r),o=/* @__PURE__ */ new Map,s=this.toString(a,`ascii`).split(`\r
4
+ `);if(s.length<2)return o;for(let t=0;t<s.length-2;t++){let n=s[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'\n${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();o.set(e?i.toLowerCase():i,a)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}})),p=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;let i=a(),c=t(),l=n(),u=r(),d=o(),f=s();var p;(function(e){e.type=new l.NotificationType(`$/cancelRequest`)})(p||={});var m;(function(e){e.is=function(e){return typeof e==`string`||typeof e==`number`}})(m||(e.ProgressToken=m={}));var h;(function(e){e.type=new l.NotificationType(`$/progress`)})(h||={}),e.ProgressType=class{constructor(){}};var g;(function(e){e.is=function(e){return c.func(e)}})(g||={}),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(_||(e.Trace=_={}));var v;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(v||(e.TraceValues=v={})),(function(e){e.fromString=function(t){if(!c.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}})(_||(e.Trace=_={}));var y;(function(e){e.Text=`text`,e.JSON=`json`})(y||(e.TraceFormat=y={})),(function(e){e.fromString=function(t){return c.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}})(y||(e.TraceFormat=y={}));var b;(function(e){e.type=new l.NotificationType(`$/setTrace`)})(b||(e.SetTraceNotification=b={}));var x;(function(e){e.type=new l.NotificationType(`$/logTrace`)})(x||(e.LogTraceNotification=x={}));var S;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(S||(e.ConnectionErrors=S={}));var C=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=C;var w;(function(e){e.is=function(e){let t=e;return t&&c.func(t.cancelUndispatched)}})(w||(e.ConnectionStrategy=w={}));var T;(function(e){e.is=function(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&c.func(t.createCancellationTokenSource)&&(t.dispose===void 0||c.func(t.dispose))}})(T||(e.IdCancellationReceiverStrategy=T={}));var E;(function(e){e.is=function(e){let t=e;return t&&t.kind===`request`&&c.func(t.createCancellationTokenSource)&&(t.dispose===void 0||c.func(t.dispose))}})(E||(e.RequestCancellationReceiverStrategy=E={}));var D;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new f.CancellationTokenSource}}),e.is=function(e){return T.is(e)||E.is(e)}})(D||(e.CancellationReceiverStrategy=D={}));var O;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(p.type,{id:t})},cleanup(e){}}),e.is=function(e){let t=e;return t&&c.func(t.sendCancellation)&&c.func(t.cleanup)}})(O||(e.CancellationSenderStrategy=O={}));var k;(function(e){e.Message=Object.freeze({receiver:D.Message,sender:O.Message}),e.is=function(e){let t=e;return t&&D.is(t.receiver)&&O.is(t.sender)}})(k||(e.CancellationStrategy=k={}));var A;(function(e){e.is=function(e){let t=e;return t&&c.func(t.handleMessage)}})(A||(e.MessageStrategy=A={}));var j;(function(e){e.is=function(e){let t=e;return t&&(k.is(t.cancellationStrategy)||w.is(t.connectionStrategy)||A.is(t.messageStrategy))}})(j||(e.ConnectionOptions=j={}));var M;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(M||={}),e.createMessageConnection=function(t,n,r,a){let o=r===void 0?e.NullLogger:r,s=0,v=0,w=0,E,D=/* @__PURE__ */ new Map,O,j=/* @__PURE__ */ new Map,N=/* @__PURE__ */ new Map,P,F=new u.LinkedMap,I=/* @__PURE__ */ new Map,L=/* @__PURE__ */ new Set,R=/* @__PURE__ */ new Map,z=_.Off,B=y.Text,V,H=M.New,ee=new d.Emitter,te=new d.Emitter,ne=new d.Emitter,re=new d.Emitter,ie=new d.Emitter,U=a&&a.cancellationStrategy?a.cancellationStrategy:k.Message;function ae(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}function oe(e){return e===null?`res-unknown-`+(++w).toString():`res-`+e.toString()}function se(){return`not-`+(++v).toString()}function ce(e,t){l.Message.isRequest(t)?e.set(ae(t.id),t):l.Message.isResponse(t)?e.set(oe(t.id),t):e.set(se(),t)}function W(e){}function le(){return H===M.Listening}function ue(){return H===M.Closed}function G(){return H===M.Disposed}function de(){(H===M.New||H===M.Listening)&&(H=M.Closed,te.fire(void 0))}function fe(e){ee.fire([e,void 0,void 0])}function pe(e){ee.fire(e)}t.onClose(de),t.onError(fe),n.onClose(de),n.onError(pe);function me(){P||F.size===0||(P=(0,i.default)().timer.setImmediate(()=>{P=void 0,ge()}))}function he(e){l.Message.isRequest(e)?ve(e):l.Message.isNotification(e)?be(e):l.Message.isResponse(e)?ye(e):xe(e)}function ge(){if(F.size===0)return;let e=F.shift();try{let t=a?.messageStrategy;A.is(t)?t.handleMessage(e,he):he(e)}finally{me()}}let _e=e=>{try{if(l.Message.isNotification(e)&&e.method===p.type.method){let t=e.params.id,r=ae(t),i=F.get(r);if(l.Message.isRequest(i)){let s=a?.connectionStrategy,c=s&&s.cancelUndispatched?s.cancelUndispatched(i,W):void 0;if(c&&(c.error!==void 0||c.result!==void 0)){F.delete(r),R.delete(t),c.id=i.id,q(c,e.method,Date.now()),n.write(c).catch(()=>o.error(`Sending response for canceled message failed.`));return}}let s=R.get(t);if(s!==void 0){s.cancel(),Te(e);return}L.add(t)}ce(F,e)}finally{me()}};function ve(e){if(G())return;function t(t,r,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof l.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,q(a,r,i),n.write(a).catch(()=>o.error(`Sending response failed.`))}function r(t,r,i){let a={jsonrpc:`2.0`,id:e.id,error:t.toJson()};q(a,r,i),n.write(a).catch(()=>o.error(`Sending response failed.`))}function i(t,r,i){t===void 0&&(t=null);let a={jsonrpc:`2.0`,id:e.id,result:t};q(a,r,i),n.write(a).catch(()=>o.error(`Sending response failed.`))}we(e);let a=D.get(e.method),s,u;a&&(s=a.type,u=a.handler);let d=Date.now();if(u||E){let n=e.id??String(Date.now()),a=T.is(U.receiver)?U.receiver.createCancellationTokenSource(n):U.receiver.createCancellationTokenSource(e);e.id!==null&&L.has(e.id)&&a.cancel(),e.id!==null&&R.set(n,a);try{let o;if(u){if(e.params===void 0){if(s!==void 0&&s.numberOfParams!==0){r(new l.ResponseError(l.ErrorCodes.InvalidParams,`Request ${e.method} defines ${s.numberOfParams} params but received none.`),e.method,d);return}o=u(a.token)}else if(Array.isArray(e.params)){if(s!==void 0&&s.parameterStructures===l.ParameterStructures.byName){r(new l.ResponseError(l.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,d);return}o=u(...e.params,a.token)}else{if(s!==void 0&&s.parameterStructures===l.ParameterStructures.byPosition){r(new l.ResponseError(l.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,d);return}o=u(e.params,a.token)}}else E&&(o=E(e.method,e.params,a.token));let f=o;o?f.then?f.then(r=>{R.delete(n),t(r,e.method,d)},t=>{R.delete(n),t instanceof l.ResponseError?r(t,e.method,d):t&&c.string(t.message)?r(new l.ResponseError(l.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,d):r(new l.ResponseError(l.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,d)}):(R.delete(n),t(o,e.method,d)):(R.delete(n),i(o,e.method,d))}catch(i){R.delete(n),i instanceof l.ResponseError?t(i,e.method,d):i&&c.string(i.message)?r(new l.ResponseError(l.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${i.message}`),e.method,d):r(new l.ResponseError(l.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,d)}}else r(new l.ResponseError(l.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,d)}function ye(e){if(!G()){if(e.id===null)e.error?o.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):o.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=I.get(t);if(Ee(e,n),n!==void 0){I.delete(t);try{if(e.error){let t=e.error;n.reject(new l.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?o.error(`Response handler '${n.method}' failed with message: ${e.message}`):o.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}}function be(e){if(G())return;let t,n;if(e.method===p.type.method){let t=e.params.id;L.delete(t),Te(e)}else{{let r=j.get(e.method);r&&(n=r.handler,t=r.type)}if(n||O)try{if(Te(e),n){if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==l.ParameterStructures.byName&&o.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let r=e.params;e.method===h.type.method&&r.length===2&&m.is(r[0])?n({token:r[0],value:r[1]}):(t!==void 0&&(t.parameterStructures===l.ParameterStructures.byName&&o.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&o.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${r.length} arguments`)),n(...r))}else t!==void 0&&t.parameterStructures===l.ParameterStructures.byPosition&&o.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)}else O&&O(e.method,e.params)}catch(t){t.message?o.error(`Notification handler '${e.method}' failed with message: ${t.message}`):o.error(`Notification handler '${e.method}' failed unexpectedly.`)}else ne.fire(e)}}function xe(e){if(!e){o.error(`Received empty message.`);return}o.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(c.string(t.id)||c.number(t.id)){let e=t.id,n=I.get(e);n&&n.reject(/* @__PURE__ */ Error(`The received response has neither a result nor an error property.`))}}function K(e){if(e!=null)switch(z){case _.Verbose:return JSON.stringify(e,null,4);case _.Compact:return JSON.stringify(e);default:return}}function Se(e){if(z!==_.Off&&V){if(B===y.Text){let t;(z===_.Verbose||z===_.Compact)&&e.params&&(t=`Params: ${K(e.params)}\n\n`),V.log(`Sending request '${e.method} - (${e.id})'.`,t)}else J(`send-request`,e)}}function Ce(e){if(z!==_.Off&&V){if(B===y.Text){let t;(z===_.Verbose||z===_.Compact)&&(t=e.params?`Params: ${K(e.params)}\n\n`:`No parameters provided.
5
+
6
+ `),V.log(`Sending notification '${e.method}'.`,t)}else J(`send-notification`,e)}}function q(e,t,n){if(z!==_.Off&&V){if(B===y.Text){let r;(z===_.Verbose||z===_.Compact)&&(e.error&&e.error.data?r=`Error data: ${K(e.error.data)}\n\n`:e.result?r=`Result: ${K(e.result)}\n\n`:e.error===void 0&&(r=`No result returned.
7
+
8
+ `)),V.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else J(`send-response`,e)}}function we(e){if(z!==_.Off&&V){if(B===y.Text){let t;(z===_.Verbose||z===_.Compact)&&e.params&&(t=`Params: ${K(e.params)}\n\n`),V.log(`Received request '${e.method} - (${e.id})'.`,t)}else J(`receive-request`,e)}}function Te(e){if(z!==_.Off&&V&&e.method!==x.type.method){if(B===y.Text){let t;(z===_.Verbose||z===_.Compact)&&(t=e.params?`Params: ${K(e.params)}\n\n`:`No parameters provided.
9
+
10
+ `),V.log(`Received notification '${e.method}'.`,t)}else J(`receive-notification`,e)}}function Ee(e,t){if(z!==_.Off&&V){if(B===y.Text){let n;if((z===_.Verbose||z===_.Compact)&&(e.error&&e.error.data?n=`Error data: ${K(e.error.data)}\n\n`:e.result?n=`Result: ${K(e.result)}\n\n`:e.error===void 0&&(n=`No result returned.
11
+
12
+ `)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;V.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else V.log(`Received response ${e.id} without active response promise.`,n)}else J(`receive-response`,e)}}function J(e,t){if(!V||z===_.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};V.log(n)}function Y(){if(ue())throw new C(S.Closed,`Connection is closed.`);if(G())throw new C(S.Disposed,`Connection is disposed.`)}function De(){if(le())throw new C(S.AlreadyListening,`Connection is already listening`)}function Oe(){if(!le())throw Error(`Call listen() first.`)}function X(e){return e===void 0?null:e}function ke(e){if(e!==null)return e}function Ae(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}function je(e,t){switch(e){case l.ParameterStructures.auto:return Ae(t)?ke(t):[X(t)];case l.ParameterStructures.byName:if(!Ae(t))throw Error(`Received parameters by name but param is not an object literal.`);return ke(t);case l.ParameterStructures.byPosition:return[X(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}function Me(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=je(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(X(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}let Z={sendNotification:(e,...t)=>{Y();let r,i;if(c.string(e)){r=e;let n=t[0],a=0,o=l.ParameterStructures.auto;l.ParameterStructures.is(n)&&(a=1,o=n);let s=t.length,c=s-a;switch(c){case 0:i=void 0;break;case 1:i=je(o,t[a]);break;default:if(o===l.ParameterStructures.byName)throw Error(`Received ${c} parameters for 'by Name' notification parameter structure.`);i=t.slice(a,s).map(e=>X(e))}}else{let n=t;r=e.method,i=Me(e,n)}let a={jsonrpc:`2.0`,method:r,params:i};return Ce(a),n.write(a).catch(e=>{throw o.error(`Sending notification failed.`),e})},onNotification:(e,t)=>{Y();let n;return c.func(e)?O=e:t&&(c.string(e)?(n=e,j.set(e,{type:void 0,handler:t})):(n=e.method,j.set(e.method,{type:e,handler:t}))),{dispose:()=>{n===void 0?O=void 0:j.delete(n)}}},onProgress:(e,t,n)=>{if(N.has(t))throw Error(`Progress handler for token ${t} already registered`);return N.set(t,n),{dispose:()=>{N.delete(t)}}},sendProgress:(e,t,n)=>Z.sendNotification(h.type,{token:t,value:n}),onUnhandledProgress:re.event,sendRequest:(e,...t)=>{Y(),Oe();let r,i,a;if(c.string(e)){r=e;let n=t[0],o=t[t.length-1],s=0,c=l.ParameterStructures.auto;l.ParameterStructures.is(n)&&(s=1,c=n);let u=t.length;f.CancellationToken.is(o)&&(--u,a=o);let d=u-s;switch(d){case 0:i=void 0;break;case 1:i=je(c,t[s]);break;default:if(c===l.ParameterStructures.byName)throw Error(`Received ${d} parameters for 'by Name' request parameter structure.`);i=t.slice(s,u).map(e=>X(e))}}else{let n=t;r=e.method,i=Me(e,n);let o=e.numberOfParams;a=f.CancellationToken.is(n[o])?n[o]:void 0}let u=s++,d;a&&(d=a.onCancellationRequested(()=>{let e=U.sender.sendCancellation(Z,u);return e===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${u}`),Promise.resolve()):e.catch(()=>{o.log(`Sending cancellation messages for id ${u} failed`)})}));let p={jsonrpc:`2.0`,id:u,method:r,params:i};return Se(p),typeof U.sender.enableCancellation==`function`&&U.sender.enableCancellation(p),new Promise(async(e,t)=>{let i={method:r,timerStart:Date.now(),resolve:t=>{e(t),U.sender.cleanup(u),d?.dispose()},reject:e=>{t(e),U.sender.cleanup(u),d?.dispose()}};try{await n.write(p),I.set(u,i)}catch(e){throw o.error(`Sending request failed.`),i.reject(new l.ResponseError(l.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),e}})},onRequest:(e,t)=>{Y();let n=null;return g.is(e)?(n=void 0,E=e):c.string(e)?(n=null,t!==void 0&&(n=e,D.set(e,{handler:t,type:void 0}))):t!==void 0&&(n=e.method,D.set(e.method,{type:e,handler:t})),{dispose:()=>{n!==null&&(n===void 0?E=void 0:D.delete(n))}}},hasPendingResponse:()=>I.size>0,trace:async(e,t,n)=>{let r=!1,i=y.Text;n!==void 0&&(c.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||y.Text)),z=e,B=i,V=z===_.Off?void 0:t,r&&!ue()&&!G()&&await Z.sendNotification(b.type,{value:_.toString(e)})},onError:ee.event,onClose:te.event,onUnhandledNotification:ne.event,onDispose:ie.event,end:()=>{n.end()},dispose:()=>{if(G())return;H=M.Disposed,ie.fire(void 0);let e=new l.ResponseError(l.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of I.values())t.reject(e);I=/* @__PURE__ */ new Map,R=/* @__PURE__ */ new Map,L=/* @__PURE__ */ new Set,F=new u.LinkedMap,c.func(n.dispose)&&n.dispose(),c.func(t.dispose)&&t.dispose()},listen:()=>{Y(),De(),H=M.Listening,t.listen(_e)},inspect:()=>{(0,i.default)().console.log(`inspect`)}};return Z.onNotification(x.type,e=>{if(z===_.Off||!V)return;let t=z===_.Verbose||z===_.Compact;V.log(e.message,t?e.verbose:void 0)}),Z.onNotification(h.type,e=>{let t=N.get(e.token);t?t(e.value):re.fire(e)}),Z}})),m=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;let t=n();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});let l=r();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return l.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return l.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return l.Touch}});let m=i();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return m.Disposable}});let h=o();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return h.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return h.Emitter}});let g=s();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return g.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return g.CancellationToken}});let _=c();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return _.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return _.SharedArrayReceiverStrategy}});let v=u();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return v.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return v.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return v.ReadableStreamMessageReader}});let y=d();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return y.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return y.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return y.WriteableStreamMessageWriter}});let b=f();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return b.AbstractMessageBuffer}});let x=p();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return x.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return x.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return x.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return x.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return x.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return x.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return x.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return x.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return x.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return x.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return x.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return x.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return x.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return x.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return x.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return x.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return x.MessageStrategy}}),e.RAL=a().default})),h=/* @__PURE__ */ e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=m();var n=class e extends t.AbstractMessageBuffer{constructor(e=`utf-8`){super(e),this.asciiDecoder=new TextDecoder(`ascii`)}emptyBuffer(){return e.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t===`ascii`?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}};n.emptyBuffer=/* @__PURE__ */ new Uint8Array;var r=class{constructor(e){this.socket=e,this._onData=new t.Emitter,this._messageListener=e=>{e.data.arrayBuffer().then(e=>{this._onData.fire(new Uint8Array(e))},()=>{(0,t.RAL)().console.error(`Converting blob to array buffer failed.`)})},this.socket.addEventListener(`message`,this._messageListener)}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}onData(e){return this._onData.event(e)}},i=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}write(e,t){if(typeof e==`string`){if(t!==void 0&&t!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}};let a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:e=>new n(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:(e,t)=>{if(t.charset!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(a.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:`application/json`,decode:(e,t)=>{if(!(e instanceof Uint8Array))throw Error(`In a Browser environments only Uint8Arrays are supported.`);return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new r(e),asWritableStream:e=>new i(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){let n=setTimeout(e,0,...t);return{dispose:()=>clearTimeout(n)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function s(){return o}(function(e){e.install=function(){t.RAL.install(o)}})(s||={}),e.default=s})),g=/* @__PURE__ */ e(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,h().default.install();let a=m();i(m(),e),e.BrowserMessageReader=class extends a.AbstractMessageReader{constructor(e){super(),this._onData=new a.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener(`error`,e=>this.fireError(e)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}},e.BrowserMessageWriter=class extends a.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener(`error`,e=>this.fireError(e))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}},e.createMessageConnection=function(e,t,n,r){return n===void 0&&(n=a.NullLogger),a.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,a.createMessageConnection)(e,t,n,r)}})),_=(/* @__PURE__ */ e(((e,t)=>{t.exports=g()})))();async function v(e,t,n){let r;try{return await Promise.race([e,new Promise((e,i)=>{r=setTimeout(()=>i(Error(n)),t)})])}finally{clearTimeout(r)}}async function y(e,t={}){let n=new _.BrowserMessageReader(e),r=new _.BrowserMessageWriter(e),i=(0,_.createMessageConnection)(n,r),a=/* @__PURE__ */ new Map,o=0,s=!1,c;function l(){if(s)return;s=!0,e.removeEventListener(`error`,l),i.dispose(),n.dispose(),r.dispose(),e.terminate();let t=[...a.values()];a.clear();for(let e of t)e.diagnostics([])}e.addEventListener(`error`,l),i.onNotification(`textDocument/publishDiagnostics`,({uri:e,version:t,diagnostics:n})=>{let r=a.get(e);r&&r.version===t&&r.diagnostics(n)}),i.listen();try{await v(i.sendRequest(`initialize`,{processId:null,rootUri:null,capabilities:{general:{positionEncodings:[`utf-16`]},workspace:{workspaceEdit:{documentChanges:!0}},textDocument:{completion:{completionItem:{snippetSupport:t.snippets??!1}},hover:{contentFormat:t.markdown?[`markdown`,`plaintext`]:[`plaintext`]},publishDiagnostics:{versionSupport:!0,relatedInformation:!0},documentSymbol:{hierarchicalDocumentSymbolSupport:!0},foldingRange:{lineFoldingOnly:!1},codeAction:{codeActionLiteralSupport:{codeActionKind:{valueSet:[`quickfix`]}}}}}}),5e3,`SKLand XML Worker initialization timed out`),await i.sendNotification(`initialized`,{})}catch(e){throw l(),e}let u=(e,t)=>{i.sendNotification(e,t).catch(()=>void 0)};return{open(e,t,n){if(s||c)throw Error(`The SKLand XML client is closed`);if(a.has(e))throw Error(`This XML URI is already open`);let r={version:++o,diagnostics:n};a.set(e,r);let l={uri:e};u(`textDocument/didOpen`,{textDocument:{uri:e,version:r.version,text:t,languageId:`skland-xml`}});let d=()=>a.get(e)===r&&!c;async function f(e,t,n){if(!d()||n?.isCancellationRequested)return null;let a=r.version;try{let o={...t,textDocument:l},s=await(n?i.sendRequest(`textDocument/`+e,o,n):i.sendRequest(`textDocument/`+e,o));return d()&&r.version===a&&!n?.isCancellationRequested?s:null}catch{return null}}return{uri:e,change(t){d()&&t.length&&(r.version=++o,u(`textDocument/didChange`,{textDocument:{uri:e,version:r.version},contentChanges:t}))},completion:(e,t)=>f(`completion`,{position:e},t),hover:(e,t)=>f(`hover`,{position:e},t),formatting:(e,t,n)=>t?f(`rangeFormatting`,{options:e,range:t},n):f(`formatting`,{options:e},n),symbols:e=>f(`documentSymbol`,{},e),folding:e=>f(`foldingRange`,{},e),linkedEditing:(e,t)=>f(`linkedEditingRange`,{position:e},t),links:e=>f(`documentLink`,{},e),codeActions:(e,t,n)=>f(`codeAction`,{range:e,context:{diagnostics:t}},n),close(){d()&&(a.delete(e),u(`textDocument/didClose`,{textDocument:l}),n([]))}}},dispose(){return c??=(async()=>{if(!s)try{await v(i.sendRequest(`shutdown`),1e3,`SKLand XML Worker shutdown timed out`),await i.sendNotification(`exit`)}catch{}finally{l()}})()}}}var b;(function(e){e.is=function(e){return typeof e==`string`}})(b||={});var x;(function(e){e.is=function(e){return typeof e==`string`}})(x||={});var S;(function(e){e.MIN_VALUE=-0x80000000,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(S||={});var C;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(C||={});var w;(function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=C.MAX_VALUE),t===Number.MAX_VALUE&&(t=C.MAX_VALUE),{line:e,character:t}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.uinteger(t.line)&&Q.uinteger(t.character)}})(w||={});var T;(function(e){e.create=function(e,t,n,r){if(Q.uinteger(e)&&Q.uinteger(t)&&Q.uinteger(n)&&Q.uinteger(r))return{start:w.create(e,t),end:w.create(n,r)};if(w.is(e)&&w.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)},e.is=function(e){let t=e;return Q.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}})(T||={});var E;(function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&T.is(t.range)&&(Q.string(t.uri)||Q.undefined(t.uri))}})(E||={});var D;(function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&T.is(t.targetRange)&&Q.string(t.targetUri)&&T.is(t.targetSelectionRange)&&(T.is(t.originSelectionRange)||Q.undefined(t.originSelectionRange))}})(D||={});var O;(function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.numberRange(t.red,0,1)&&Q.numberRange(t.green,0,1)&&Q.numberRange(t.blue,0,1)&&Q.numberRange(t.alpha,0,1)}})(O||={});var k;(function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&T.is(t.range)&&O.is(t.color)}})(k||={});var A;(function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.string(t.label)&&(Q.undefined(t.textEdit)||z.is(t))&&(Q.undefined(t.additionalTextEdits)||Q.typedArray(t.additionalTextEdits,z.is))}})(A||={});var j;(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(j||={});var M;(function(e){e.create=function(e,t,n,r,i,a){let o={startLine:e,endLine:t};return Q.defined(n)&&(o.startCharacter=n),Q.defined(r)&&(o.endCharacter=r),Q.defined(i)&&(o.kind=i),Q.defined(a)&&(o.collapsedText=a),o},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.uinteger(t.startLine)&&Q.uinteger(t.startLine)&&(Q.undefined(t.startCharacter)||Q.uinteger(t.startCharacter))&&(Q.undefined(t.endCharacter)||Q.uinteger(t.endCharacter))&&(Q.undefined(t.kind)||Q.string(t.kind))}})(M||={});var N;(function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){let t=e;return Q.defined(t)&&E.is(t.location)&&Q.string(t.message)}})(N||={});var P;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(P||={});var F;(function(e){e.Unnecessary=1,e.Deprecated=2})(F||={});var I;(function(e){e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.string(t.href)}})(I||={});var L;(function(e){e.create=function(e,t,n,r,i,a){let o={range:e,message:t};return Q.defined(n)&&(o.severity=n),Q.defined(r)&&(o.code=r),Q.defined(i)&&(o.source=i),Q.defined(a)&&(o.relatedInformation=a),o},e.is=function(e){let t=e;return Q.defined(t)&&T.is(t.range)&&Q.string(t.message)&&(Q.number(t.severity)||Q.undefined(t.severity))&&(Q.integer(t.code)||Q.string(t.code)||Q.undefined(t.code))&&(Q.undefined(t.codeDescription)||Q.string(t.codeDescription?.href))&&(Q.string(t.source)||Q.undefined(t.source))&&(Q.undefined(t.relatedInformation)||Q.typedArray(t.relatedInformation,N.is))}})(L||={});var R;(function(e){e.create=function(e,t,...n){let r={title:e,command:t};return Q.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){let t=e;return Q.defined(t)&&Q.string(t.title)&&Q.string(t.command)}})(R||={});var z;(function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:``}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.string(t.newText)&&T.is(t.range)}})(z||={});var B;(function(e){e.create=function(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r},e.is=function(e){let t=e;return Q.objectLiteral(t)&&Q.string(t.label)&&(Q.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(Q.string(t.description)||t.description===void 0)}})(B||={});var V;(function(e){e.is=function(e){let t=e;return Q.string(t)}})(V||={});var H;(function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:``,annotationId:t}},e.is=function(e){let t=e;return z.is(t)&&(B.is(t.annotationId)||V.is(t.annotationId))}})(H||={});var ee;(function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return Q.defined(t)&&oe.is(t.textDocument)&&Array.isArray(t.edits)}})(ee||={});var te;(function(e){e.create=function(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`create`&&Q.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||Q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||V.is(t.annotationId))}})(te||={});var ne;(function(e){e.create=function(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&t.kind===`rename`&&Q.string(t.oldUri)&&Q.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||Q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||V.is(t.annotationId))}})(ne||={});var re;(function(e){e.create=function(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`delete`&&Q.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||Q.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||Q.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||V.is(t.annotationId))}})(re||={});var ie;(function(e){e.is=function(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>Q.string(e.kind)?te.is(e)||ne.is(e)||re.is(e):ee.is(e)))}})(ie||={});var U;(function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return Q.defined(t)&&Q.string(t.uri)}})(U||={});var ae;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Q.defined(t)&&Q.string(t.uri)&&Q.integer(t.version)}})(ae||={});var oe;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Q.defined(t)&&Q.string(t.uri)&&(t.version===null||Q.integer(t.version))}})(oe||={});var se;(function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return Q.defined(t)&&Q.string(t.uri)&&Q.string(t.languageId)&&Q.integer(t.version)&&Q.string(t.text)}})(se||={});var ce;(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`,e.is=function(t){let n=t;return n===e.PlainText||n===e.Markdown}})(ce||={});var W;(function(e){e.is=function(e){let t=e;return Q.objectLiteral(e)&&ce.is(t.kind)&&Q.string(t.value)}})(W||={});var le;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(le||={});var ue;(function(e){e.PlainText=1,e.Snippet=2})(ue||={});var G;(function(e){e.Deprecated=1})(G||={});var de;(function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){let t=e;return t&&Q.string(t.newText)&&T.is(t.insert)&&T.is(t.replace)}})(de||={});var fe;(function(e){e.asIs=1,e.adjustIndentation=2})(fe||={});var pe;(function(e){e.is=function(e){let t=e;return t&&(Q.string(t.detail)||t.detail===void 0)&&(Q.string(t.description)||t.description===void 0)}})(pe||={});var me;(function(e){e.create=function(e){return{label:e}}})(me||={});var he;(function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}})(he||={});var ge;(function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)},e.is=function(e){let t=e;return Q.string(t)||Q.objectLiteral(t)&&Q.string(t.language)&&Q.string(t.value)}})(ge||={});var _e;(function(e){e.is=function(e){let t=e;return!!t&&Q.objectLiteral(t)&&(W.is(t.contents)||ge.is(t.contents)||Q.typedArray(t.contents,ge.is))&&(e.range===void 0||T.is(e.range))}})(_e||={});var ve;(function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}})(ve||={});var ye;(function(e){e.create=function(e,t,...n){let r={label:e};return Q.defined(t)&&(r.documentation=t),r.parameters=Q.defined(n)?n:[],r}})(ye||={});var be;(function(e){e.Text=1,e.Read=2,e.Write=3})(be||={});var xe;(function(e){e.create=function(e,t){let n={range:e};return Q.number(t)&&(n.kind=t),n}})(xe||={});var K;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(K||={});var Se;(function(e){e.Deprecated=1})(Se||={});var Ce;(function(e){e.create=function(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}})(Ce||={});var q;(function(e){e.create=function(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}})(q||={});var we;(function(e){e.create=function(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o},e.is=function(e){let t=e;return t&&Q.string(t.name)&&Q.number(t.kind)&&T.is(t.range)&&T.is(t.selectionRange)&&(t.detail===void 0||Q.string(t.detail))&&(t.deprecated===void 0||Q.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}})(we||={});var Te;(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(Te||={});var Ee;(function(e){e.Invoked=1,e.Automatic=2})(Ee||={});var J;(function(e){e.create=function(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r},e.is=function(e){let t=e;return Q.defined(t)&&Q.typedArray(t.diagnostics,L.is)&&(t.only===void 0||Q.typedArray(t.only,Q.string))&&(t.triggerKind===void 0||t.triggerKind===Ee.Invoked||t.triggerKind===Ee.Automatic)}})(J||={});var Y;(function(e){e.create=function(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):R.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return t&&Q.string(t.title)&&(t.diagnostics===void 0||Q.typedArray(t.diagnostics,L.is))&&(t.kind===void 0||Q.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||R.is(t.command))&&(t.isPreferred===void 0||Q.boolean(t.isPreferred))&&(t.edit===void 0||ie.is(t.edit))}})(Y||={});var De;(function(e){e.create=function(e,t){let n={range:e};return Q.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return Q.defined(t)&&T.is(t.range)&&(Q.undefined(t.command)||R.is(t.command))}})(De||={});var Oe;(function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return Q.defined(t)&&Q.uinteger(t.tabSize)&&Q.boolean(t.insertSpaces)}})(Oe||={});var X;(function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return Q.defined(t)&&T.is(t.range)&&(Q.undefined(t.target)||Q.string(t.target))}})(X||={});var ke;(function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return Q.objectLiteral(n)&&T.is(n.range)&&(n.parent===void 0||e.is(n.parent))}})(ke||={});var Ae;(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(Ae||={});var je;(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(je||={});var Me;(function(e){e.is=function(e){let t=e;return Q.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}})(Me||={});var Z;(function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){let t=e;return t!=null&&T.is(t.range)&&Q.string(t.text)}})(Z||={});var Ne;(function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){let t=e;return t!=null&&T.is(t.range)&&Q.boolean(t.caseSensitiveLookup)&&(Q.string(t.variableName)||t.variableName===void 0)}})(Ne||={});var Pe;(function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){let t=e;return t!=null&&T.is(t.range)&&(Q.string(t.expression)||t.expression===void 0)}})(Pe||={});var Fe;(function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){let t=e;return Q.defined(t)&&T.is(e.stoppedLocation)}})(Fe||={});var Ie;(function(e){e.Type=1,e.Parameter=2,e.is=function(e){return e===1||e===2}})(Ie||={});var Le;(function(e){e.create=function(e){return{value:e}},e.is=function(e){let t=e;return Q.objectLiteral(t)&&(t.tooltip===void 0||Q.string(t.tooltip)||W.is(t.tooltip))&&(t.location===void 0||E.is(t.location))&&(t.command===void 0||R.is(t.command))}})(Le||={});var Re;(function(e){e.create=function(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return Q.objectLiteral(t)&&w.is(t.position)&&(Q.string(t.label)||Q.typedArray(t.label,Le.is))&&(t.kind===void 0||Ie.is(t.kind))&&t.textEdits===void 0||Q.typedArray(t.textEdits,z.is)&&(t.tooltip===void 0||Q.string(t.tooltip)||W.is(t.tooltip))&&(t.paddingLeft===void 0||Q.boolean(t.paddingLeft))&&(t.paddingRight===void 0||Q.boolean(t.paddingRight))}})(Re||={});var ze;(function(e){e.createSnippet=function(e){return{kind:`snippet`,value:e}}})(ze||={});var Be;(function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}})(Be||={});var Ve;(function(e){e.create=function(e){return{items:e}}})(Ve||={});var He;(function(e){e.Invoked=0,e.Automatic=1})(He||={});var Ue;(function(e){e.create=function(e,t){return{range:e,text:t}}})(Ue||={});var We;(function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}})(We||={});var Ge;(function(e){e.is=function(e){let t=e;return Q.objectLiteral(t)&&x.is(t.uri)&&Q.string(t.name)}})(Ge||={});var Ke;(function(e){e.create=function(e,t,n,r){return new qe(e,t,n,r)},e.is=function(e){let t=e;return!!(Q.defined(t)&&Q.string(t.uri)&&(Q.undefined(t.languageId)||Q.string(t.languageId))&&Q.uinteger(t.lineCount)&&Q.func(t.getText)&&Q.func(t.positionAt)&&Q.func(t.offsetAt))},e.applyEdits=function(e,n){let r=e.getText(),i=t(n,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),s=e.offsetAt(n.range.end);if(s<=a)r=r.substring(0,o)+n.newText+r.substring(s,r.length);else throw Error(`Overlapping edit`);a=o}return r};function t(e,n){if(e.length<=1)return e;let r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);let o=0,s=0,c=0;for(;o<i.length&&s<a.length;)n(i[o],a[s])<=0?e[c++]=i[o++]:e[c++]=a[s++];for(;o<i.length;)e[c++]=i[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(Ke||={});var qe=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
13
+ `,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
14
+ `&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return w.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return w.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},Q;(function(e){let t=Object.prototype.toString;e.defined=function(e){return e!==void 0},e.undefined=function(e){return e===void 0},e.boolean=function(e){return e===!0||e===!1},e.string=function(e){return t.call(e)===`[object String]`},e.number=function(e){return t.call(e)===`[object Number]`},e.numberRange=function(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r},e.integer=function(e){return t.call(e)===`[object Number]`&&-0x80000000<=e&&e<=0x7fffffff},e.uinteger=function(e){return t.call(e)===`[object Number]`&&0<=e&&e<=0x7fffffff},e.func=function(e){return t.call(e)===`[object Function]`},e.objectLiteral=function(e){return typeof e==`object`&&!!e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}})(Q||={});const $=e=>({line:e.row,character:e.column}),Je=e=>({start:e,end:e});async function Ye(e,t){let n=await y(t),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=({start:t,end:n})=>new e.Range(t.line,t.character,n.line,n.character),{HoverTooltip:o}=e.require(`ace/tooltip`),s=!1;function c(e,t){let i=r.get(e);if(i){if(i.document.uri!==t)throw Error(`This Ace session is already open with a different URI`);return i.references++,i}let a=e.getDocument(),o=a.getNewLineCharacter(),s=n.open(t,e.getValue(),t=>{e.setAnnotations(t.map(e=>({row:e.range.start.line,column:e.range.start.character,text:e.message,type:e.severity===P.Warning?`warning`:e.severity===P.Error||e.severity===void 0?`error`:`info`})))});function c(){return o!==a.getNewLineCharacter()&&(o=a.getNewLineCharacter(),s.change([{text:e.getValue()}]),!0)}let l=()=>queueMicrotask(c),u=e=>{if(c())return;let t=$(e.start);e.action===`insert`?s.change([{range:Je(t),text:e.lines.join(o)}]):s.change([{range:{start:t,end:$(e.end)},text:``}])};e.on(`change`,u),a.on(`changeNewLineMode`,l);let d={references:1,document:s,dispose(){--d.references>0||(r.delete(e),e.off(`change`,u),a.off(`changeNewLineMode`,l),s.close())}};return r.set(e,d),d}return{attachEditor(t,n){if(s)throw Error(`The SKLand XML Ace client is closed`);if(i.has(t))throw Error(`This Ace editor is already attached`);if(!e.require(`ace/ext/language_tools`))throw Error(`Load Ace ext-language_tools before attaching`);let r=typeof n==`string`?()=>n:n,l=t.getOption(`enableBasicAutocompletion`),u=t.getOption(`enableLiveAutocompletion`),d=t.completers,f=t.getSession(),p=c(f,r(f)),m=!0,h=0,g=0,_=new o(t.container),v={id:`skland-xml`,triggerCharacters:[`<`,`/`,` `,`=`,`"`,`'`],identifierRegexps:[/[a-zA-Z0-9_.:-]/],getCompletions(e,t,n,r,i){if(!m||t!==f){i(null,[]);return}let a=++g;(async()=>{let e=(await p.document.completion($(n)))?.items.map(e=>({caption:e.label,value:e.textEdit?.newText??e.insertText??e.label,completer:v,meta:`SKLand XML`,score:1e3,docText:typeof e.documentation==`string`?e.documentation:e.documentation?.value,sklandEdit:e.textEdit&&`range`in e.textEdit?e.textEdit:void 0,sklandRequest:a}))??[];i(null,m&&a===g&&t===f?e:[])})()},insertMatch(e,t){if(m&&t.sklandRequest===g&&t.sklandEdit){let{range:e,newText:n}=t.sklandEdit;f.replace(a(e),n)}}};t.setOptions({enableBasicAutocompletion:[v],enableLiveAutocompletion:!0}),_.setDataProvider((e,n)=>{let r=++h,i=e.getDocumentPosition();(async()=>{let o=await p.document.hover($(i));if(!m||r!==h||!o?.range)return;let s=Array.isArray(o.contents)?o.contents:[o.contents],c=t.container.ownerDocument.createElement(`div`);c.style.whiteSpace=`pre-wrap`,c.textContent=s.map(e=>typeof e==`string`?e:e.value).join(`
15
+ `),_.showForRange(n,a(o.range),c,e)})()}),_.addToEditor(t);let y=()=>{g++},b=({session:e})=>{h++,g++,_.hide(void 0),f.off(`change`,y),p.dispose(),f=e,p=c(f,r(f)),f.on(`change`,y)};f.on(`change`,y),t.on(`changeSession`,b);let x={async format(e=!1){let n=f,r=t.getSelectionRange(),i=e?{start:$(r.start),end:$(r.end)}:void 0,o=await p.document.formatting({tabSize:f.getTabSize(),insertSpaces:f.getUseSoftTabs()},i);if(m&&n===f&&o)for(let e of[...o].reverse())f.replace(a(e.range),e.newText)},dispose(){i.delete(t)&&(m=!1,t.off(`destroy`,x.dispose),t.off(`changeSession`,b),f.off(`change`,y),_.removeFromEditor(t),_.destroy(),p.dispose(),t.setOptions({enableBasicAutocompletion:l,enableLiveAutocompletion:u}),t.completers=d)}};return t.on(`destroy`,x.dispose),i.set(t,x),x},async dispose(){s=!0;for(let e of i.values())e.dispose();await n.dispose()}}}export{Ye as createAceClient};
@@ -0,0 +1,33 @@
1
+ import { type CancellationToken } from 'vscode-jsonrpc/browser.js';
2
+ import type { CodeAction, CompletionList, Diagnostic, DocumentLink, DocumentSymbol, FoldingRange, FormattingOptions, Hover, Position, Range, TextEdit } from 'vscode-languageserver-types';
3
+ export type Change = {
4
+ range?: Range;
5
+ text: string;
6
+ };
7
+ export interface BrowserClientOptions {
8
+ snippets?: boolean;
9
+ markdown?: boolean;
10
+ }
11
+ export interface LinkedRanges {
12
+ ranges: Range[];
13
+ wordPattern?: string;
14
+ }
15
+ export interface BrowserDocument {
16
+ readonly uri: string;
17
+ change(changes: readonly Change[]): void;
18
+ completion(position: Position, token?: CancellationToken): Promise<CompletionList | null>;
19
+ hover(position: Position, token?: CancellationToken): Promise<Hover | null>;
20
+ formatting(options: FormattingOptions, range?: Range, token?: CancellationToken): Promise<TextEdit[] | null>;
21
+ symbols(token?: CancellationToken): Promise<DocumentSymbol[] | null>;
22
+ folding(token?: CancellationToken): Promise<FoldingRange[] | null>;
23
+ linkedEditing(position: Position, token?: CancellationToken): Promise<LinkedRanges | null>;
24
+ links(token?: CancellationToken): Promise<DocumentLink[] | null>;
25
+ codeActions(range: Range, diagnostics: Diagnostic[], token?: CancellationToken): Promise<CodeAction[] | null>;
26
+ close(): void;
27
+ }
28
+ export interface BrowserClient {
29
+ open(uri: string, text: string, diagnostics: (diagnostics: Diagnostic[]) => void): BrowserDocument;
30
+ dispose(): Promise<void>;
31
+ }
32
+ /** Takes ownership of the Worker, including when initialization fails. */
33
+ export declare function connectBrowserClient(worker: Worker, options?: BrowserClientOptions): Promise<BrowserClient>;