@tombi-toml/wasm-lsp 1.5.1 → 1.5.2

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.
@@ -1,164 +1,750 @@
1
- let wasm;
1
+ /* @ts-self-types="./tombi_lsp_wasm.d.ts" */
2
2
 
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
3
+ export class IntoUnderlyingByteSource {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ IntoUnderlyingByteSourceFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
13
+ }
14
+ /**
15
+ * @returns {number}
16
+ */
17
+ get autoAllocateChunkSize() {
18
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
19
+ return ret >>> 0;
20
+ }
21
+ cancel() {
22
+ const ptr = this.__destroy_into_raw();
23
+ wasm.intounderlyingbytesource_cancel(ptr);
24
+ }
25
+ /**
26
+ * @param {ReadableByteStreamController} controller
27
+ * @returns {Promise<any>}
28
+ */
29
+ pull(controller) {
30
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller));
31
+ return takeObject(ret);
32
+ }
33
+ /**
34
+ * @param {ReadableByteStreamController} controller
35
+ */
36
+ start(controller) {
37
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller));
38
+ }
39
+ /**
40
+ * @returns {ReadableStreamType}
41
+ */
42
+ get type() {
43
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
44
+ return __wbindgen_enum_ReadableStreamType[ret];
45
+ }
46
+ }
47
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
8
48
 
9
- let heap_next = heap.length;
49
+ export class IntoUnderlyingSink {
50
+ __destroy_into_raw() {
51
+ const ptr = this.__wbg_ptr;
52
+ this.__wbg_ptr = 0;
53
+ IntoUnderlyingSinkFinalization.unregister(this);
54
+ return ptr;
55
+ }
56
+ free() {
57
+ const ptr = this.__destroy_into_raw();
58
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
59
+ }
60
+ /**
61
+ * @param {any} reason
62
+ * @returns {Promise<any>}
63
+ */
64
+ abort(reason) {
65
+ const ptr = this.__destroy_into_raw();
66
+ const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason));
67
+ return takeObject(ret);
68
+ }
69
+ /**
70
+ * @returns {Promise<any>}
71
+ */
72
+ close() {
73
+ const ptr = this.__destroy_into_raw();
74
+ const ret = wasm.intounderlyingsink_close(ptr);
75
+ return takeObject(ret);
76
+ }
77
+ /**
78
+ * @param {any} chunk
79
+ * @returns {Promise<any>}
80
+ */
81
+ write(chunk) {
82
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk));
83
+ return takeObject(ret);
84
+ }
85
+ }
86
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
10
87
 
11
- function addHeapObject(obj) {
12
- if (heap_next === heap.length) heap.push(heap.length + 1);
13
- const idx = heap_next;
14
- heap_next = heap[idx];
88
+ export class IntoUnderlyingSource {
89
+ __destroy_into_raw() {
90
+ const ptr = this.__wbg_ptr;
91
+ this.__wbg_ptr = 0;
92
+ IntoUnderlyingSourceFinalization.unregister(this);
93
+ return ptr;
94
+ }
95
+ free() {
96
+ const ptr = this.__destroy_into_raw();
97
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
98
+ }
99
+ cancel() {
100
+ const ptr = this.__destroy_into_raw();
101
+ wasm.intounderlyingsource_cancel(ptr);
102
+ }
103
+ /**
104
+ * @param {ReadableStreamDefaultController} controller
105
+ * @returns {Promise<any>}
106
+ */
107
+ pull(controller) {
108
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller));
109
+ return takeObject(ret);
110
+ }
111
+ }
112
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
15
113
 
16
- heap[idx] = obj;
17
- return idx;
114
+ /**
115
+ * Browser streams used to exchange LSP messages with a Web Worker.
116
+ */
117
+ export class ServerConfig {
118
+ __destroy_into_raw() {
119
+ const ptr = this.__wbg_ptr;
120
+ this.__wbg_ptr = 0;
121
+ ServerConfigFinalization.unregister(this);
122
+ return ptr;
123
+ }
124
+ free() {
125
+ const ptr = this.__destroy_into_raw();
126
+ wasm.__wbg_serverconfig_free(ptr, 0);
127
+ }
128
+ /**
129
+ * @param {AsyncIterator<any>} into_server
130
+ * @param {WritableStream} from_server
131
+ */
132
+ constructor(into_server, from_server) {
133
+ const ret = wasm.serverconfig_new(addHeapObject(into_server), addHeapObject(from_server));
134
+ this.__wbg_ptr = ret;
135
+ ServerConfigFinalization.register(this, this.__wbg_ptr, this);
136
+ return this;
137
+ }
18
138
  }
139
+ if (Symbol.dispose) ServerConfig.prototype[Symbol.dispose] = ServerConfig.prototype.free;
19
140
 
