swls-wasm 0.2.11 → 0.2.13-alpha.1

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.
package/README.md CHANGED
@@ -25,6 +25,61 @@ wasm-pack publish
25
25
  ```
26
26
 
27
27
 
28
+ ## Custom LSP Requests
29
+
30
+ The WASM LSP server sends custom requests **from server to client** that the host must handle. All requests use `params: { url: string }`.
31
+
32
+ If a handler is not implemented, the server falls back to a sensible default.
33
+
34
+ ### `custom/readFile`
35
+
36
+ Reads the contents of a file.
37
+
38
+ ```ts
39
+ params: { url: string }
40
+ result: { content: string } | { error: string }
41
+ ```
42
+
43
+ ### `custom/readDir`
44
+
45
+ Lists the entries of a directory.
46
+
47
+ ```ts
48
+ params: { url: string }
49
+ result: Array<{ name: string; path: string; is_dir: boolean }>
50
+ // fallback: returns null/error → treated as empty
51
+ ```
52
+
53
+ ### `custom/isFile`
54
+
55
+ Returns whether the given URL refers to a file.
56
+
57
+ ```ts
58
+ params: { url: string }
59
+ result: boolean
60
+ // fallback: true when URL does not end with '/'
61
+ ```
62
+
63
+ ### `custom/isDir`
64
+
65
+ Returns whether the given URL refers to a directory.
66
+
67
+ ```ts
68
+ params: { url: string }
69
+ result: boolean
70
+ // fallback: true when URL ends with '/'
71
+ ```
72
+
73
+ ### `custom/canonicalize`
74
+
75
+ Resolves a URL to its canonical form.
76
+
77
+ ```ts
78
+ params: { url: string }
79
+ result: { url: string }
80
+ // fallback: returns the input URL unchanged
81
+ ```
82
+
28
83
  ## License
29
84
 
30
85
  * MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)
package/package.json CHANGED
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "name": "swls-wasm",
3
3
  "type": "module",
4
- "collaborators": [
5
- "ajuvercr <arthur.vercruysse@outlook.com>"
6
- ],
7
- "version": "0.2.11",
4
+ "collaborators": [ "ajuvercr <arthur.vercruysse@outlook.com>" ],
5
+ "version": "0.2.13-alpha.1",
8
6
  "files": [
9
7
  "swls_wasm_bg.wasm",
10
8
  "swls_wasm.js",
@@ -13,8 +11,5 @@
13
11
  ],
14
12
  "main": "swls_wasm.js",
15
13
  "types": "swls_wasm.d.ts",
16
- "sideEffects": [
17
- "./swls_wasm.js",
18
- "./snippets/*"
19
- ]
14
+ "sideEffects": [ "./swls_wasm.js", "./snippets/*" ]
20
15
  }
package/swls_wasm.d.ts CHANGED
@@ -1,17 +1,20 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * A self-contained WASM LSP instance that JS can create.
6
+ */
4
7
  export class WasmLsp {
5
- free(): void;
6
- [Symbol.dispose](): void;
7
- /**
8
- * JS must pass a callback for receiving messages from Rust/WASM.
9
- */
10
- constructor(post_message_cb: Function, debug_cb?: Function | null);
11
- /**
12
- * Send a message from JS → LSP.
13
- */
14
- send(msg: string): void;
8
+ free(): void;
9
+ [Symbol.dispose](): void;
10
+ /**
11
+ * JS must pass a callback for receiving messages from Rust/WASM.
12
+ */
13
+ constructor(post_message_cb: Function, debug_cb?: Function | null);
14
+ /**
15
+ * Send a message from JS → LSP.
16
+ */
17
+ send(msg: string): void;
15
18
  }
16
19
 
17
20
  export function start_wasm_lsp(): Promise<void>;
package/swls_wasm.js CHANGED
@@ -1,5 +1,9 @@
1
+ /* @ts-self-types="./swls_wasm.d.ts" */
1
2
  import * as wasm from "./swls_wasm_bg.wasm";
2
- export * from "./swls_wasm_bg.js";
3
3
  import { __wbg_set_wasm } from "./swls_wasm_bg.js";
4
+
4
5
  __wbg_set_wasm(wasm);
5
6
  wasm.__wbindgen_start();
7
+ export {
8
+ WasmLsp, start_wasm_lsp
9
+ } from "./swls_wasm_bg.js";
package/swls_wasm_bg.js CHANGED
@@ -1,228 +1,3 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
- function addToExternrefTable0(obj) {
7
- const idx = wasm.__externref_table_alloc();
8
- wasm.__wbindgen_externrefs.set(idx, obj);
9
- return idx;
10
- }
11
-
12
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
13
- ? { register: () => {}, unregister: () => {} }
14
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
15
-
16
- function debugString(val) {
17
- // primitive types
18
- const type = typeof val;
19
- if (type == 'number' || type == 'boolean' || val == null) {
20
- return `${val}`;
21
- }
22
- if (type == 'string') {
23
- return `"${val}"`;
24
- }
25
- if (type == 'symbol') {
26
- const description = val.description;
27
- if (description == null) {
28
- return 'Symbol';
29
- } else {
30
- return `Symbol(${description})`;
31
- }
32
- }
33
- if (type == 'function') {
34
- const name = val.name;
35
- if (typeof name == 'string' && name.length > 0) {
36
- return `Function(${name})`;
37
- } else {
38
- return 'Function';
39
- }
40
- }
41
- // objects
42
- if (Array.isArray(val)) {
43
- const length = val.length;
44
- let debug = '[';
45
- if (length > 0) {
46
- debug += debugString(val[0]);
47
- }
48
- for(let i = 1; i < length; i++) {
49
- debug += ', ' + debugString(val[i]);
50
- }
51
- debug += ']';
52
- return debug;
53
- }
54
- // Test for built-in
55
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
56
- let className;
57
- if (builtInMatches && builtInMatches.length > 1) {
58
- className = builtInMatches[1];
59
- } else {
60
- // Failed to match the standard '[object ClassName]'
61
- return toString.call(val);
62
- }
63
- if (className == 'Object') {
64
- // we're a user defined class or Object
65
- // JSON.stringify avoids problems with cycles, and is generally much
66
- // easier than looping through ownProperties of `val`.
67
- try {
68
- return 'Object(' + JSON.stringify(val) + ')';
69
- } catch (_) {
70
- return 'Object';
71
- }
72
- }
73
- // errors
74
- if (val instanceof Error) {
75
- return `${val.name}: ${val.message}\n${val.stack}`;
76
- }
77
- // TODO we could test for more things here, like `Set`s and `Map`s.
78
- return className;
79
- }
80
-
81
- function getArrayU8FromWasm0(ptr, len) {
82
- ptr = ptr >>> 0;
83
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
84
- }
85
-
86
- let cachedDataViewMemory0 = null;
87
- function getDataViewMemory0() {
88
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
89
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
90
- }
91
- return cachedDataViewMemory0;
92
- }
93
-
94
- function getStringFromWasm0(ptr, len) {
95
- ptr = ptr >>> 0;
96
- return decodeText(ptr, len);
97
- }
98
-
99
- let cachedUint8ArrayMemory0 = null;
100
- function getUint8ArrayMemory0() {
101
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
102
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
103
- }
104
- return cachedUint8ArrayMemory0;
105
- }
106
-
107
- function handleError(f, args) {
108
- try {
109
- return f.apply(this, args);
110
- } catch (e) {
111
- const idx = addToExternrefTable0(e);
112
- wasm.__wbindgen_exn_store(idx);
113
- }
114
- }
115
-
116
- function isLikeNone(x) {
117
- return x === undefined || x === null;
118
- }
119
-
120
- function makeMutClosure(arg0, arg1, dtor, f) {
121
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
122
- const real = (...args) => {
123
-
124
- // First up with a closure we increment the internal reference
125
- // count. This ensures that the Rust closure environment won't
126
- // be deallocated while we're invoking it.
127
- state.cnt++;
128
- const a = state.a;
129
- state.a = 0;
130
- try {
131
- return f(a, state.b, ...args);
132
- } finally {
133
- state.a = a;
134
- real._wbg_cb_unref();
135
- }
136
- };
137
- real._wbg_cb_unref = () => {
138
- if (--state.cnt === 0) {
139
- state.dtor(state.a, state.b);
140
- state.a = 0;
141
- CLOSURE_DTORS.unregister(state);
142
- }
143
- };
144
- CLOSURE_DTORS.register(real, state, state);
145
- return real;
146
- }
147
-
148
- function passStringToWasm0(arg, malloc, realloc) {
149
- if (realloc === undefined) {
150
- const buf = cachedTextEncoder.encode(arg);
151
- const ptr = malloc(buf.length, 1) >>> 0;
152
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
153
- WASM_VECTOR_LEN = buf.length;
154
- return ptr;
155
- }
156
-
157
- let len = arg.length;
158
- let ptr = malloc(len, 1) >>> 0;
159
-
160
- const mem = getUint8ArrayMemory0();
161
-
162
- let offset = 0;
163
-
164
- for (; offset < len; offset++) {
165
- const code = arg.charCodeAt(offset);
166
- if (code > 0x7F) break;
167
- mem[ptr + offset] = code;
168
- }
169
- if (offset !== len) {
170
- if (offset !== 0) {
171
- arg = arg.slice(offset);
172
- }
173
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
174
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
175
- const ret = cachedTextEncoder.encodeInto(arg, view);
176
-
177
- offset += ret.written;
178
- ptr = realloc(ptr, len, offset, 1) >>> 0;
179
- }
180
-
181
- WASM_VECTOR_LEN = offset;
182
- return ptr;
183
- }
184
-
185
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
186
- cachedTextDecoder.decode();
187
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
188
- let numBytesDecoded = 0;
189
- function decodeText(ptr, len) {
190
- numBytesDecoded += len;
191
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
192
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
193
- cachedTextDecoder.decode();
194
- numBytesDecoded = len;
195
- }
196
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
197
- }
198
-
199
- const cachedTextEncoder = new TextEncoder();
200
-
201
- if (!('encodeInto' in cachedTextEncoder)) {
202
- cachedTextEncoder.encodeInto = function (arg, view) {
203
- const buf = cachedTextEncoder.encode(arg);
204
- view.set(buf);
205
- return {
206
- read: arg.length,
207
- written: buf.length
208
- };
209
- }
210
- }
211
-
212
- let WASM_VECTOR_LEN = 0;
213
-
214
- function wasm_bindgen__convert__closures_____invoke__hdf449a9872fb8032(arg0, arg1, arg2) {
215
- wasm.wasm_bindgen__convert__closures_____invoke__hdf449a9872fb8032(arg0, arg1, arg2);
216
- }
217
-
218
- function wasm_bindgen__convert__closures_____invoke__h99ba0a2e80dc875e(arg0, arg1, arg2, arg3) {
219
- wasm.wasm_bindgen__convert__closures_____invoke__h99ba0a2e80dc875e(arg0, arg1, arg2, arg3);
220
- }
221
-
222
- const WasmLspFinalization = (typeof FinalizationRegistry === 'undefined')
223
- ? { register: () => {}, unregister: () => {} }
224
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmlsp_free(ptr >>> 0, 1));
225
-
226
1
  /**
227
2
  * A self-contained WASM LSP instance that JS can create.
228
3
  */
@@ -266,105 +41,87 @@ if (Symbol.dispose) WasmLsp.prototype[Symbol.dispose] = WasmLsp.prototype.free;
266
41
  export function start_wasm_lsp() {
267
42
  wasm.start_wasm_lsp();
268
43
  }
269
-
270
- export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
44
+ export function __wbg_Error_960c155d3d49e4c2(arg0, arg1) {
271
45
  const ret = Error(getStringFromWasm0(arg0, arg1));
272
46
  return ret;
273
- };
274
-
275
- export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
47
+ }
48
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
276
49
  const ret = String(arg1);
277
50
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
278
51
  const len1 = WASM_VECTOR_LEN;
279
52
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
280
53
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
281
- };
282
-
283
- export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
54
+ }
55
+ export function __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff(arg0) {
284
56
  const v = arg0;
285
57
  const ret = typeof(v) === 'boolean' ? v : undefined;
286
58
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
287
- };
288
-
289
- export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
59
+ }
60
+ export function __wbg___wbindgen_debug_string_ab4b34d23d6778bd(arg0, arg1) {
290
61
  const ret = debugString(arg1);
291
62
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
292
63
  const len1 = WASM_VECTOR_LEN;
293
64
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
294
65
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
295
- };
296
-
297
- export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
66
+ }
67
+ export function __wbg___wbindgen_is_function_3baa9db1a987f47d(arg0) {
298
68
  const ret = typeof(arg0) === 'function';
299
69
  return ret;
300
- };
301
-
302
- export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
70
+ }
71
+ export function __wbg___wbindgen_is_object_63322ec0cd6ea4ef(arg0) {
303
72
  const val = arg0;
304
73
  const ret = typeof(val) === 'object' && val !== null;
305
74
  return ret;
306
- };
307
-
308
- export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
75
+ }
76
+ export function __wbg___wbindgen_is_string_6df3bf7ef1164ed3(arg0) {
309
77
  const ret = typeof(arg0) === 'string';
310
78
  return ret;
311
- };
312
-
313
- export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
79
+ }
80
+ export function __wbg___wbindgen_is_undefined_29a43b4d42920abd(arg0) {
314
81
  const ret = arg0 === undefined;
315
82
  return ret;
316
- };
317
-
318
- export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
83
+ }
84
+ export function __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c(arg0, arg1) {
319
85
  const ret = arg0 == arg1;
320
86
  return ret;
321
- };
322
-
323
- export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
87
+ }
88
+ export function __wbg___wbindgen_number_get_c7f42aed0525c451(arg0, arg1) {
324
89
  const obj = arg1;
325
90
  const ret = typeof(obj) === 'number' ? obj : undefined;
326
91
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
327
92
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
328
- };
329
-
330
- export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
93
+ }
94
+ export function __wbg___wbindgen_string_get_7ed5322991caaec5(arg0, arg1) {
331
95
  const obj = arg1;
332
96
  const ret = typeof(obj) === 'string' ? obj : undefined;
333
97
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
98
  var len1 = WASM_VECTOR_LEN;
335
99
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
336
100
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
337
- };
338
-
339
- export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
101
+ }
102
+ export function __wbg___wbindgen_throw_6b64449b9b9ed33c(arg0, arg1) {
340
103
  throw new Error(getStringFromWasm0(arg0, arg1));
341
- };
342
-
343
- export function __wbg__wbg_cb_unref_87dfb5aaa0cbcea7(arg0) {
104
+ }
105
+ export function __wbg__wbg_cb_unref_b46c9b5a9f08ec37(arg0) {
344
106
  arg0._wbg_cb_unref();
345
- };
346
-
347
- export function __wbg_call_3020136f7a2d6e44() { return handleError(function (arg0, arg1, arg2) {
348
- const ret = arg0.call(arg1, arg2);
349
- return ret;
350
- }, arguments) };
351
-
352
- export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
107
+ }
108
+ export function __wbg_call_14b169f759b26747() { return handleError(function (arg0, arg1) {
353
109
  const ret = arg0.call(arg1);
354
110
  return ret;
355
- }, arguments) };
356
-
357
- export function __wbg_done_62ea16af4ce34b24(arg0) {
111
+ }, arguments); }
112
+ export function __wbg_call_a24592a6f349a97e() { return handleError(function (arg0, arg1, arg2) {
113
+ const ret = arg0.call(arg1, arg2);
114
+ return ret;
115
+ }, arguments); }
116
+ export function __wbg_done_9158f7cc8751ba32(arg0) {
358
117
  const ret = arg0.done;
359
118
  return ret;
360
- };
361
-
362
- export function __wbg_entries_83c79938054e065f(arg0) {
119
+ }
120
+ export function __wbg_entries_e0b73aa8571ddb56(arg0) {
363
121
  const ret = Object.entries(arg0);
364
122
  return ret;
365
- };
366
-
367
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
123
+ }
124
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
368
125
  let deferred0_0;
369
126
  let deferred0_1;
370
127
  try {
@@ -374,33 +131,31 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
374
131
  } finally {
375
132
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
376
133
  }
377
- };
378
-
379
- export function __wbg_fetch_0eb5958073b0f95e() { return handleError(function (arg0, arg1) {
134
+ }
135
+ export function __wbg_fetch_370716599db7c35e() { return handleError(function (arg0, arg1) {
380
136
  const ret = fetch(arg0, arg1);
381
137
  return ret;
382
- }, arguments) };
383
-
384
- export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
138
+ }, arguments); }
139
+ export function __wbg_getRandomValues_3f44b700395062e5() { return handleError(function (arg0, arg1) {
385
140
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
386
- }, arguments) };
387
-
388
- export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
141
+ }, arguments); }
142
+ export function __wbg_get_1affdbdd5573b16a() { return handleError(function (arg0, arg1) {
143
+ const ret = Reflect.get(arg0, arg1);
144
+ return ret;
145
+ }, arguments); }
146
+ export function __wbg_get_8360291721e2339f(arg0, arg1) {
389
147
  const ret = arg0[arg1 >>> 0];
390
148
  return ret;
391
- };
392
-
393
- export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
394
- const ret = Reflect.get(arg0, arg1);
149
+ }
150
+ export function __wbg_get_unchecked_17f53dad852b9588(arg0, arg1) {
151
+ const ret = arg0[arg1 >>> 0];
395
152
  return ret;
396
- }, arguments) };
397
-
398
- export function __wbg_headers_654c30e1bcccc552(arg0) {
153
+ }
154
+ export function __wbg_headers_6022deb4e576fb8e(arg0) {
399
155
  const ret = arg0.headers;
400
156
  return ret;
401
- };
402
-
403
- export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
157
+ }
158
+ export function __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3(arg0) {
404
159
  let result;
405
160
  try {
406
161
  result = arg0 instanceof ArrayBuffer;
@@ -409,9 +164,8 @@ export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
409
164
  }
410
165
  const ret = result;
411
166
  return ret;
412
- };
413
-
414
- export function __wbg_instanceof_Response_cd74d1c2ac92cb0b(arg0) {
167
+ }
168
+ export function __wbg_instanceof_Response_9b2d111407865ff2(arg0) {
415
169
  let result;
416
170
  try {
417
171
  result = arg0 instanceof Response;
@@ -420,9 +174,8 @@ export function __wbg_instanceof_Response_cd74d1c2ac92cb0b(arg0) {
420
174
  }
421
175
  const ret = result;
422
176
  return ret;
423
- };
424
-
425
- export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
177
+ }
178
+ export function __wbg_instanceof_Uint8Array_152ba1f289edcf3f(arg0) {
426
179
  let result;
427
180
  try {
428
181
  result = arg0 instanceof Uint8Array;
@@ -431,60 +184,54 @@ export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
431
184
  }
432
185
  const ret = result;
433
186
  return ret;
434
- };
435
-
436
- export function __wbg_iterator_27b7c8b35ab3e86b() {
187
+ }
188
+ export function __wbg_iterator_013bc09ec998c2a7() {
437
189
  const ret = Symbol.iterator;
438
190
  return ret;
439
- };
440
-
441
- export function __wbg_length_22ac23eaec9d8053(arg0) {
191
+ }
192
+ export function __wbg_length_3d4ecd04bd8d22f1(arg0) {
442
193
  const ret = arg0.length;
443
194
  return ret;
444
- };
445
-
446
- export function __wbg_length_d45040a40c570362(arg0) {
195
+ }
196
+ export function __wbg_length_9f1775224cf1d815(arg0) {
447
197
  const ret = arg0.length;
448
198
  return ret;
449
- };
450
-
451
- export function __wbg_log_1d990106d99dacb7(arg0) {
199
+ }
200
+ export function __wbg_log_7e1aa9064a1dbdbd(arg0) {
452
201
  console.log(arg0);
453
- };
454
-
455
- export function __wbg_new_1ba21ce319a06297() {
456
- const ret = new Object();
457
- return ret;
458
- };
459
-
460
- export function __wbg_new_25f239778d6112b9() {
461
- const ret = new Array();
462
- return ret;
463
- };
464
-
465
- export function __wbg_new_6421f6084cc5bc5a(arg0) {
202
+ }
203
+ export function __wbg_new_0c7403db6e782f19(arg0) {
466
204
  const ret = new Uint8Array(arg0);
467
205
  return ret;
468
- };
469
-
470
- export function __wbg_new_8a6f238a6ece86ea() {
206
+ }
207
+ export function __wbg_new_227d7c05414eb861() {
471
208
  const ret = new Error();
472
209
  return ret;
473
- };
474
-
475
- export function __wbg_new_b546ae120718850e() {
210
+ }
211
+ export function __wbg_new_34d45cc8e36aaead() {
476
212
  const ret = new Map();
477
213
  return ret;
478
- };
479
-
480
- export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
214
+ }
215
+ export function __wbg_new_682678e2f47e32bc() {
216
+ const ret = new Array();
217
+ return ret;
218
+ }
219
+ export function __wbg_new_aa8d0fa9762c29bd() {
220
+ const ret = new Object();
221
+ return ret;
222
+ }
223
+ export function __wbg_new_from_slice_b5ea43e23f6008c0(arg0, arg1) {
224
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
225
+ return ret;
226
+ }
227
+ export function __wbg_new_typed_323f37fd55ab048d(arg0, arg1) {
481
228
  try {
482
229
  var state0 = {a: arg0, b: arg1};
483
230
  var cb0 = (arg0, arg1) => {
484
231
  const a = state0.a;
485
232
  state0.a = 0;
486
233
  try {
487
- return wasm_bindgen__convert__closures_____invoke__h99ba0a2e80dc875e(a, state0.b, arg0, arg1);
234
+ return wasm_bindgen__convert__closures_____invoke__h09947889d53665a4(a, state0.b, arg0, arg1);
488
235
  } finally {
489
236
  state0.a = a;
490
237
  }
@@ -492,149 +239,113 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
492
239
  const ret = new Promise(cb0);
493
240
  return ret;
494
241
  } finally {
495
- state0.a = state0.b = 0;
242
+ state0.a = 0;
496
243
  }
497
- };
498
-
499
- export function __wbg_new_from_slice_f9c22b9153b26992(arg0, arg1) {
500
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
501
- return ret;
502
- };
503
-
504
- export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
505
- const ret = new Function(getStringFromWasm0(arg0, arg1));
244
+ }
245
+ export function __wbg_next_0340c4ae324393c3() { return handleError(function (arg0) {
246
+ const ret = arg0.next();
506
247
  return ret;
507
- };
508
-
509
- export function __wbg_next_138a17bbf04e926c(arg0) {
248
+ }, arguments); }
249
+ export function __wbg_next_7646edaa39458ef7(arg0) {
510
250
  const ret = arg0.next;
511
251
  return ret;
512
- };
513
-
514
- export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
515
- const ret = arg0.next();
516
- return ret;
517
- }, arguments) };
518
-
519
- export function __wbg_now_69d776cd24f5215b() {
252
+ }
253
+ export function __wbg_now_a9b7df1cbee90986() {
520
254
  const ret = Date.now();
521
255
  return ret;
522
- };
523
-
524
- export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
256
+ }
257
+ export function __wbg_prototypesetcall_a6b02eb00b0f4ce2(arg0, arg1, arg2) {
525
258
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
526
- };
527
-
528
- export function __wbg_queueMicrotask_9b549dfce8865860(arg0) {
259
+ }
260
+ export function __wbg_queueMicrotask_5d15a957e6aa920e(arg0) {
261
+ queueMicrotask(arg0);
262
+ }
263
+ export function __wbg_queueMicrotask_f8819e5ffc402f36(arg0) {
529
264
  const ret = arg0.queueMicrotask;
530
265
  return ret;
531
- };
532
-
533
- export function __wbg_queueMicrotask_fca69f5bfad613a5(arg0) {
534
- queueMicrotask(arg0);
535
- };
536
-
537
- export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
266
+ }
267
+ export function __wbg_resolve_e6c466bc1052f16c(arg0) {
538
268
  const ret = Promise.resolve(arg0);
539
269
  return ret;
540
- };
541
-
542
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
543
- arg0[arg1] = arg2;
544
- };
545
-
546
- export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
270
+ }
271
+ export function __wbg_set_3bf1de9fab0cd644(arg0, arg1, arg2) {
547
272
  arg0[arg1 >>> 0] = arg2;
548
- };
549
-
550
- export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
273
+ }
274
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
275
+ arg0[arg1] = arg2;
276
+ }
277
+ export function __wbg_set_fde2cec06c23692b(arg0, arg1, arg2) {
551
278
  const ret = arg0.set(arg1, arg2);
552
279
  return ret;
553
- };
554
-
555
- export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
280
+ }
281
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
556
282
  const ret = arg1.stack;
557
283
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
558
284
  const len1 = WASM_VECTOR_LEN;
559
285
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
560
286
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
561
- };
562
-
563
- export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
287
+ }
288
+ export function __wbg_static_accessor_GLOBAL_8cfadc87a297ca02() {
564
289
  const ret = typeof global === 'undefined' ? null : global;
565
290
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
566
- };
567
-
568
- export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
291
+ }
292
+ export function __wbg_static_accessor_GLOBAL_THIS_602256ae5c8f42cf() {
569
293
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
570
294
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
571
- };
572
-
573
- export function __wbg_static_accessor_SELF_08f5a74c69739274() {
295
+ }
296
+ export function __wbg_static_accessor_SELF_e445c1c7484aecc3() {
574
297
  const ret = typeof self === 'undefined' ? null : self;
575
298
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
576
- };
577
-
578
- export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
299
+ }
300
+ export function __wbg_static_accessor_WINDOW_f20e8576ef1e0f17() {
579
301
  const ret = typeof window === 'undefined' ? null : window;
580
302
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
581
- };
582
-
583
- export function __wbg_status_9bfc680efca4bdfd(arg0) {
303
+ }
304
+ export function __wbg_status_43e0d2f15b22d69f(arg0) {
584
305
  const ret = arg0.status;
585
306
  return ret;
586
- };
587
-
588
- export function __wbg_text_51046bb33d257f63() { return handleError(function (arg0) {
307
+ }
308
+ export function __wbg_text_595ef75535aa25c1() { return handleError(function (arg0) {
589
309
  const ret = arg0.text();
590
310
  return ret;
591
- }, arguments) };
592
-
593
- export function __wbg_then_429f7caf1026411d(arg0, arg1, arg2) {
311
+ }, arguments); }
312
+ export function __wbg_then_792e0c862b060889(arg0, arg1, arg2) {
594
313
  const ret = arg0.then(arg1, arg2);
595
314
  return ret;
596
- };
597
-
598
- export function __wbg_then_4f95312d68691235(arg0, arg1) {
315
+ }
316
+ export function __wbg_then_8e16ee11f05e4827(arg0, arg1) {
599
317
  const ret = arg0.then(arg1);
600
318
  return ret;
601
- };
602
-
603
- export function __wbg_value_57b7b035e117f7ee(arg0) {
319
+ }
320
+ export function __wbg_value_ee3a06f4579184fa(arg0) {
604
321
  const ret = arg0.value;
605
322
  return ret;
606
- };
607
-
608
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
609
- // Cast intrinsic for `Ref(String) -> Externref`.
610
- const ret = getStringFromWasm0(arg0, arg1);
611
- return ret;
612
- };
613
-
614
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
615
- // Cast intrinsic for `U64 -> Externref`.
616
- const ret = BigInt.asUintN(64, arg0);
323
+ }
324
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
325
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4781, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
326
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h799ee35745318780);
617
327
  return ret;
618
- };
619
-
620
- export function __wbindgen_cast_8456a9dd38081465(arg0, arg1) {
621
- // Cast intrinsic for `Closure(Closure { dtor_idx: 3649, function: Function { arguments: [Externref], shim_idx: 3638, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
622
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h78f7bf6209968402, wasm_bindgen__convert__closures_____invoke__hdf449a9872fb8032);
328
+ }
329
+ export function __wbindgen_cast_0000000000000002(arg0) {
330
+ // Cast intrinsic for `F64 -> Externref`.
331
+ const ret = arg0;
623
332
  return ret;
624
- };
625
-
626
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
333
+ }
334
+ export function __wbindgen_cast_0000000000000003(arg0) {
627
335
  // Cast intrinsic for `I64 -> Externref`.
628
336
  const ret = arg0;
629
337
  return ret;
630
- };
631
-
632
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
633
- // Cast intrinsic for `F64 -> Externref`.
634
- const ret = arg0;
338
+ }
339
+ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
340
+ // Cast intrinsic for `Ref(String) -> Externref`.
341
+ const ret = getStringFromWasm0(arg0, arg1);
635
342
  return ret;
