qsharp-lang 1.0.28-dev → 1.0.29-dev
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/dist/browser.d.ts +7 -1
- package/dist/browser.js +6 -2
- package/dist/compiler/compiler.d.ts +6 -6
- package/dist/compiler/compiler.js +16 -8
- package/dist/debug-service/debug-service.d.ts +2 -2
- package/dist/debug-service/debug-service.js +5 -3
- package/dist/language-service/language-service.d.ts +7 -2
- package/dist/language-service/language-service.js +48 -30
- package/dist/main.d.ts +7 -1
- package/dist/main.js +11 -2
- package/lib/node/qsc_wasm.cjs +248 -96
- package/lib/node/qsc_wasm.d.cts +39 -12
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +51 -16
- package/lib/web/qsc_wasm.js +235 -93
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/ux/index.ts +1 -1
- package/ux/reTable.tsx +1 -0
- package/ux/resultsTable.tsx +40 -5
package/lib/node/qsc_wasm.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
-
const {
|
|
4
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
5
5
|
|
|
6
6
|
const heap = new Array(128).fill(undefined);
|
|
7
7
|
|
|
@@ -9,32 +9,7 @@ heap.push(undefined, null, true, false);
|
|
|
9
9
|
|
|
10
10
|
function getObject(idx) { return heap[idx]; }
|
|
11
11
|
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
function dropObject(idx) {
|
|
15
|
-
if (idx < 132) return;
|
|
16
|
-
heap[idx] = heap_next;
|
|
17
|
-
heap_next = idx;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function takeObject(idx) {
|
|
21
|
-
const ret = getObject(idx);
|
|
22
|
-
dropObject(idx);
|
|
23
|
-
return ret;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function addHeapObject(obj) {
|
|
27
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
28
|
-
const idx = heap_next;
|
|
29
|
-
heap_next = heap[idx];
|
|
30
|
-
|
|
31
|
-
heap[idx] = obj;
|
|
32
|
-
return idx;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
36
|
-
|
|
37
|
-
cachedTextDecoder.decode();
|
|
12
|
+
let WASM_VECTOR_LEN = 0;
|
|
38
13
|
|
|
39
14
|
let cachedUint8Memory0 = null;
|
|
40
15
|
|
|
@@ -45,13 +20,6 @@ function getUint8Memory0() {
|
|
|
45
20
|
return cachedUint8Memory0;
|
|
46
21
|
}
|
|
47
22
|
|
|
48
|
-
function getStringFromWasm0(ptr, len) {
|
|
49
|
-
ptr = ptr >>> 0;
|
|
50
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
let WASM_VECTOR_LEN = 0;
|
|
54
|
-
|
|
55
23
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
56
24
|
|
|
57
25
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -127,6 +95,38 @@ function getFloat64Memory0() {
|
|
|
127
95
|
return cachedFloat64Memory0;
|
|
128
96
|
}
|
|
129
97
|
|
|
98
|
+
let heap_next = heap.length;
|
|
99
|
+
|
|
100
|
+
function dropObject(idx) {
|
|
101
|
+
if (idx < 132) return;
|
|
102
|
+
heap[idx] = heap_next;
|
|
103
|
+
heap_next = idx;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function takeObject(idx) {
|
|
107
|
+
const ret = getObject(idx);
|
|
108
|
+
dropObject(idx);
|
|
109
|
+
return ret;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function addHeapObject(obj) {
|
|
113
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
114
|
+
const idx = heap_next;
|
|
115
|
+
heap_next = heap[idx];
|
|
116
|
+
|
|
117
|
+
heap[idx] = obj;
|
|
118
|
+
return idx;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
122
|
+
|
|
123
|
+
cachedTextDecoder.decode();
|
|
124
|
+
|
|
125
|
+
function getStringFromWasm0(ptr, len) {
|
|
126
|
+
ptr = ptr >>> 0;
|
|
127
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
130
|
function debugString(val) {
|
|
131
131
|
// primitive types
|
|
132
132
|
const type = typeof val;
|
|
@@ -192,12 +192,32 @@ function debugString(val) {
|
|
|
192
192
|
return className;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
196
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
197
|
+
const real = (...args) => {
|
|
198
|
+
// First up with a closure we increment the internal reference
|
|
199
|
+
// count. This ensures that the Rust closure environment won't
|
|
200
|
+
// be deallocated while we're invoking it.
|
|
201
|
+
state.cnt++;
|
|
202
|
+
const a = state.a;
|
|
203
|
+
state.a = 0;
|
|
204
|
+
try {
|
|
205
|
+
return f(a, state.b, ...args);
|
|
206
|
+
} finally {
|
|
207
|
+
if (--state.cnt === 0) {
|
|
208
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
196
209
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
} else {
|
|
211
|
+
state.a = a;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
real.original = state;
|
|
216
|
+
|
|
217
|
+
return real;
|
|
218
|
+
}
|
|
219
|
+
function __wbg_adapter_44(arg0, arg1, arg2) {
|
|
220
|
+
wasm.__wbindgen_export_3(arg0, arg1, addHeapObject(arg2));
|
|
201
221
|
}
|
|
202
222
|
|
|
203
223
|
let cachedUint32Memory0 = null;
|
|
@@ -209,13 +229,6 @@ function getUint32Memory0() {
|
|
|
209
229
|
return cachedUint32Memory0;
|
|
210
230
|
}
|
|
211
231
|
|
|
212
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
213
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
214
|
-
getUint32Memory0().set(arg, ptr / 4);
|
|
215
|
-
WASM_VECTOR_LEN = arg.length;
|
|
216
|
-
return ptr;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
232
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
220
233
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
221
234
|
const mem = getUint32Memory0();
|
|
@@ -226,6 +239,21 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
226
239
|
return ptr;
|
|
227
240
|
}
|
|
228
241
|
|
|
242
|
+
let stack_pointer = 128;
|
|
243
|
+
|
|
244
|
+
function addBorrowedObject(obj) {
|
|
245
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
246
|
+
heap[--stack_pointer] = obj;
|
|
247
|
+
return stack_pointer;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
251
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
252
|
+
getUint32Memory0().set(arg, ptr / 4);
|
|
253
|
+
WASM_VECTOR_LEN = arg.length;
|
|
254
|
+
return ptr;
|
|
255
|
+
}
|
|
256
|
+
|
|
229
257
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
230
258
|
ptr = ptr >>> 0;
|
|
231
259
|
const mem = getUint32Memory0();
|
|
@@ -277,20 +305,20 @@ module.exports.git_hash = function() {
|
|
|
277
305
|
return getStringFromWasm0(r0, r1);
|
|
278
306
|
} finally {
|
|
279
307
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
280
|
-
wasm.
|
|
308
|
+
wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
|
|
281
309
|
}
|
|
282
310
|
};
|
|
283
311
|
|
|
284
312
|
/**
|
|
285
|
-
* @param {
|
|
313
|
+
* @param {(Array<any>)[]} sources
|
|
286
314
|
* @returns {string}
|
|
287
315
|
*/
|
|
288
|
-
module.exports.get_qir = function(
|
|
316
|
+
module.exports.get_qir = function(sources) {
|
|
289
317
|
let deferred3_0;
|
|
290
318
|
let deferred3_1;
|
|
291
319
|
try {
|
|
292
320
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
-
const ptr0 =
|
|
321
|
+
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
294
322
|
const len0 = WASM_VECTOR_LEN;
|
|
295
323
|
wasm.get_qir(retptr, ptr0, len0);
|
|
296
324
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
@@ -308,21 +336,21 @@ module.exports.get_qir = function(code) {
|
|
|
308
336
|
return getStringFromWasm0(ptr2, len2);
|
|
309
337
|
} finally {
|
|
310
338
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
311
|
-
wasm.
|
|
339
|
+
wasm.__wbindgen_export_4(deferred3_0, deferred3_1, 1);
|
|
312
340
|
}
|
|
313
341
|
};
|
|
314
342
|
|
|
315
343
|
/**
|
|
316
|
-
* @param {
|
|
344
|
+
* @param {(Array<any>)[]} sources
|
|
317
345
|
* @param {string} params
|
|
318
346
|
* @returns {string}
|
|
319
347
|
*/
|
|
320
|
-
module.exports.get_estimates = function(
|
|
348
|
+
module.exports.get_estimates = function(sources, params) {
|
|
321
349
|
let deferred4_0;
|
|
322
350
|
let deferred4_1;
|
|
323
351
|
try {
|
|
324
352
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
325
|
-
const ptr0 =
|
|
353
|
+
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
326
354
|
const len0 = WASM_VECTOR_LEN;
|
|
327
355
|
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
328
356
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -342,7 +370,7 @@ module.exports.get_estimates = function(code, params) {
|
|
|
342
370
|
return getStringFromWasm0(ptr3, len3);
|
|
343
371
|
} finally {
|
|
344
372
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
345
|
-
wasm.
|
|
373
|
+
wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
|
|
346
374
|
}
|
|
347
375
|
};
|
|
348
376
|
|
|
@@ -361,7 +389,7 @@ module.exports.get_library_source_content = function(name) {
|
|
|
361
389
|
let v2;
|
|
362
390
|
if (r0 !== 0) {
|
|
363
391
|
v2 = getStringFromWasm0(r0, r1).slice();
|
|
364
|
-
wasm.
|
|
392
|
+
wasm.__wbindgen_export_4(r0, r1 * 1);
|
|
365
393
|
}
|
|
366
394
|
return v2;
|
|
367
395
|
} finally {
|
|
@@ -388,21 +416,21 @@ module.exports.get_hir = function(code) {
|
|
|
388
416
|
return getStringFromWasm0(r0, r1);
|
|
389
417
|
} finally {
|
|
390
418
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
391
|
-
wasm.
|
|
419
|
+
wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
|
|
392
420
|
}
|
|
393
421
|
};
|
|
394
422
|
|
|
395
423
|
/**
|
|
396
|
-
* @param {
|
|
424
|
+
* @param {(Array<any>)[]} sources
|
|
397
425
|
* @param {string} expr
|
|
398
426
|
* @param {Function} event_cb
|
|
399
427
|
* @param {number} shots
|
|
400
428
|
* @returns {boolean}
|
|
401
429
|
*/
|
|
402
|
-
module.exports.run = function(
|
|
430
|
+
module.exports.run = function(sources, expr, event_cb, shots) {
|
|
403
431
|
try {
|
|
404
432
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
405
|
-
const ptr0 =
|
|
433
|
+
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
406
434
|
const len0 = WASM_VECTOR_LEN;
|
|
407
435
|
const ptr1 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
408
436
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -441,9 +469,13 @@ function handleError(f, args) {
|
|
|
441
469
|
try {
|
|
442
470
|
return f.apply(this, args);
|
|
443
471
|
} catch (e) {
|
|
444
|
-
wasm.
|
|
472
|
+
wasm.__wbindgen_export_5(addHeapObject(e));
|
|
445
473
|
}
|
|
446
474
|
}
|
|
475
|
+
function __wbg_adapter_145(arg0, arg1, arg2, arg3) {
|
|
476
|
+
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
477
|
+
}
|
|
478
|
+
|
|
447
479
|
/**
|
|
448
480
|
*/
|
|
449
481
|
module.exports.StepResultId = Object.freeze({ BreakpointHit:0,"0":"BreakpointHit",Next:1,"1":"Next",StepIn:2,"2":"StepIn",StepOut:3,"3":"StepOut",Return:4,"4":"Return", });
|
|
@@ -477,34 +509,31 @@ class DebugService {
|
|
|
477
509
|
return DebugService.__wrap(ret);
|
|
478
510
|
}
|
|
479
511
|
/**
|
|
480
|
-
* @param {
|
|
481
|
-
* @param {string} source
|
|
512
|
+
* @param {(Array<any>)[]} sources
|
|
482
513
|
* @param {string} target_profile
|
|
483
514
|
* @param {string | undefined} entry
|
|
484
515
|
* @returns {string}
|
|
485
516
|
*/
|
|
486
|
-
load_source(
|
|
487
|
-
let
|
|
488
|
-
let
|
|
517
|
+
load_source(sources, target_profile, entry) {
|
|
518
|
+
let deferred4_0;
|
|
519
|
+
let deferred4_1;
|
|
489
520
|
try {
|
|
490
521
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
491
|
-
const ptr0 =
|
|
522
|
+
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
492
523
|
const len0 = WASM_VECTOR_LEN;
|
|
493
|
-
const ptr1 = passStringToWasm0(
|
|
524
|
+
const ptr1 = passStringToWasm0(target_profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
494
525
|
const len1 = WASM_VECTOR_LEN;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
var len3 = WASM_VECTOR_LEN;
|
|
499
|
-
wasm.debugservice_load_source(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
526
|
+
var ptr2 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
527
|
+
var len2 = WASM_VECTOR_LEN;
|
|
528
|
+
wasm.debugservice_load_source(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
500
529
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
501
530
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
502
|
-
|
|
503
|
-
|
|
531
|
+
deferred4_0 = r0;
|
|
532
|
+
deferred4_1 = r1;
|
|
504
533
|
return getStringFromWasm0(r0, r1);
|
|
505
534
|
} finally {
|
|
506
535
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
507
|
-
wasm.
|
|
536
|
+
wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
|
|
508
537
|
}
|
|
509
538
|
}
|
|
510
539
|
/**
|
|
@@ -656,13 +685,28 @@ class LanguageService {
|
|
|
656
685
|
wasm.__wbg_languageservice_free(ptr);
|
|
657
686
|
}
|
|
658
687
|
/**
|
|
659
|
-
* @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
|
|
660
688
|
*/
|
|
661
|
-
constructor(
|
|
662
|
-
const ret = wasm.languageservice_new(
|
|
689
|
+
constructor() {
|
|
690
|
+
const ret = wasm.languageservice_new();
|
|
663
691
|
return LanguageService.__wrap(ret);
|
|
664
692
|
}
|
|
665
693
|
/**
|
|
694
|
+
* @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
|
|
695
|
+
* @param {(uri: string) => Promise<string | null>} read_file
|
|
696
|
+
* @param {(uri: string) => Promise<[string, number][]>} list_directory
|
|
697
|
+
* @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
|
|
698
|
+
* @returns {Promise<any>}
|
|
699
|
+
*/
|
|
700
|
+
start_background_work(diagnostics_callback, read_file, list_directory, get_manifest) {
|
|
701
|
+
const ret = wasm.languageservice_start_background_work(this.__wbg_ptr, addHeapObject(diagnostics_callback), addHeapObject(read_file), addHeapObject(list_directory), addHeapObject(get_manifest));
|
|
702
|
+
return takeObject(ret);
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
*/
|
|
706
|
+
stop_background_work() {
|
|
707
|
+
wasm.languageservice_stop_background_work(this.__wbg_ptr);
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
666
710
|
* @param {IWorkspaceConfiguration} config
|
|
667
711
|
*/
|
|
668
712
|
update_configuration(config) {
|
|
@@ -748,7 +792,7 @@ class LanguageService {
|
|
|
748
792
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
749
793
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
750
794
|
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
751
|
-
wasm.
|
|
795
|
+
wasm.__wbindgen_export_4(r0, r1 * 4);
|
|
752
796
|
return v2;
|
|
753
797
|
} finally {
|
|
754
798
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -803,11 +847,81 @@ class LanguageService {
|
|
|
803
847
|
}
|
|
804
848
|
}
|
|
805
849
|
module.exports.LanguageService = LanguageService;
|
|
850
|
+
/**
|
|
851
|
+
* a minimal implementation for interacting with async JS filesystem callbacks to
|
|
852
|
+
* load project files
|
|
853
|
+
*/
|
|
854
|
+
class ProjectLoader {
|
|
855
|
+
|
|
856
|
+
static __wrap(ptr) {
|
|
857
|
+
ptr = ptr >>> 0;
|
|
858
|
+
const obj = Object.create(ProjectLoader.prototype);
|
|
859
|
+
obj.__wbg_ptr = ptr;
|
|
860
|
+
|
|
861
|
+
return obj;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
__destroy_into_raw() {
|
|
865
|
+
const ptr = this.__wbg_ptr;
|
|
866
|
+
this.__wbg_ptr = 0;
|
|
867
|
+
|
|
868
|
+
return ptr;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
free() {
|
|
872
|
+
const ptr = this.__destroy_into_raw();
|
|
873
|
+
wasm.__wbg_projectloader_free(ptr);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* @param {(uri: string) => Promise<string | null>} read_file
|
|
877
|
+
* @param {(uri: string) => Promise<[string, number][]>} list_directory
|
|
878
|
+
* @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
|
|
879
|
+
*/
|
|
880
|
+
constructor(read_file, list_directory, get_manifest) {
|
|
881
|
+
const ret = wasm.projectloader_new(addHeapObject(read_file), addHeapObject(list_directory), addHeapObject(get_manifest));
|
|
882
|
+
return ProjectLoader.__wrap(ret);
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* @param {{ manifestDirectory: string }} manifest
|
|
886
|
+
* @returns {Promise<[string, string][]>}
|
|
887
|
+
*/
|
|
888
|
+
load_project(manifest) {
|
|
889
|
+
const ret = wasm.projectloader_load_project(this.__wbg_ptr, addHeapObject(manifest));
|
|
890
|
+
return takeObject(ret);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
module.exports.ProjectLoader = ProjectLoader;
|
|
894
|
+
|
|
895
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
896
|
+
const obj = getObject(arg1);
|
|
897
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
898
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
899
|
+
var len1 = WASM_VECTOR_LEN;
|
|
900
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
901
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
905
|
+
const obj = getObject(arg1);
|
|
906
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
907
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
908
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
909
|
+
};
|
|
806
910
|
|
|
807
911
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
808
912
|
takeObject(arg0);
|
|
809
913
|
};
|
|
810
914
|
|
|
915
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
916
|
+
const obj = takeObject(arg0).original;
|
|
917
|
+
if (obj.cnt-- == 1) {
|
|
918
|
+
obj.a = 0;
|
|
919
|
+
return true;
|
|
920
|
+
}
|
|
921
|
+
const ret = false;
|
|
922
|
+
return ret;
|
|
923
|
+
};
|
|
924
|
+
|
|
811
925
|
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
812
926
|
const ret = BigInt.asUintN(64, arg0);
|
|
813
927
|
return addHeapObject(ret);
|
|
@@ -834,15 +948,6 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
|
834
948
|
return ret;
|
|
835
949
|
};
|
|
836
950
|
|
|
837
|
-
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
838
|
-
const obj = getObject(arg1);
|
|
839
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
840
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
841
|
-
var len1 = WASM_VECTOR_LEN;
|
|
842
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
843
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
844
|
-
};
|
|
845
|
-
|
|
846
951
|
module.exports.__wbindgen_number_new = function(arg0) {
|
|
847
952
|
const ret = arg0;
|
|
848
953
|
return addHeapObject(ret);
|
|
@@ -866,11 +971,21 @@ module.exports.__wbg_stack_3090cd8fd3702c6e = function(arg0, arg1) {
|
|
|
866
971
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
867
972
|
};
|
|
868
973
|
|
|
974
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
975
|
+
const ret = getObject(arg0) === null;
|
|
976
|
+
return ret;
|
|
977
|
+
};
|
|
978
|
+
|
|
869
979
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
870
980
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
871
981
|
return ret;
|
|
872
982
|
};
|
|
873
983
|
|
|
984
|
+
module.exports.__wbindgen_typeof = function(arg0) {
|
|
985
|
+
const ret = typeof getObject(arg0);
|
|
986
|
+
return addHeapObject(ret);
|
|
987
|
+
};
|
|
988
|
+
|
|
874
989
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
875
990
|
const ret = getObject(arg0);
|
|
876
991
|
return addHeapObject(ret);
|
|
@@ -887,13 +1002,6 @@ module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
|
887
1002
|
return ret;
|
|
888
1003
|
};
|
|
889
1004
|
|
|
890
|
-
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
891
|
-
const obj = getObject(arg1);
|
|
892
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
893
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
894
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
895
|
-
};
|
|
896
|
-
|
|
897
1005
|
module.exports.__wbg_getwithrefkey_d1f0d12f1f1b63ea = function(arg0, arg1) {
|
|
898
1006
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
899
1007
|
return addHeapObject(ret);
|
|
@@ -1015,6 +1123,11 @@ module.exports.__wbg_isArray_4c24b343cb13cfb1 = function(arg0) {
|
|
|
1015
1123
|
return ret;
|
|
1016
1124
|
};
|
|
1017
1125
|
|
|
1126
|
+
module.exports.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
|
|
1127
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
1128
|
+
return ret;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1018
1131
|
module.exports.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
|
|
1019
1132
|
let result;
|
|
1020
1133
|
try {
|
|
@@ -1046,6 +1159,40 @@ module.exports.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
|
1046
1159
|
return addHeapObject(ret);
|
|
1047
1160
|
};
|
|
1048
1161
|
|
|
1162
|
+
module.exports.__wbg_new_43f1b47c28813cbd = function(arg0, arg1) {
|
|
1163
|
+
try {
|
|
1164
|
+
var state0 = {a: arg0, b: arg1};
|
|
1165
|
+
var cb0 = (arg0, arg1) => {
|
|
1166
|
+
const a = state0.a;
|
|
1167
|
+
state0.a = 0;
|
|
1168
|
+
try {
|
|
1169
|
+
return __wbg_adapter_145(a, state0.b, arg0, arg1);
|
|
1170
|
+
} finally {
|
|
1171
|
+
state0.a = a;
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
const ret = new Promise(cb0);
|
|
1175
|
+
return addHeapObject(ret);
|
|
1176
|
+
} finally {
|
|
1177
|
+
state0.a = state0.b = 0;
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
module.exports.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) {
|
|
1182
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
1183
|
+
return addHeapObject(ret);
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
module.exports.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) {
|
|
1187
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
1188
|
+
return addHeapObject(ret);
|
|
1189
|
+
};
|
|
1190
|
+
|
|
1191
|
+
module.exports.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) {
|
|
1192
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1193
|
+
return addHeapObject(ret);
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1049
1196
|
module.exports.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
|
|
1050
1197
|
const ret = self.self;
|
|
1051
1198
|
return addHeapObject(ret);
|
|
@@ -1123,6 +1270,11 @@ module.exports.__wbindgen_memory = function() {
|
|
|
1123
1270
|
return addHeapObject(ret);
|
|
1124
1271
|
};
|
|
1125
1272
|
|
|
1273
|
+
module.exports.__wbindgen_closure_wrapper536 = function(arg0, arg1, arg2) {
|
|
1274
|
+
const ret = makeMutClosure(arg0, arg1, 156, __wbg_adapter_44);
|
|
1275
|
+
return addHeapObject(ret);
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1126
1278
|
const path = require('path').join(__dirname, 'qsc_wasm_bg.wasm');
|
|
1127
1279
|
const bytes = require('fs').readFileSync(path);
|
|
1128
1280
|
|
package/lib/node/qsc_wasm.d.cts
CHANGED
|
@@ -14,16 +14,16 @@ export function setLogLevel(level: number): void;
|
|
|
14
14
|
*/
|
|
15
15
|
export function git_hash(): string;
|
|
16
16
|
/**
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {(Array<any>)[]} sources
|
|
18
18
|
* @returns {string}
|
|
19
19
|
*/
|
|
20
|
-
export function get_qir(
|
|
20
|
+
export function get_qir(sources: (Array<any>)[]): string;
|
|
21
21
|
/**
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {(Array<any>)[]} sources
|
|
23
23
|
* @param {string} params
|
|
24
24
|
* @returns {string}
|
|
25
25
|
*/
|
|
26
|
-
export function get_estimates(
|
|
26
|
+
export function get_estimates(sources: (Array<any>)[], params: string): string;
|
|
27
27
|
/**
|
|
28
28
|
* @param {string} name
|
|
29
29
|
* @returns {string | undefined}
|
|
@@ -35,13 +35,13 @@ export function get_library_source_content(name: string): string | undefined;
|
|
|
35
35
|
*/
|
|
36
36
|
export function get_hir(code: string): string;
|
|
37
37
|
/**
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {(Array<any>)[]} sources
|
|
39
39
|
* @param {string} expr
|
|
40
40
|
* @param {Function} event_cb
|
|
41
41
|
* @param {number} shots
|
|
42
42
|
* @returns {boolean}
|
|
43
43
|
*/
|
|
44
|
-
export function run(
|
|
44
|
+
export function run(sources: (Array<any>)[], expr: string, event_cb: Function, shots: number): boolean;
|
|
45
45
|
/**
|
|
46
46
|
* @param {string} solution_code
|
|
47
47
|
* @param {any} exercise_sources_js
|
|
@@ -173,13 +173,13 @@ export interface ISignatureHelp {
|
|
|
173
173
|
|
|
174
174
|
export interface ISignatureInformation {
|
|
175
175
|
label: string;
|
|
176
|
-
documentation
|
|
176
|
+
documentation: string;
|
|
177
177
|
parameters: IParameterInformation[];
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export interface IParameterInformation {
|
|
181
181
|
label: ISpan;
|
|
182
|
-
documentation
|
|
182
|
+
documentation: string;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
export interface IWorkspaceEdit {
|
|
@@ -213,13 +213,12 @@ export class DebugService {
|
|
|
213
213
|
*/
|
|
214
214
|
constructor();
|
|
215
215
|
/**
|
|
216
|
-
* @param {
|
|
217
|
-
* @param {string} source
|
|
216
|
+
* @param {(Array<any>)[]} sources
|
|
218
217
|
* @param {string} target_profile
|
|
219
218
|
* @param {string | undefined} entry
|
|
220
219
|
* @returns {string}
|
|
221
220
|
*/
|
|
222
|
-
load_source(
|
|
221
|
+
load_source(sources: (Array<any>)[], target_profile: string, entry?: string): string;
|
|
223
222
|
/**
|
|
224
223
|
* @returns {IQuantumStateList}
|
|
225
224
|
*/
|
|
@@ -267,9 +266,19 @@ export class DebugService {
|
|
|
267
266
|
export class LanguageService {
|
|
268
267
|
free(): void;
|
|
269
268
|
/**
|
|
269
|
+
*/
|
|
270
|
+
constructor();
|
|
271
|
+
/**
|
|
270
272
|
* @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
|
|
273
|
+
* @param {(uri: string) => Promise<string | null>} read_file
|
|
274
|
+
* @param {(uri: string) => Promise<[string, number][]>} list_directory
|
|
275
|
+
* @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
|
|
276
|
+
* @returns {Promise<any>}
|
|
277
|
+
*/
|
|
278
|
+
start_background_work(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void, read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>): Promise<any>;
|
|
279
|
+
/**
|
|
271
280
|
*/
|
|
272
|
-
|
|
281
|
+
stop_background_work(): void;
|
|
273
282
|
/**
|
|
274
283
|
* @param {IWorkspaceConfiguration} config
|
|
275
284
|
*/
|
|
@@ -340,3 +349,21 @@ export class LanguageService {
|
|
|
340
349
|
*/
|
|
341
350
|
prepare_rename(uri: string, offset: number): ITextEdit | undefined;
|
|
342
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* a minimal implementation for interacting with async JS filesystem callbacks to
|
|
354
|
+
* load project files
|
|
355
|
+
*/
|
|
356
|
+
export class ProjectLoader {
|
|
357
|
+
free(): void;
|
|
358
|
+
/**
|
|
359
|
+
* @param {(uri: string) => Promise<string | null>} read_file
|
|
360
|
+
* @param {(uri: string) => Promise<[string, number][]>} list_directory
|
|
361
|
+
* @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
|
|
362
|
+
*/
|
|
363
|
+
constructor(read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>);
|
|
364
|
+
/**
|
|
365
|
+
* @param {{ manifestDirectory: string }} manifest
|
|
366
|
+
* @returns {Promise<[string, string][]>}
|
|
367
|
+
*/
|
|
368
|
+
load_project(manifest: { manifestDirectory: string }): Promise<[string, string][]>;
|
|
369
|
+
}
|
|
Binary file
|