20
- function handleError(f, args) {
141
+ /**
142
+ * Remove one file from the browser-backed virtual workspace.
143
+ * @param {string} uri
144
+ */
145
+ export function remove_workspace_file(uri) {
21
146
  try {
22
- return f.apply(this, args);
23
- } catch (e) {
24
- wasm.__wbindgen_export_0(addHeapObject(e));
147
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
148
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
149
+ const len0 = WASM_VECTOR_LEN;
150
+ wasm.remove_workspace_file(retptr, ptr0, len0);
151
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
152
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
153
+ if (r1) {
154
+ throw takeObject(r0);
155
+ }
156
+ } finally {
157
+ wasm.__wbindgen_add_to_stack_pointer(16);
25
158
  }
26
159
  }
27
160
 
28
- function isLikeNone(x) {
29
- return x === undefined || x === null;
161
+ /**
162
+ * Serve Tombi LSP over byte streams using the standard LSP header framing.
163
+ * @param {ServerConfig} config
164
+ * @returns {Promise<void>}
165
+ */
166
+ export function serve(config) {
167
+ _assertClass(config, ServerConfig);
168
+ var ptr0 = config.__destroy_into_raw();
169
+ const ret = wasm.serve(ptr0);
170
+ return takeObject(ret);
30
171
  }
31
172
 
32
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
-
34
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
-
36
- let cachedUint8ArrayMemory0 = null;
37
-
38
- function getUint8ArrayMemory0() {
39
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
40
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
173
+ /**
174
+ * Replace the virtual workspace entries visible to the WASM language server.
175
+ * @param {any} entries
176
+ */
177
+ export function set_workspace_entries(entries) {
178
+ try {
179
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
180
+ wasm.set_workspace_entries(retptr, addHeapObject(entries));
181
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
182
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
183
+ if (r1) {
184
+ throw takeObject(r0);
185
+ }
186
+ } finally {
187
+ wasm.__wbindgen_add_to_stack_pointer(16);
41
188
  }
42
- return cachedUint8ArrayMemory0;
43
189
  }
44
190
 
45
- function getStringFromWasm0(ptr, len) {
46
- ptr = ptr >>> 0;
47
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
191
+ /**
192
+ * Update one file in the browser-backed virtual workspace.
193
+ * @param {string} uri
194
+ * @param {string} text
195
+ */
196
+ export function set_workspace_file(uri, text) {
197
+ try {
198
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
199
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
200
+ const len0 = WASM_VECTOR_LEN;
201
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
202
+ const len1 = WASM_VECTOR_LEN;
203
+ wasm.set_workspace_file(retptr, ptr0, len0, ptr1, len1);
204
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
205
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
206
+ if (r1) {
207
+ throw takeObject(r0);
208
+ }
209
+ } finally {
210
+ wasm.__wbindgen_add_to_stack_pointer(16);
211
+ }
48
212
  }
49
213
 
50
- function getArrayU8FromWasm0(ptr, len) {
51
- ptr = ptr >>> 0;
52
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
214
+ /**
215
+ * Replace the virtual workspace files visible to the WASM language server.
216
+ * @param {any} files
217
+ */
218
+ export function set_workspace_files(files) {
219
+ try {
220
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
221
+ wasm.set_workspace_files(retptr, addHeapObject(files));
222
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
223
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
224
+ if (r1) {
225
+ throw takeObject(r0);
226
+ }
227
+ } finally {
228
+ wasm.__wbindgen_add_to_stack_pointer(16);
229
+ }
53
230
  }
54
231
 
55
- let WASM_VECTOR_LEN = 0;
56
-
57
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
58
-
59
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
60
- ? function (arg, view) {
61
- return cachedTextEncoder.encodeInto(arg, view);
232
+ export function start() {
233
+ wasm.start();
62
234
  }
63
- : function (arg, view) {
64
- const buf = cachedTextEncoder.encode(arg);
65
- view.set(buf);
235
+ function __wbg_get_imports() {
236
+ const import0 = {
237
+ __proto__: null,
238
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
239
+ const ret = Error(getStringFromWasm0(arg0, arg1));
240
+ return addHeapObject(ret);
241
+ },
242
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
243
+ const v = getObject(arg0);
244
+ const ret = typeof(v) === 'boolean' ? v : undefined;
245
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
246
+ },
247
+ __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
248
+ const ret = debugString(getObject(arg1));
249
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
250
+ const len1 = WASM_VECTOR_LEN;
251
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
252
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
253
+ },
254
+ __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
255
+ const ret = getObject(arg0) in getObject(arg1);
256
+ return ret;
257
+ },
258
+ __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
259
+ const ret = typeof(getObject(arg0)) === 'function';
260
+ return ret;
261
+ },
262
+ __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
263
+ const val = getObject(arg0);
264
+ const ret = typeof(val) === 'object' && val !== null;
265
+ return ret;
266
+ },
267
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
268
+ const ret = typeof(getObject(arg0)) === 'string';
269
+ return ret;
270
+ },
271
+ __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
272
+ const ret = getObject(arg0) === undefined;
273
+ return ret;
274
+ },
275
+ __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
276
+ const ret = getObject(arg0) == getObject(arg1);
277
+ return ret;
278
+ },
279
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
280
+ const obj = getObject(arg1);
281
+ const ret = typeof(obj) === 'number' ? obj : undefined;
282
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
283
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
284
+ },
285
+ __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
286
+ const obj = getObject(arg1);
287
+ const ret = typeof(obj) === 'string' ? obj : undefined;
288
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
289
+ var len1 = WASM_VECTOR_LEN;
290
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
291
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
292
+ },
293
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
294
+ throw new Error(getStringFromWasm0(arg0, arg1));
295
+ },
296
+ __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
297
+ getObject(arg0)._wbg_cb_unref();
298
+ },
299
+ __wbg_arrayBuffer_06f3da76f071d37f: function() { return handleError(function (arg0) {
300
+ const ret = getObject(arg0).arrayBuffer();
301
+ return addHeapObject(ret);
302
+ }, arguments); },
303
+ __wbg_buffer_4a989bded7035f57: function(arg0) {
304
+ const ret = getObject(arg0).buffer;
305
+ return addHeapObject(ret);
306
+ },
307
+ __wbg_byobRequest_f161fc37241dd3d4: function(arg0) {
308
+ const ret = getObject(arg0).byobRequest;
309
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
310
+ },
311
+ __wbg_byteLength_0ddb1795e2c7e689: function(arg0) {
312
+ const ret = getObject(arg0).byteLength;
313
+ return ret;
314
+ },
315
+ __wbg_byteOffset_46eb015f52b6ad7d: function(arg0) {
316
+ const ret = getObject(arg0).byteOffset;
317
+ return ret;
318
+ },
319
+ __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
320
+ const ret = getObject(arg0).call(getObject(arg1));
321
+ return addHeapObject(ret);
322
+ }, arguments); },
323
+ __wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
324
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
325
+ return addHeapObject(ret);
326
+ }, arguments); },
327
+ __wbg_close_22882088c136df25: function() { return handleError(function (arg0) {
328
+ getObject(arg0).close();
329
+ }, arguments); },
330
+ __wbg_close_5c3f1f028070f2f7: function(arg0) {
331
+ const ret = getObject(arg0).close();
332
+ return addHeapObject(ret);
333
+ },
334
+ __wbg_close_8b609460dd26e367: function() { return handleError(function (arg0) {
335
+ getObject(arg0).close();
336
+ }, arguments); },
337
+ __wbg_done_cffed884d87aa22e: function(arg0) {
338
+ const ret = getObject(arg0).done;
339
+ return ret;
340
+ },
341
+ __wbg_enqueue_6cb545d22db14f33: function() { return handleError(function (arg0, arg1) {
342
+ getObject(arg0).enqueue(getObject(arg1));
343
+ }, arguments); },
344
+ __wbg_entries_972a87586902cf87: function(arg0) {
345
+ const ret = Object.entries(getObject(arg0));
346
+ return addHeapObject(ret);
347
+ },
348
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
349
+ let deferred0_0;
350
+ let deferred0_1;
351
+ try {
352
+ deferred0_0 = arg0;
353
+ deferred0_1 = arg1;
354
+ console.error(getStringFromWasm0(arg0, arg1));
355
+ } finally {
356
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
357
+ }
358
+ },
359
+ __wbg_fetch_8d9b732df7467c44: function(arg0) {
360
+ const ret = fetch(getObject(arg0));
361
+ return addHeapObject(ret);
362
+ },
363
+ __wbg_getRandomValues_a608c4436c19407a: function() { return handleError(function (arg0, arg1) {
364
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
365
+ }, arguments); },
366
+ __wbg_getTime_65922ba0b59d55a7: function(arg0) {
367
+ const ret = getObject(arg0).getTime();
368
+ return ret;
369
+ },
370
+ __wbg_getTimezoneOffset_6e4850ad528ac37d: function(arg0) {
371
+ const ret = getObject(arg0).getTimezoneOffset();
372
+ return ret;
373
+ },
374
+ __wbg_getWriter_5a3d7baaf32780c4: function() { return handleError(function (arg0) {
375
+ const ret = getObject(arg0).getWriter();
376
+ return addHeapObject(ret);
377
+ }, arguments); },
378
+ __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
379
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
380
+ return addHeapObject(ret);
381
+ }, arguments); },
382
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
383
+ const ret = getObject(arg0)[arg1 >>> 0];
384
+ return addHeapObject(ret);
385
+ },
386
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
387
+ const ret = getObject(arg0)[arg1 >>> 0];
388
+ return addHeapObject(ret);
389
+ },
390
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
391
+ const ret = getObject(arg0)[getObject(arg1)];
392
+ return addHeapObject(ret);
393
+ },
394
+ __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
395
+ let result;
396
+ try {
397
+ result = getObject(arg0) instanceof ArrayBuffer;
398
+ } catch (_) {
399
+ result = false;
400
+ }
401
+ const ret = result;
402
+ return ret;
403
+ },
404
+ __wbg_instanceof_Error_fe6fa771c78ee4cf: function(arg0) {
405
+ let result;
406
+ try {
407
+ result = getObject(arg0) instanceof Error;
408
+ } catch (_) {
409
+ result = false;
410
+ }
411
+ const ret = result;
412
+ return ret;
413
+ },
414
+ __wbg_instanceof_Response_6366a785e400039b: function(arg0) {
415
+ let result;
416
+ try {
417
+ result = getObject(arg0) instanceof Response;
418
+ } catch (_) {
419
+ result = false;
420
+ }
421
+ const ret = result;
422
+ return ret;
423
+ },
424
+ __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
425
+ let result;
426
+ try {
427
+ result = getObject(arg0) instanceof Uint8Array;
428
+ } catch (_) {
429
+ result = false;
430
+ }
431
+ const ret = result;
432
+ return ret;
433
+ },
434
+ __wbg_isArray_5674713bb7b79043: function(arg0) {
435
+ const ret = Array.isArray(getObject(arg0));
436
+ return ret;
437
+ },
438
+ __wbg_iterator_22ddeb808cf55a6f: function() {
439
+ const ret = Symbol.iterator;
440
+ return addHeapObject(ret);
441
+ },
442
+ __wbg_length_31bdaf014f5fbde2: function(arg0) {
443
+ const ret = getObject(arg0).length;
444
+ return ret;
445
+ },
446
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
447
+ const ret = getObject(arg0).length;
448
+ return ret;
449
+ },
450
+ __wbg_message_1cbc5bc03dcf1dee: function(arg0) {
451
+ const ret = getObject(arg0).message;
452
+ return addHeapObject(ret);
453
+ },
454
+ __wbg_name_b9d8f2ea16b22045: function(arg0) {
455
+ const ret = getObject(arg0).name;
456
+ return addHeapObject(ret);
457
+ },
458
+ __wbg_new_0_35540e542ba689d2: function() {
459
+ const ret = new Date();
460
+ return addHeapObject(ret);
461
+ },
462
+ __wbg_new_0afe64b4dc16ab74: function() { return handleError(function () {
463
+ const ret = new Headers();
464
+ return addHeapObject(ret);
465
+ }, arguments); },
466
+ __wbg_new_180f1022bb6ee517: function(arg0) {
467
+ const ret = new Date(getObject(arg0));
468
+ return addHeapObject(ret);
469
+ },
470
+ __wbg_new_1da3429bc3c4541c: function(arg0) {
471
+ const ret = new Uint8Array(getObject(arg0));
472
+ return addHeapObject(ret);
473
+ },
474
+ __wbg_new_227d7c05414eb861: function() {
475
+ const ret = new Error();
476
+ return addHeapObject(ret);
477
+ },
478
+ __wbg_new_2fa8dd8f40f14923: function() { return handleError(function (arg0, arg1) {
479
+ const ret = new URL(getStringFromWasm0(arg0, arg1));
480
+ return addHeapObject(ret);
481
+ }, arguments); },
482
+ __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
483
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
484
+ return addHeapObject(ret);
485
+ },
486
+ __wbg_new_bebc3f4757acf305: function() {
487
+ const ret = new Object();
488
+ return addHeapObject(ret);
489
+ },
490
+ __wbg_new_e60365bfd84fce6d: function() { return handleError(function () {
491
+ const ret = new URLSearchParams();
492
+ return addHeapObject(ret);
493
+ }, arguments); },
494
+ __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
495
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
496
+ return addHeapObject(ret);
497
+ },
498
+ __wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
499
+ try {
500
+ var state0 = {a: arg0, b: arg1};
501
+ var cb0 = (arg0, arg1) => {
502
+ const a = state0.a;
503
+ state0.a = 0;
504
+ try {
505
+ return __wasm_bindgen_func_elem_16852(a, state0.b, arg0, arg1);
506
+ } finally {
507
+ state0.a = a;
508
+ }
509
+ };
510
+ const ret = new Promise(cb0);
511
+ return addHeapObject(ret);
512
+ } finally {
513
+ state0.a = 0;
514
+ }
515
+ },
516
+ __wbg_new_with_byte_offset_and_length_492c969e8b5da8a4: function(arg0, arg1, arg2) {
517
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
518
+ return addHeapObject(ret);
519
+ },
520
+ __wbg_new_with_str_3827d1a2319e0426: function() { return handleError(function (arg0, arg1) {
521
+ const ret = new Request(getStringFromWasm0(arg0, arg1));
522
+ return addHeapObject(ret);
523
+ }, arguments); },
524
+ __wbg_new_with_str_and_init_2f31a77deda127fd: function() { return handleError(function (arg0, arg1, arg2) {
525
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
526
+ return addHeapObject(ret);
527
+ }, arguments); },
528
+ __wbg_new_with_year_month_day_hr_min_sec_b23a132275d4b46a: function(arg0, arg1, arg2, arg3, arg4, arg5) {
529
+ const ret = new Date(arg0 >>> 0, arg1, arg2, arg3, arg4, arg5);
530
+ return addHeapObject(ret);
531
+ },
532
+ __wbg_next_95053e306b1c3aed: function(arg0) {
533
+ const ret = getObject(arg0).next;
534
+ return addHeapObject(ret);
535
+ },
536
+ __wbg_next_b8857422aaff4b5e: function() { return handleError(function (arg0) {
537
+ const ret = getObject(arg0).next();
538
+ return addHeapObject(ret);
539
+ }, arguments); },
540
+ __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
541
+ const ret = getObject(arg0).next();
542
+ return addHeapObject(ret);
543
+ }, arguments); },
544
+ __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
545
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
546
+ },
547
+ __wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
548
+ const ret = getObject(arg0).queueMicrotask;
549
+ return addHeapObject(ret);
550
+ },
551
+ __wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
552
+ queueMicrotask(getObject(arg0));
553
+ },
554
+ __wbg_ready_196967f79af47b0d: function(arg0) {
555
+ const ret = getObject(arg0).ready;
556
+ return addHeapObject(ret);
557
+ },
558
+ __wbg_releaseLock_508d9818266235f2: function(arg0) {
559
+ getObject(arg0).releaseLock();
560
+ },
561
+ __wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
562
+ const ret = Promise.resolve(getObject(arg0));
563
+ return addHeapObject(ret);
564
+ },
565
+ __wbg_respond_83a71686e927ca32: function() { return handleError(function (arg0, arg1) {
566
+ getObject(arg0).respond(arg1 >>> 0);
567
+ }, arguments); },
568
+ __wbg_search_6b8de53571c80faa: function(arg0, arg1) {
569
+ const ret = getObject(arg1).search;
570
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
571
+ const len1 = WASM_VECTOR_LEN;
572
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
573
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
574
+ },
575
+ __wbg_set_5f2ad37e5e02dc7b: function(arg0, arg1, arg2) {
576
+ getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
577
+ },
578
+ __wbg_set_headers_31d373f68f28bf76: function(arg0, arg1) {
579
+ getObject(arg0).headers = getObject(arg1);
580
+ },
581
+ __wbg_set_method_82e6c3c083da0734: function(arg0, arg1, arg2) {
582
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
583
+ },
584
+ __wbg_set_search_4282ef5d8c36f833: function(arg0, arg1, arg2) {
585
+ getObject(arg0).search = getStringFromWasm0(arg1, arg2);
586
+ },
587
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
588
+ const ret = getObject(arg1).stack;
589
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
590
+ const len1 = WASM_VECTOR_LEN;
591
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
592
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
593
+ },
594
+ __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
595
+ const ret = typeof global === 'undefined' ? null : global;
596
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
597
+ },
598
+ __wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
599
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
600
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
601
+ },
602
+ __wbg_static_accessor_SELF_d8b50611246a6d92: function() {
603
+ const ret = typeof self === 'undefined' ? null : self;
604
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
605
+ },
606
+ __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
607
+ const ret = typeof window === 'undefined' ? null : window;
608
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
609
+ },
610
+ __wbg_status_88ccc72fe7bea621: function(arg0) {
611
+ const ret = getObject(arg0).status;
612
+ return ret;
613
+ },
614
+ __wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
615
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
616
+ return addHeapObject(ret);
617
+ },
618
+ __wbg_then_b830475380919203: function(arg0, arg1) {
619
+ const ret = getObject(arg0).then(getObject(arg1));
620
+ return addHeapObject(ret);
621
+ },
622
+ __wbg_toString_794a30e85c994f2a: function(arg0) {
623
+ const ret = getObject(arg0).toString();
624
+ return addHeapObject(ret);
625
+ },
626
+ __wbg_toString_beee8ad71195e063: function(arg0) {
627
+ const ret = getObject(arg0).toString();
628
+ return addHeapObject(ret);
629
+ },
630
+ __wbg_url_8d180a4a6996e22d: function(arg0, arg1) {
631
+ const ret = getObject(arg1).url;
632
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
633
+ const len1 = WASM_VECTOR_LEN;
634
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
635
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
636
+ },
637
+ __wbg_value_c227f843d21da141: function(arg0) {
638
+ const ret = getObject(arg0).value;
639
+ return addHeapObject(ret);
640
+ },
641
+ __wbg_view_d8c7b26e4d4650f1: function(arg0) {
642
+ const ret = getObject(arg0).view;
643
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
644
+ },
645
+ __wbg_write_d32d19927af3f942: function(arg0, arg1) {
646
+ const ret = getObject(arg0).write(getObject(arg1));
647
+ return addHeapObject(ret);
648
+ },
649
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
650
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5320, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
651
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_16850);
652
+ return addHeapObject(ret);
653
+ },
654
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
655
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IteratorResult<any>")], shim_idx: 47, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
656
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_233);
657
+ return addHeapObject(ret);
658
+ },
659
+ __wbindgen_generic_0000000000000003: function(arg0) {
660
+ // Cast intrinsic for `F64 -> Externref`.
661
+ const ret = arg0;
662
+ return addHeapObject(ret);
663
+ },
664
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
665
+ // Cast intrinsic for `Ref(String) -> Externref`.
666
+ const ret = getStringFromWasm0(arg0, arg1);
667
+ return addHeapObject(ret);
668
+ },
669
+ __wbindgen_object_clone_ref: function(arg0) {
670
+ const ret = getObject(arg0);
671
+ return addHeapObject(ret);
672
+ },
673
+ __wbindgen_object_drop_ref: function(arg0) {
674
+ takeObject(arg0);
675
+ },
676
+ };
66
677
  return {
67
- read: arg.length,
68
- written: buf.length
678
+ __proto__: null,
679
+ "./tombi_lsp_wasm_bg.js": import0,
69
680
  };