636
- };
637
-
343
+ }
344
+ export function __wbindgen_cast_0000000000000005(arg0) {
345
+ // Cast intrinsic for `U64 -> Externref`.
346
+ const ret = BigInt.asUintN(64, arg0);
347
+ return ret;
348
+ }
638
349
  export function __wbindgen_init_externref_table() {
639
350
  const table = wasm.__wbindgen_externrefs;
640
351
  const offset = table.grow(4);
@@ -643,4 +354,238 @@ export function __wbindgen_init_externref_table() {
643
354
  table.set(offset + 1, null);
644
355
  table.set(offset + 2, true);
645
356
  table.set(offset + 3, false);
646
- };
357
+ }
358
+ function wasm_bindgen__convert__closures_____invoke__h799ee35745318780(arg0, arg1, arg2) {
359
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h799ee35745318780(arg0, arg1, arg2);
360
+ if (ret[1]) {
361
+ throw takeFromExternrefTable0(ret[0]);
362
+ }
363
+ }
364
+
365
+ function wasm_bindgen__convert__closures_____invoke__h09947889d53665a4(arg0, arg1, arg2, arg3) {
366
+ wasm.wasm_bindgen__convert__closures_____invoke__h09947889d53665a4(arg0, arg1, arg2, arg3);
367
+ }
368
+
369
+ const WasmLspFinalization = (typeof FinalizationRegistry === 'undefined')
370
+ ? { register: () => {}, unregister: () => {} }
371
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmlsp_free(ptr >>> 0, 1));
372
+
373
+ function addToExternrefTable0(obj) {
374
+ const idx = wasm.__externref_table_alloc();
375
+ wasm.__wbindgen_externrefs.set(idx, obj);
376
+ return idx;
377
+ }
378
+
379
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
380
+ ? { register: () => {}, unregister: () => {} }
381
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
382
+
383
+ function debugString(val) {
384
+ // primitive types
385
+ const type = typeof val;
386
+ if (type == 'number' || type == 'boolean' || val == null) {
387
+ return `${val}`;
388
+ }
389
+ if (type == 'string') {
390
+ return `"${val}"`;
391
+ }
392
+ if (type == 'symbol') {
393
+ const description = val.description;
394
+ if (description == null) {
395
+ return 'Symbol';
396
+ } else {
397
+ return `Symbol(${description})`;
398
+ }
399
+ }
400
+ if (type == 'function') {
401
+ const name = val.name;
402
+ if (typeof name == 'string' && name.length > 0) {
403
+ return `Function(${name})`;
404
+ } else {
405
+ return 'Function';
406
+ }
407
+ }
408
+ // objects
409
+ if (Array.isArray(val)) {
410
+ const length = val.length;
411
+ let debug = '[';
412
+ if (length > 0) {
413
+ debug += debugString(val[0]);
414
+ }
415
+ for(let i = 1; i < length; i++) {
416
+ debug += ', ' + debugString(val[i]);
417
+ }
418
+ debug += ']';
419
+ return debug;
420
+ }
421
+ // Test for built-in
422
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
423
+ let className;
424
+ if (builtInMatches && builtInMatches.length > 1) {
425
+ className = builtInMatches[1];
426
+ } else {
427
+ // Failed to match the standard '[object ClassName]'
428
+ return toString.call(val);
429
+ }
430
+ if (className == 'Object') {
431
+ // we're a user defined class or Object
432
+ // JSON.stringify avoids problems with cycles, and is generally much
433
+ // easier than looping through ownProperties of `val`.
434
+ try {
435
+ return 'Object(' + JSON.stringify(val) + ')';
436
+ } catch (_) {
437
+ return 'Object';
438
+ }
439
+ }
440
+ // errors
441
+ if (val instanceof Error) {
442
+ return `${val.name}: ${val.message}\n${val.stack}`;
443
+ }
444
+ // TODO we could test for more things here, like `Set`s and `Map`s.
445
+ return className;
446
+ }
447
+
448
+ function getArrayU8FromWasm0(ptr, len) {
449
+ ptr = ptr >>> 0;
450
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
451
+ }
452
+
453
+ let cachedDataViewMemory0 = null;
454
+ function getDataViewMemory0() {
455
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
456
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
457
+ }
458
+ return cachedDataViewMemory0;
459
+ }
460
+
461
+ function getStringFromWasm0(ptr, len) {
462
+ ptr = ptr >>> 0;
463
+ return decodeText(ptr, len);
464
+ }
465
+
466
+ let cachedUint8ArrayMemory0 = null;
467
+ function getUint8ArrayMemory0() {
468
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
469
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
470
+ }
471
+ return cachedUint8ArrayMemory0;
472
+ }
473
+
474
+ function handleError(f, args) {
475
+ try {
476
+ return f.apply(this, args);
477
+ } catch (e) {
478
+ const idx = addToExternrefTable0(e);
479
+ wasm.__wbindgen_exn_store(idx);
480
+ }
481
+ }
482
+
483
+ function isLikeNone(x) {
484
+ return x === undefined || x === null;
485
+ }
486
+
487
+ function makeMutClosure(arg0, arg1, f) {
488
+ const state = { a: arg0, b: arg1, cnt: 1 };
489
+ const real = (...args) => {
490
+
491
+ // First up with a closure we increment the internal reference
492
+ // count. This ensures that the Rust closure environment won't
493
+ // be deallocated while we're invoking it.
494
+ state.cnt++;
495
+ const a = state.a;
496
+ state.a = 0;
497
+ try {
498
+ return f(a, state.b, ...args);
499
+ } finally {
500
+ state.a = a;
501
+ real._wbg_cb_unref();
502
+ }
503
+ };
504
+ real._wbg_cb_unref = () => {
505
+ if (--state.cnt === 0) {
506
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
507
+ state.a = 0;
508
+ CLOSURE_DTORS.unregister(state);
509
+ }
510
+ };
511
+ CLOSURE_DTORS.register(real, state, state);
512
+ return real;
513
+ }
514
+
515
+ function passStringToWasm0(arg, malloc, realloc) {
516
+ if (realloc === undefined) {
517
+ const buf = cachedTextEncoder.encode(arg);
518
+ const ptr = malloc(buf.length, 1) >>> 0;
519
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
520
+ WASM_VECTOR_LEN = buf.length;
521
+ return ptr;
522
+ }
523
+
524
+ let len = arg.length;
525
+ let ptr = malloc(len, 1) >>> 0;
526
+
527
+ const mem = getUint8ArrayMemory0();
528
+
529
+ let offset = 0;
530
+
531
+ for (; offset < len; offset++) {
532
+ const code = arg.charCodeAt(offset);
533
+ if (code > 0x7F) break;
534
+ mem[ptr + offset] = code;
535
+ }
536
+ if (offset !== len) {
537
+ if (offset !== 0) {
538
+ arg = arg.slice(offset);
539
+ }
540
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
541
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
542
+ const ret = cachedTextEncoder.encodeInto(arg, view);
543
+
544
+ offset += ret.written;
545
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
546
+ }
547
+
548
+ WASM_VECTOR_LEN = offset;
549
+ return ptr;
550
+ }
551
+
552
+ function takeFromExternrefTable0(idx) {
553
+ const value = wasm.__wbindgen_externrefs.get(idx);
554
+ wasm.__externref_table_dealloc(idx);
555
+ return value;
556
+ }
557
+
558
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
559
+ cachedTextDecoder.decode();
560
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
561
+ let numBytesDecoded = 0;
562
+ function decodeText(ptr, len) {
563
+ numBytesDecoded += len;
564
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
565
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
566
+ cachedTextDecoder.decode();
567
+ numBytesDecoded = len;
568
+ }
569
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
570
+ }
571
+
572
+ const cachedTextEncoder = new TextEncoder();
573
+
574
+ if (!('encodeInto' in cachedTextEncoder)) {
575
+ cachedTextEncoder.encodeInto = function (arg, view) {
576
+ const buf = cachedTextEncoder.encode(arg);
577
+ view.set(buf);
578
+ return {
579
+ read: arg.length,
580
+ written: buf.length
581
+ };
582
+ };
583
+ }
584
+
585
+ let WASM_VECTOR_LEN = 0;
586
+
587
+
588
+ let wasm;
589
+ export function __wbg_set_wasm(val) {
590
+ wasm = val;
591
+ }
package/swls_wasm_bg.wasm CHANGED
Binary file