70
- });
71
-
72
- function passStringToWasm0(arg, malloc, realloc) {
73
-
74
- if (realloc === undefined) {
75
- const buf = cachedTextEncoder.encode(arg);
76
- const ptr = malloc(buf.length, 1) >>> 0;
77
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
78
- WASM_VECTOR_LEN = buf.length;
79
- return ptr;
80
- }
81
-
82
- let len = arg.length;
83
- let ptr = malloc(len, 1) >>> 0;
84
-
85
- const mem = getUint8ArrayMemory0();
86
-
87
- let offset = 0;
681
+ }
88
682
 
89
- for (; offset < len; offset++) {
90
- const code = arg.charCodeAt(offset);
91
- if (code > 0x7F) break;
92
- mem[ptr + offset] = code;
93
- }
683
+ function __wasm_bindgen_func_elem_16852(arg0, arg1, arg2, arg3) {
684
+ wasm.__wasm_bindgen_func_elem_16852(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
685
+ }
94
686
 
95
- if (offset !== len) {
96
- if (offset !== 0) {
97
- arg = arg.slice(offset);
687
+ function __wasm_bindgen_func_elem_16850(arg0, arg1, arg2) {
688
+ try {
689
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
690
+ wasm.__wasm_bindgen_func_elem_16850(retptr, arg0, arg1, addHeapObject(arg2));
691
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
692
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
693
+ if (r1) {
694
+ throw takeObject(r0);
98
695
  }
99
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
100
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
101
- const ret = encodeString(arg, view);
696
+ } finally {
697
+ wasm.__wbindgen_add_to_stack_pointer(16);
698
+ }
699
+ }
102
700
 
103
- offset += ret.written;
104
- ptr = realloc(ptr, len, offset, 1) >>> 0;
701
+ function __wasm_bindgen_func_elem_233(arg0, arg1, arg2) {
702
+ try {
703
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
704
+ wasm.__wasm_bindgen_func_elem_233(retptr, arg0, arg1, addHeapObject(arg2));
705
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
706
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
707
+ if (r1) {
708
+ throw takeObject(r0);
709
+ }
710
+ } finally {
711
+ wasm.__wbindgen_add_to_stack_pointer(16);
105
712
  }
106
-
107
- WASM_VECTOR_LEN = offset;
108
- return ptr;
109
713
  }
110
714
 
111
- let cachedDataViewMemory0 = null;
112
715
 
113
- function getDataViewMemory0() {
114
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
115
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
116
- }
117
- return cachedDataViewMemory0;
118
- }
716
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
717
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
718
+ ? { register: () => {}, unregister: () => {} }
719
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
720
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
721
+ ? { register: () => {}, unregister: () => {} }
722
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr, 1));
723
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
724
+ ? { register: () => {}, unregister: () => {} }
725
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
726
+ const ServerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
727
+ ? { register: () => {}, unregister: () => {} }
728
+ : new FinalizationRegistry(ptr => wasm.__wbg_serverconfig_free(ptr, 1));
119
729
 
120
- function dropObject(idx) {
121
- if (idx < 132) return;
122
- heap[idx] = heap_next;
123
- heap_next = idx;
730
+ function addHeapObject(obj) {
731
+ if (heap_next === heap.length) heap.push(heap.length + 1);
732
+ const idx = heap_next;
733
+ heap_next = heap[idx];
734
+
735
+ heap[idx] = obj;
736
+ return idx;
124
737
  }
125
738
 
126
- function takeObject(idx) {
127
- const ret = getObject(idx);
128
- dropObject(idx);
129
- return ret;
739
+ function _assertClass(instance, klass) {
740
+ if (!(instance instanceof klass)) {
741
+ throw new Error(`expected instance of ${klass.name}`);
742
+ }
130
743
  }
131
744
 
132
745
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
133
746
  ? { register: () => {}, unregister: () => {} }
134
- : new FinalizationRegistry(state => {
135
- wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b)
136
- });
137
-
138
- function makeMutClosure(arg0, arg1, dtor, f) {
139
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
140
- const real = (...args) => {
141
- // First up with a closure we increment the internal reference
142
- // count. This ensures that the Rust closure environment won't
143
- // be deallocated while we're invoking it.
144
- state.cnt++;
145
- const a = state.a;
146
- state.a = 0;
147
- try {
148
- return f(a, state.b, ...args);
149
- } finally {
150
- if (--state.cnt === 0) {
151
- wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
152
- CLOSURE_DTORS.unregister(state);
153
- } else {
154
- state.a = a;
155
- }
156
- }
157
- };
158
- real.original = state;
159
- CLOSURE_DTORS.register(real, state, state);
160
- return real;
161
- }
747
+ : new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
162
748
 
163
749
  function debugString(val) {
164
750
  // primitive types
@@ -225,768 +811,211 @@ function debugString(val) {
225
811
  return className;
226
812
  }
227
813
 
228
- export function start() {
229
- wasm.start();
230
- }
231
-
232
- /**
233
- * Update one file in the browser-backed virtual workspace.
234
- * @param {string} uri
235
- * @param {string} text
236
- */
237
- export function set_workspace_file(uri, text) {
238
- try {
239
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
240
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
241
- const len0 = WASM_VECTOR_LEN;
242
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
243
- const len1 = WASM_VECTOR_LEN;
244
- wasm.set_workspace_file(retptr, ptr0, len0, ptr1, len1);
245
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
246
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
247
- if (r1) {
248
- throw takeObject(r0);
249
- }
250
- } finally {
251
- wasm.__wbindgen_add_to_stack_pointer(16);
252
- }
253
- }
254
-
255
- /**
256
- * Remove one file from the browser-backed virtual workspace.
257
- * @param {string} uri
258
- */
259
- export function remove_workspace_file(uri) {
260
- try {
261
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
262
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
263
- const len0 = WASM_VECTOR_LEN;
264
- wasm.remove_workspace_file(retptr, ptr0, len0);
265
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
266
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
267
- if (r1) {
268
- throw takeObject(r0);
269
- }
270
- } finally {
271
- wasm.__wbindgen_add_to_stack_pointer(16);
272
- }
273
- }
274
-
275
- /**
276
- * Replace the virtual workspace files visible to the WASM language server.
277
- * @param {any} files
278
- */
279
- export function set_workspace_files(files) {
280
- try {
281
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
282
- wasm.set_workspace_entries(retptr, addHeapObject(files));
283
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
284
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
285
- if (r1) {
286
- throw takeObject(r0);
287
- }
288
- } finally {
289
- wasm.__wbindgen_add_to_stack_pointer(16);
290
- }
814
+ function dropObject(idx) {
815
+ if (idx < 1028) return;
816
+ heap[idx] = heap_next;
817
+ heap_next = idx;
291
818
  }
292
819
 
293
- /**
294
- * Replace the virtual workspace entries visible to the WASM language server.
295
- * @param {any} entries
296
- */
297
- export function set_workspace_entries(entries) {
298
- try {
299
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
300
- wasm.set_workspace_entries(retptr, addHeapObject(entries));
301
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
302
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
303
- if (r1) {
304
- throw takeObject(r0);
305
- }
306
- } finally {
307
- wasm.__wbindgen_add_to_stack_pointer(16);
308
- }
820
+ function getArrayU8FromWasm0(ptr, len) {
821
+ ptr = ptr >>> 0;
822
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
309
823
  }
310
824
 
311
- function _assertClass(instance, klass) {
312
- if (!(instance instanceof klass)) {
313
- throw new Error(`expected instance of ${klass.name}`);
825
+ let cachedDataViewMemory0 = null;
826
+ function getDataViewMemory0() {
827
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
828
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
314
829
  }
315
- }
316
- /**
317
- * Serve Tombi LSP over byte streams using the standard LSP header framing.
318
- * @param {ServerConfig} config
319
- * @returns {Promise<void>}
320
- */
321
- export function serve(config) {
322
- _assertClass(config, ServerConfig);
323
- var ptr0 = config.__destroy_into_raw();
324
- const ret = wasm.serve(ptr0);
325
- return takeObject(ret);
326
- }
327
-
328
- function __wbg_adapter_38(arg0, arg1, arg2) {
329
- wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
830
+ return cachedDataViewMemory0;
330
831
  }
331
832
 
332
- function __wbg_adapter_164(arg0, arg1, arg2, arg3) {
333
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
833
+ function getStringFromWasm0(ptr, len) {
834
+ return decodeText(ptr >>> 0, len);
334
835
  }
335
836
 
336
- const __wbindgen_enum_ReadableStreamType = ["bytes"];
337
-
338
- const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
339
- ? { register: () => {}, unregister: () => {} }
340
- : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
341
-
342
- export class IntoUnderlyingByteSource {
343
-
344
- __destroy_into_raw() {
345
- const ptr = this.__wbg_ptr;
346
- this.__wbg_ptr = 0;
347
- IntoUnderlyingByteSourceFinalization.unregister(this);
348
- return ptr;
349
- }
350
-
351
- free() {
352
- const ptr = this.__destroy_into_raw();
353
- wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
354
- }
355
- /**
356
- * @returns {number}
357
- */
358
- get autoAllocateChunkSize() {
359
- const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
360
- return ret >>> 0;
361
- }
362
- /**
363
- * @param {ReadableByteStreamController} controller
364
- * @returns {Promise<any>}
365
- */
366
- pull(controller) {
367
- const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller));
368
- return takeObject(ret);
369
- }
370
- /**
371
- * @param {ReadableByteStreamController} controller
372
- */
373
- start(controller) {
374
- wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller));
375
- }
376
- /**
377
- * @returns {ReadableStreamType}
378
- */
379
- get type() {
380
- const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
381
- return __wbindgen_enum_ReadableStreamType[ret];
382
- }
383
- cancel() {
384
- const ptr = this.__destroy_into_raw();
385
- wasm.intounderlyingbytesource_cancel(ptr);
837
+ let cachedUint8ArrayMemory0 = null;
838
+ function getUint8ArrayMemory0() {
839
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
840
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
386
841
  }
842
+ return cachedUint8ArrayMemory0;
387
843
  }
388
-
389
- const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
390
- ? { register: () => {}, unregister: () => {} }
391
- : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
392
-
393
- export class IntoUnderlyingSink {
394
-
395
- __destroy_into_raw() {
396
- const ptr = this.__wbg_ptr;
397
- this.__wbg_ptr = 0;
398
- IntoUnderlyingSinkFinalization.unregister(this);
399
- return ptr;
400
- }
401
-
402
- free() {
403
- const ptr = this.__destroy_into_raw();
404
- wasm.__wbg_intounderlyingsink_free(ptr, 0);
405
- }
406
- /**
407
- * @param {any} reason
408
- * @returns {Promise<any>}
409
- */
410
- abort(reason) {
411
- const ptr = this.__destroy_into_raw();
412
- const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason));
413
- return takeObject(ret);
414
- }
415
- /**
416
- * @returns {Promise<any>}
417
- */
418
- close() {
419
- const ptr = this.__destroy_into_raw();
420
- const ret = wasm.intounderlyingsink_close(ptr);
421
- return takeObject(ret);
422
- }
423
- /**
424
- * @param {any} chunk
425
- * @returns {Promise<any>}
426
- */
427
- write(chunk) {
428
- const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk));
429
- return takeObject(ret);
844
+
845
+ function getObject(idx) { return heap[idx]; }
846
+
847
+ function handleError(f, args) {
848
+ try {
849
+ return f.apply(this, args);
850
+ } catch (e) {
851
+ wasm.__wbindgen_export3(addHeapObject(e));
430
852
  }
431
853
  }
432
854
 
433
- const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
434
- ? { register: () => {}, unregister: () => {} }
435
- : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
855
+ let heap = new Array(1024).fill(undefined);
856
+ heap.push(undefined, null, true, false);
436
857
 
437
- export class IntoUnderlyingSource {
858
+ let heap_next = heap.length;
438
859
 
439
- __destroy_into_raw() {
440
- const ptr = this.__wbg_ptr;
441
- this.__wbg_ptr = 0;
442
- IntoUnderlyingSourceFinalization.unregister(this);
860
+ function isLikeNone(x) {
861
+ return x === undefined || x === null;
862
+ }
863
+
864
+ function makeMutClosure(arg0, arg1, f) {
865
+ const state = { a: arg0, b: arg1, cnt: 1 };
866
+ const real = (...args) => {
867
+
868
+ // First up with a closure we increment the internal reference
869
+ // count. This ensures that the Rust closure environment won't
870
+ // be deallocated while we're invoking it.
871
+ state.cnt++;
872
+ const a = state.a;
873
+ state.a = 0;
874
+ try {
875
+ return f(a, state.b, ...args);
876
+ } finally {
877
+ state.a = a;
878
+ real._wbg_cb_unref();
879
+ }
880
+ };
881
+ real._wbg_cb_unref = () => {
882
+ if (--state.cnt === 0) {
883
+ wasm.__wbindgen_export5(state.a, state.b);
884
+ state.a = 0;
885
+ CLOSURE_DTORS.unregister(state);
886
+ }
887
+ };
888
+ CLOSURE_DTORS.register(real, state, state);
889
+ return real;
890
+ }
891
+
892
+ function passStringToWasm0(arg, malloc, realloc) {
893
+ if (realloc === undefined) {
894
+ const buf = cachedTextEncoder.encode(arg);
895
+ const ptr = malloc(buf.length, 1) >>> 0;
896
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
897
+ WASM_VECTOR_LEN = buf.length;
443
898
  return ptr;
444
899
  }
445
900
 
446
- free() {
447
- const ptr = this.__destroy_into_raw();
448
- wasm.__wbg_intounderlyingsource_free(ptr, 0);
449
- }
450
- /**
451
- * @param {ReadableStreamDefaultController} controller
452
- * @returns {Promise<any>}
453
- */
454
- pull(controller) {
455
- const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller));
456
- return takeObject(ret);
901
+ let len = arg.length;
902
+ let ptr = malloc(len, 1) >>> 0;
903
+
904
+ const mem = getUint8ArrayMemory0();
905
+
906
+ let offset = 0;
907
+
908
+ for (; offset < len; offset++) {
909
+ const code = arg.charCodeAt(offset);
910
+ if (code > 0x7F) break;
911
+ mem[ptr + offset] = code;
457
912
  }
458
- cancel() {
459
- const ptr = this.__destroy_into_raw();
460
- wasm.intounderlyingsource_cancel(ptr);
913
+ if (offset !== len) {
914
+ if (offset !== 0) {
915
+ arg = arg.slice(offset);
916
+ }
917
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
918
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
919
+ const ret = cachedTextEncoder.encodeInto(arg, view);
920
+
921
+ offset += ret.written;
922
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
461
923
  }
924
+
925
+ WASM_VECTOR_LEN = offset;
926
+ return ptr;
462
927
  }
463
928
 
464
- const ServerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
465
- ? { register: () => {}, unregister: () => {} }
466
- : new FinalizationRegistry(ptr => wasm.__wbg_serverconfig_free(ptr >>> 0, 1));
467
- /**
468
- * Browser streams used to exchange LSP messages with a Web Worker.
469
- */
470
- export class ServerConfig {
929
+ function takeObject(idx) {
930
+ const ret = getObject(idx);
931
+ dropObject(idx);
932
+ return ret;
933
+ }
471
934
 
472
- __destroy_into_raw() {
473
- const ptr = this.__wbg_ptr;
474
- this.__wbg_ptr = 0;
475
- ServerConfigFinalization.unregister(this);
476
- return ptr;
935
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
936
+ cachedTextDecoder.decode();
937
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
938
+ let numBytesDecoded = 0;
939
+ function decodeText(ptr, len) {
940
+ numBytesDecoded += len;
941
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
942
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
943
+ cachedTextDecoder.decode();
944
+ numBytesDecoded = len;
477
945
  }
946
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
947
+ }
478
948
 
479
- free() {
480
- const ptr = this.__destroy_into_raw();
481
- wasm.__wbg_serverconfig_free(ptr, 0);
482
- }
483
- /**
484
- * @param {AsyncIterator<any>} into_server
485
- * @param {WritableStream} from_server
486
- */
487
- constructor(into_server, from_server) {
488
- const ret = wasm.serverconfig_new(addHeapObject(into_server), addHeapObject(from_server));
489
- this.__wbg_ptr = ret >>> 0;
490
- ServerConfigFinalization.register(this, this.__wbg_ptr, this);
491
- return this;
492
- }
949
+ const cachedTextEncoder = new TextEncoder();
950
+
951
+ if (!('encodeInto' in cachedTextEncoder)) {
952
+ cachedTextEncoder.encodeInto = function (arg, view) {
953
+ const buf = cachedTextEncoder.encode(arg);
954
+ view.set(buf);
955
+ return {
956
+ read: arg.length,
957
+ written: buf.length
958
+ };
959
+ };
960
+ }
961
+
962
+ let WASM_VECTOR_LEN = 0;
963
+
964
+ let wasmModule, wasmInstance, wasm;
965
+ function __wbg_finalize_init(instance, module) {
966
+ wasmInstance = instance;
967
+ wasm = instance.exports;
968
+ wasmModule = module;
969
+ cachedDataViewMemory0 = null;
970
+ cachedUint8ArrayMemory0 = null;
971
+ wasm.__wbindgen_start();
972
+ return wasm;
493
973
  }
494
974
 
495
975
  async function __wbg_load(module, imports) {
496
976
  if (typeof Response === 'function' && module instanceof Response) {
977
+ if (!module.ok) {
978
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
979
+ }
980
+
497
981
  if (typeof WebAssembly.instantiateStreaming === 'function') {
498
982
  try {
499
983
  return await WebAssembly.instantiateStreaming(module, imports);
500
-
501
984
  } catch (e) {
502
- if (module.headers.get('Content-Type') != 'application/wasm') {
985
+ const validResponse = expectedResponseType(module.type);
986
+
987
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
503
988
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
504
989
 
505
- } else {
506
- throw e;
507
- }
990
+ } else { throw e; }
508
991
  }
509
992
  }
510
993
 
511
994
  const bytes = await module.arrayBuffer();
512
995
  return await WebAssembly.instantiate(bytes, imports);
513
-
514
996
  } else {
515
997
  const instance = await WebAssembly.instantiate(module, imports);
516
998
 
517
999
  if (instance instanceof WebAssembly.Instance) {
518
1000
  return { instance, module };
519
-
520
1001
  } else {
521
1002
  return instance;
522
1003
  }
523
1004
  }
524
- }
525
1005
 
526
- function __wbg_get_imports() {
527
- const imports = {};
528
- imports.wbg = {};
529
- imports.wbg.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
530
- const ret = getObject(arg0).arrayBuffer();
531
- return addHeapObject(ret);
532
- }, arguments) };
533
- imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
534
- const ret = getObject(arg0).buffer;
535
- return addHeapObject(ret);
536
- };
537
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
538
- const ret = getObject(arg0).buffer;
539
- return addHeapObject(ret);
540
- };
541
- imports.wbg.__wbg_byobRequest_77d9adf63337edfb = function(arg0) {
542
- const ret = getObject(arg0).byobRequest;
543
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
544
- };
545
- imports.wbg.__wbg_byteLength_e674b853d9c77e1d = function(arg0) {
546
- const ret = getObject(arg0).byteLength;
547
- return ret;
548
- };
549
- imports.wbg.__wbg_byteOffset_fd862df290ef848d = function(arg0) {
550
- const ret = getObject(arg0).byteOffset;
551
- return ret;
552
- };
553
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
554
- const ret = getObject(arg0).call(getObject(arg1));
555
- return addHeapObject(ret);
556
- }, arguments) };
557
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
558
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
559
- return addHeapObject(ret);
560
- }, arguments) };
561
- imports.wbg.__wbg_close_304cc1fef3466669 = function() { return handleError(function (arg0) {
562
- getObject(arg0).close();
563
- }, arguments) };
564
- imports.wbg.__wbg_close_5ce03e29be453811 = function() { return handleError(function (arg0) {
565
- getObject(arg0).close();
566
- }, arguments) };
567
- imports.wbg.__wbg_close_fa50b16598acbea1 = function(arg0) {
568
- const ret = getObject(arg0).close();
569
- return addHeapObject(ret);
570
- };
571
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
572
- const ret = getObject(arg0).done;
573
- return ret;
574
- };
575
- imports.wbg.__wbg_enqueue_bb16ba72f537dc9e = function() { return handleError(function (arg0, arg1) {
576
- getObject(arg0).enqueue(getObject(arg1));
577
- }, arguments) };
578
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
579
- const ret = Object.entries(getObject(arg0));
580
- return addHeapObject(ret);
581
- };
582
- imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
583
- let deferred0_0;
584
- let deferred0_1;
585
- try {
586
- deferred0_0 = arg0;
587
- deferred0_1 = arg1;
588
- console.error(getStringFromWasm0(arg0, arg1));
589
- } finally {
590
- wasm.__wbindgen_export_1(deferred0_0, deferred0_1, 1);
591
- }
592
- };
593
- imports.wbg.__wbg_fetch_a9bc66c159c18e19 = function(arg0) {
594
- const ret = fetch(getObject(arg0));
595
- return addHeapObject(ret);
596
- };
597
- imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
598
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
599
- }, arguments) };
600
- imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
601
- const ret = getObject(arg0).getTime();
602
- return ret;
603
- };
604
- imports.wbg.__wbg_getTimezoneOffset_6b5752021c499c47 = function(arg0) {
605
- const ret = getObject(arg0).getTimezoneOffset();
606
- return ret;
607
- };
608
- imports.wbg.__wbg_getWriter_6ce182d0adc3f96b = function() { return handleError(function (arg0) {
609
- const ret = getObject(arg0).getWriter();
610
- return addHeapObject(ret);
611
- }, arguments) };
612
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
613
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
614
- return addHeapObject(ret);
615
- }, arguments) };
616
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
617
- const ret = getObject(arg0)[arg1 >>> 0];
618
- return addHeapObject(ret);
619
- };
620
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
621
- const ret = getObject(arg0)[getObject(arg1)];
622
- return addHeapObject(ret);
623
- };
624
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
625
- let result;
626
- try {
627
- result = getObject(arg0) instanceof ArrayBuffer;
628
- } catch (_) {
629
- result = false;
630
- }
631
- const ret = result;
632
- return ret;
633
- };
634
- imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
635
- let result;
636
- try {
637
- result = getObject(arg0) instanceof Error;
638
- } catch (_) {
639
- result = false;
640
- }
641
- const ret = result;
642
- return ret;
643
- };
644
- imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
645
- let result;
646
- try {
647
- result = getObject(arg0) instanceof Response;
648
- } catch (_) {
649
- result = false;
650
- }
651
- const ret = result;
652
- return ret;
653
- };
654
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
655
- let result;
656
- try {
657
- result = getObject(arg0) instanceof Uint8Array;
658
- } catch (_) {
659
- result = false;
660
- }
661
- const ret = result;
662
- return ret;
663
- };
664
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
665
- const ret = Array.isArray(getObject(arg0));
666
- return ret;
667
- };
668
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
669
- const ret = Symbol.iterator;
670
- return addHeapObject(ret);
671
- };
672
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
673
- const ret = getObject(arg0).length;
674
- return ret;
675
- };
676
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
677
- const ret = getObject(arg0).length;
678
- return ret;
679
- };
680
- imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
681
- const ret = getObject(arg0).message;
682
- return addHeapObject(ret);
683
- };
684
- imports.wbg.__wbg_name_0b327d569f00ebee = function(arg0) {
685
- const ret = getObject(arg0).name;
686
- return addHeapObject(ret);
687
- };
688
- imports.wbg.__wbg_new0_f788a2397c7ca929 = function() {
689
- const ret = new Date();
690
- return addHeapObject(ret);
691
- };
692
- imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
693
- const ret = new Headers();
694
- return addHeapObject(ret);
695
- }, arguments) };
696
- imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
697
- try {
698
- var state0 = {a: arg0, b: arg1};
699
- var cb0 = (arg0, arg1) => {
700
- const a = state0.a;
701
- state0.a = 0;
702
- try {
703
- return __wbg_adapter_164(a, state0.b, arg0, arg1);
704
- } finally {
705
- state0.a = a;
706
- }
707
- };
708
- const ret = new Promise(cb0);
709
- return addHeapObject(ret);
710
- } finally {
711
- state0.a = state0.b = 0;
712
- }
713
- };
714
- imports.wbg.__wbg_new_31a97dac4f10fab7 = function(arg0) {
715
- const ret = new Date(getObject(arg0));
716
- return addHeapObject(ret);
717
- };
718
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
719
- const ret = new Object();
720
- return addHeapObject(ret);
721
- };
722
- imports.wbg.__wbg_new_80bf4ee74f41ff92 = function() { return handleError(function () {
723
- const ret = new URLSearchParams();
724
- return addHeapObject(ret);
725
- }, arguments) };
726
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
727
- const ret = new Error();
728
- return addHeapObject(ret);
729
- };
730
- imports.wbg.__wbg_new_9ffbe0a71eff35e3 = function() { return handleError(function (arg0, arg1) {
731
- const ret = new URL(getStringFromWasm0(arg0, arg1));
732
- return addHeapObject(ret);
733
- }, arguments) };
734
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
735
- const ret = new Uint8Array(getObject(arg0));
736
- return addHeapObject(ret);
737
- };
738
- imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
739
- const ret = new Error(getStringFromWasm0(arg0, arg1));
740
- return addHeapObject(ret);
741
- };
742
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
743
- const ret = new Function(getStringFromWasm0(arg0, arg1));
744
- return addHeapObject(ret);
745
- };
746
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
747
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
748
- return addHeapObject(ret);
749
- };
750
- imports.wbg.__wbg_newwithstr_78e86e03c4ae814e = function() { return handleError(function (arg0, arg1) {
751
- const ret = new Request(getStringFromWasm0(arg0, arg1));
752
- return addHeapObject(ret);
753
- }, arguments) };
754
- imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
755
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
756
- return addHeapObject(ret);
757
- }, arguments) };
758
- imports.wbg.__wbg_newwithyearmonthdayhrminsec_72c204d952ef4426 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
759
- const ret = new Date(arg0 >>> 0, arg1, arg2, arg3, arg4, arg5);
760
- return addHeapObject(ret);
761
- };
762
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
763
- const ret = getObject(arg0).next;
764
- return addHeapObject(ret);
765
- };
766
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
767
- const ret = getObject(arg0).next();
768
- return addHeapObject(ret);
769
- }, arguments) };
770
- imports.wbg.__wbg_next_c3ab0d59847b3b5c = function() { return handleError(function (arg0) {
771
- const ret = getObject(arg0).next();
772
- return addHeapObject(ret);
773
- }, arguments) };
774
- imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
775
- queueMicrotask(getObject(arg0));
776
- };
777
- imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
778
- const ret = getObject(arg0).queueMicrotask;
779
- return addHeapObject(ret);
780
- };
781
- imports.wbg.__wbg_ready_480b0e63c18378c7 = function(arg0) {
782
- const ret = getObject(arg0).ready;
783
- return addHeapObject(ret);
784
- };
785
- imports.wbg.__wbg_releaseLock_a389e6ea62ce0f4d = function(arg0) {
786
- getObject(arg0).releaseLock();
787
- };
788
- imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
789
- const ret = Promise.resolve(getObject(arg0));
790
- return addHeapObject(ret);
791
- };
792
- imports.wbg.__wbg_respond_1f279fa9f8edcb1c = function() { return handleError(function (arg0, arg1) {
793
- getObject(arg0).respond(arg1 >>> 0);
794
- }, arguments) };
795
- imports.wbg.__wbg_search_e0e79cfe010c5c23 = function(arg0, arg1) {
796
- const ret = getObject(arg1).search;
797
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
798
- const len1 = WASM_VECTOR_LEN;
799
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
800
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
801
- };
802
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
803
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
804
- };
805
- imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
806
- getObject(arg0).headers = getObject(arg1);
807
- };
808
- imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
809
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
810
- };
811
- imports.wbg.__wbg_setsearch_609451e9e712f3c6 = function(arg0, arg1, arg2) {
812
- getObject(arg0).search = getStringFromWasm0(arg1, arg2);
813
- };
814
- imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
815
- const ret = getObject(arg1).stack;
816
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
817
- const len1 = WASM_VECTOR_LEN;
818
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
819
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
820
- };
821
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
822
- const ret = typeof global === 'undefined' ? null : global;
823
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
824
- };
825
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
826
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
827
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
828
- };
829
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
830
- const ret = typeof self === 'undefined' ? null : self;
831
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
832
- };
833
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
834
- const ret = typeof window === 'undefined' ? null : window;
835
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
836
- };
837
- imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) {
838
- const ret = getObject(arg0).status;
839
- return ret;
840
- };
841
- imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
842
- const ret = getObject(arg0).then(getObject(arg1));
843
- return addHeapObject(ret);
844
- };
845
- imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
846
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
847
- return addHeapObject(ret);
848
- };
849
- imports.wbg.__wbg_toString_5285597960676b7b = function(arg0) {
850
- const ret = getObject(arg0).toString();
851
- return addHeapObject(ret);
852
- };
853
- imports.wbg.__wbg_toString_c813bbd34d063839 = function(arg0) {
854
- const ret = getObject(arg0).toString();
855
- return addHeapObject(ret);
856
- };
857
- imports.wbg.__wbg_url_8f9653b899456042 = function(arg0, arg1) {
858
- const ret = getObject(arg1).url;
859
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
860
- const len1 = WASM_VECTOR_LEN;
861
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
862
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
863
- };
864
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
865
- const ret = getObject(arg0).value;
866
- return addHeapObject(ret);
867
- };
868
- imports.wbg.__wbg_view_fd8a56e8983f448d = function(arg0) {
869
- const ret = getObject(arg0).view;
870
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
871
- };
872
- imports.wbg.__wbg_write_311434e30ee214e5 = function(arg0, arg1) {
873
- const ret = getObject(arg0).write(getObject(arg1));
874
- return addHeapObject(ret);
875
- };
876
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
877
- const v = getObject(arg0);
878
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
879
- return ret;
880
- };
881
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
882
- const obj = takeObject(arg0).original;
883
- if (obj.cnt-- == 1) {
884
- obj.a = 0;
885
- return true;
1006
+ function expectedResponseType(type) {
1007
+ switch (type) {
1008
+ case 'basic': case 'cors': case 'default': return true;
886
1009
  }
887
- const ret = false;
888
- return ret;
889
- };
890
- imports.wbg.__wbindgen_closure_wrapper16114 = function(arg0, arg1, arg2) {
891
- const ret = makeMutClosure(arg0, arg1, 5270, __wbg_adapter_38);
892
- return addHeapObject(ret);
893
- };
894
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
895
- const ret = debugString(getObject(arg1));
896
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
897
- const len1 = WASM_VECTOR_LEN;
898
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
899
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
900
- };
901
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
902
- const ret = new Error(getStringFromWasm0(arg0, arg1));
903
- return addHeapObject(ret);
904
- };
905
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
906
- const ret = getObject(arg0) in getObject(arg1);
907
- return ret;
908
- };
909
- imports.wbg.__wbindgen_is_function = function(arg0) {
910
- const ret = typeof(getObject(arg0)) === 'function';
911
- return ret;
912
- };
913
- imports.wbg.__wbindgen_is_object = function(arg0) {
914
- const val = getObject(arg0);
915
- const ret = typeof(val) === 'object' && val !== null;
916
- return ret;
917
- };
918
- imports.wbg.__wbindgen_is_string = function(arg0) {
919
- const ret = typeof(getObject(arg0)) === 'string';
920
- return ret;
921
- };
922
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
923
- const ret = getObject(arg0) === undefined;
924
- return ret;
925
- };
926
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
927
- const ret = getObject(arg0) == getObject(arg1);
928
- return ret;
929
- };
930
- imports.wbg.__wbindgen_memory = function() {
931
- const ret = wasm.memory;
932
- return addHeapObject(ret);
933
- };
934
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
935
- const obj = getObject(arg1);
936
- const ret = typeof(obj) === 'number' ? obj : undefined;
937
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
938
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
939
- };
940
- imports.wbg.__wbindgen_number_new = function(arg0) {
941
- const ret = arg0;
942
- return addHeapObject(ret);
943
- };
944
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
945
- const ret = getObject(arg0);
946
- return addHeapObject(ret);
947
- };
948
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
949
- takeObject(arg0);
950
- };
951
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
952
- const obj = getObject(arg1);
953
- const ret = typeof(obj) === 'string' ? obj : undefined;
954
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
955
- var len1 = WASM_VECTOR_LEN;
956
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
957
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
958
- };
959
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
960
- const ret = getStringFromWasm0(arg0, arg1);
961
- return addHeapObject(ret);
962
- };
963
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
964
- throw new Error(getStringFromWasm0(arg0, arg1));
965
- };
966
-
967
- return imports;
968
- }
969
-
970
- function __wbg_init_memory(imports, memory) {
971
-
972
- }
973
-
974
- function __wbg_finalize_init(instance, module) {
975
- wasm = instance.exports;
976
- __wbg_init.__wbindgen_wasm_module = module;
977
- cachedDataViewMemory0 = null;
978
- cachedUint8ArrayMemory0 = null;
979
-
980
-
981
- wasm.__wbindgen_start();
982
- return wasm;
1010
+ return false;
1011
+ }
983
1012
  }
984
1013
 
985
1014
  function initSync(module) {
986
1015
  if (wasm !== undefined) return wasm;
987
1016
 
988
1017
 
989
- if (typeof module !== 'undefined') {
1018
+ if (module !== undefined) {
990
1019
  if (Object.getPrototypeOf(module) === Object.prototype) {
991
1020
  ({module} = module)
992
1021
  } else {
@@ -995,15 +1024,10 @@ function initSync(module) {
995
1024
  }
996
1025
 
997
1026
  const imports = __wbg_get_imports();
998
-
999
- __wbg_init_memory(imports);
1000
-
1001
1027
  if (!(module instanceof WebAssembly.Module)) {
1002
1028
  module = new WebAssembly.Module(module);
1003
1029
  }
1004
-
1005
1030
  const instance = new WebAssembly.Instance(module, imports);
1006
-
1007
1031
  return __wbg_finalize_init(instance, module);
1008
1032
  }
1009
1033
 
@@ -1011,7 +1035,7 @@ async function __wbg_init(module_or_path) {
1011
1035
  if (wasm !== undefined) return wasm;
1012
1036
 
1013
1037
 
1014
- if (typeof module_or_path !== 'undefined') {
1038
+ if (module_or_path !== undefined) {
1015
1039
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1016
1040
  ({module_or_path} = module_or_path)
1017
1041
  } else {
@@ -1019,7 +1043,7 @@ async function __wbg_init(module_or_path) {
1019
1043
  }
1020
1044
  }
1021
1045
 
1022
- if (typeof module_or_path === 'undefined') {
1046
+ if (module_or_path === undefined) {
1023
1047
  module_or_path = new URL('tombi_lsp_wasm_bg.wasm', import.meta.url);
1024
1048
  }
1025
1049
  const imports = __wbg_get_imports();
@@ -1028,12 +1052,9 @@ async function __wbg_init(module_or_path) {
1028
1052
  module_or_path = fetch(module_or_path);
1029
1053
  }
1030
1054
 
1031
- __wbg_init_memory(imports);
1032
-
1033
1055
  const { instance, module } = await __wbg_load(await module_or_path, imports);
1034
1056
 
1035
1057
  return __wbg_finalize_init(instance, module);
1036
1058
  }
1037
1059
 
1038
- export { initSync };
1039
- export default __wbg_init;
1060
+ export { initSync, __wbg_init as default };