qsharp-lang 1.0.28-dev → 1.0.30-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.
@@ -1,7 +1,7 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
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 heap_next = heap.length;
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
- let stack_pointer = 128;
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
- function addBorrowedObject(obj) {
198
- if (stack_pointer == 1) throw new Error('out of js stack');
199
- heap[--stack_pointer] = obj;
200
- return stack_pointer;
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.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
308
+ wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
281
309
  }
282
310
  };
283
311
 
284
312
  /**
285
- * @param {string} code
313
+ * @param {(Array<any>)[]} sources
286
314
  * @returns {string}
287
315
  */
288
- module.exports.get_qir = function(code) {
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 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
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.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
339
+ wasm.__wbindgen_export_4(deferred3_0, deferred3_1, 1);
312
340
  }
313
341
  };
314
342
 
315
343
  /**
316
- * @param {string} code
344
+ * @param {(Array<any>)[]} sources
317
345
  * @param {string} params
318
346
  * @returns {string}
319
347
  */
320
- module.exports.get_estimates = function(code, params) {
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 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
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.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
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.__wbindgen_export_2(r0, r1 * 1);
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.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
419
+ wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
392
420
  }
393
421
  };
394
422
 
395
423
  /**
396
- * @param {string} code
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(code, expr, event_cb, shots) {
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 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
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.__wbindgen_export_3(addHeapObject(e));
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 {string} path
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(path, source, target_profile, entry) {
487
- let deferred5_0;
488
- let deferred5_1;
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 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
522
+ const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
492
523
  const len0 = WASM_VECTOR_LEN;
493
- const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
524
+ const ptr1 = passStringToWasm0(target_profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
494
525
  const len1 = WASM_VECTOR_LEN;
495
- const ptr2 = passStringToWasm0(target_profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
496
- const len2 = WASM_VECTOR_LEN;
497
- var ptr3 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
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
- deferred5_0 = r0;
503
- deferred5_1 = r1;
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.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
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(diagnostics_callback) {
662
- const ret = wasm.languageservice_new(addHeapObject(diagnostics_callback));
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) {
@@ -702,14 +746,11 @@ class LanguageService {
702
746
  }
703
747
  /**
704
748
  * @param {string} notebook_uri
705
- * @param {(string)[]} cell_uris
706
749
  */
707
- close_notebook_document(notebook_uri, cell_uris) {
750
+ close_notebook_document(notebook_uri) {
708
751
  const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
709
752
  const len0 = WASM_VECTOR_LEN;
710
- const ptr1 = passArrayJsValueToWasm0(cell_uris, wasm.__wbindgen_export_0);
711
- const len1 = WASM_VECTOR_LEN;
712
- wasm.languageservice_close_notebook_document(this.__wbg_ptr, ptr0, len0, ptr1, len1);
753
+ wasm.languageservice_close_notebook_document(this.__wbg_ptr, ptr0, len0);
713
754
  }
714
755
  /**
715
756
  * @param {string} uri
@@ -748,7 +789,7 @@ class LanguageService {
748
789
  var r0 = getInt32Memory0()[retptr / 4 + 0];
749
790
  var r1 = getInt32Memory0()[retptr / 4 + 1];
750
791
  var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
751
- wasm.__wbindgen_export_2(r0, r1 * 4);
792
+ wasm.__wbindgen_export_4(r0, r1 * 4);
752
793
  return v2;
753
794
  } finally {
754
795
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -803,11 +844,81 @@ class LanguageService {
803
844
  }
804
845
  }
805
846
  module.exports.LanguageService = LanguageService;
847
+ /**
848
+ * a minimal implementation for interacting with async JS filesystem callbacks to
849
+ * load project files
850
+ */
851
+ class ProjectLoader {
852
+
853
+ static __wrap(ptr) {
854
+ ptr = ptr >>> 0;
855
+ const obj = Object.create(ProjectLoader.prototype);
856
+ obj.__wbg_ptr = ptr;
857
+
858
+ return obj;
859
+ }
860
+
861
+ __destroy_into_raw() {
862
+ const ptr = this.__wbg_ptr;
863
+ this.__wbg_ptr = 0;
864
+
865
+ return ptr;
866
+ }
867
+
868
+ free() {
869
+ const ptr = this.__destroy_into_raw();
870
+ wasm.__wbg_projectloader_free(ptr);
871
+ }
872
+ /**
873
+ * @param {(uri: string) => Promise<string | null>} read_file
874
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
875
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
876
+ */
877
+ constructor(read_file, list_directory, get_manifest) {
878
+ const ret = wasm.projectloader_new(addHeapObject(read_file), addHeapObject(list_directory), addHeapObject(get_manifest));
879
+ return ProjectLoader.__wrap(ret);
880
+ }
881
+ /**
882
+ * @param {{ manifestDirectory: string }} manifest
883
+ * @returns {Promise<[string, string][]>}
884
+ */
885
+ load_project(manifest) {
886
+ const ret = wasm.projectloader_load_project(this.__wbg_ptr, addHeapObject(manifest));
887
+ return takeObject(ret);
888
+ }
889
+ }
890
+ module.exports.ProjectLoader = ProjectLoader;
891
+
892
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
893
+ const obj = getObject(arg1);
894
+ const ret = typeof(obj) === 'string' ? obj : undefined;
895
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
896
+ var len1 = WASM_VECTOR_LEN;
897
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
898
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
899
+ };
900
+
901
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
902
+ const obj = getObject(arg1);
903
+ const ret = typeof(obj) === 'number' ? obj : undefined;
904
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
905
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
906
+ };
806
907
 
807
908
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
808
909
  takeObject(arg0);
809
910
  };
810
911
 
912
+ module.exports.__wbindgen_cb_drop = function(arg0) {
913
+ const obj = takeObject(arg0).original;
914
+ if (obj.cnt-- == 1) {
915
+ obj.a = 0;
916
+ return true;
917
+ }
918
+ const ret = false;
919
+ return ret;
920
+ };
921
+
811
922
  module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
812
923
  const ret = BigInt.asUintN(64, arg0);
813
924
  return addHeapObject(ret);
@@ -834,15 +945,6 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
834
945
  return ret;
835
946
  };
836
947
 
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
948
  module.exports.__wbindgen_number_new = function(arg0) {
847
949
  const ret = arg0;
848
950
  return addHeapObject(ret);
@@ -866,11 +968,21 @@ module.exports.__wbg_stack_3090cd8fd3702c6e = function(arg0, arg1) {
866
968
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
867
969
  };
868
970
 
971
+ module.exports.__wbindgen_is_null = function(arg0) {
972
+ const ret = getObject(arg0) === null;
973
+ return ret;
974
+ };
975
+
869
976
  module.exports.__wbindgen_is_function = function(arg0) {
870
977
  const ret = typeof(getObject(arg0)) === 'function';
871
978
  return ret;
872
979
  };
873
980
 
981
+ module.exports.__wbindgen_typeof = function(arg0) {
982
+ const ret = typeof getObject(arg0);
983
+ return addHeapObject(ret);
984
+ };
985
+
874
986
  module.exports.__wbindgen_object_clone_ref = function(arg0) {
875
987
  const ret = getObject(arg0);
876
988
  return addHeapObject(ret);
@@ -887,13 +999,6 @@ module.exports.__wbindgen_boolean_get = function(arg0) {
887
999
  return ret;
888
1000
  };
889
1001
 
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
1002
  module.exports.__wbg_getwithrefkey_d1f0d12f1f1b63ea = function(arg0, arg1) {
898
1003
  const ret = getObject(arg0)[getObject(arg1)];
899
1004
  return addHeapObject(ret);
@@ -1015,6 +1120,11 @@ module.exports.__wbg_isArray_4c24b343cb13cfb1 = function(arg0) {
1015
1120
  return ret;
1016
1121
  };
1017
1122
 
1123
+ module.exports.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
1124
+ const ret = getObject(arg0).push(getObject(arg1));
1125
+ return ret;
1126
+ };
1127
+
1018
1128
  module.exports.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
1019
1129
  let result;
1020
1130
  try {
@@ -1046,6 +1156,40 @@ module.exports.__wbg_buffer_085ec1f694018c4f = function(arg0) {
1046
1156
  return addHeapObject(ret);
1047
1157
  };
1048
1158
 
1159
+ module.exports.__wbg_new_43f1b47c28813cbd = function(arg0, arg1) {
1160
+ try {
1161
+ var state0 = {a: arg0, b: arg1};
1162
+ var cb0 = (arg0, arg1) => {
1163
+ const a = state0.a;
1164
+ state0.a = 0;
1165
+ try {
1166
+ return __wbg_adapter_145(a, state0.b, arg0, arg1);
1167
+ } finally {
1168
+ state0.a = a;
1169
+ }
1170
+ };
1171
+ const ret = new Promise(cb0);
1172
+ return addHeapObject(ret);
1173
+ } finally {
1174
+ state0.a = state0.b = 0;
1175
+ }
1176
+ };
1177
+
1178
+ module.exports.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) {
1179
+ const ret = Promise.resolve(getObject(arg0));
1180
+ return addHeapObject(ret);
1181
+ };
1182
+
1183
+ module.exports.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) {
1184
+ const ret = getObject(arg0).then(getObject(arg1));
1185
+ return addHeapObject(ret);
1186
+ };
1187
+
1188
+ module.exports.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) {
1189
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1190
+ return addHeapObject(ret);
1191
+ };
1192
+
1049
1193
  module.exports.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
1050
1194
  const ret = self.self;
1051
1195
  return addHeapObject(ret);
@@ -1123,6 +1267,11 @@ module.exports.__wbindgen_memory = function() {
1123
1267
  return addHeapObject(ret);
1124
1268
  };
1125
1269
 
1270
+ module.exports.__wbindgen_closure_wrapper533 = function(arg0, arg1, arg2) {
1271
+ const ret = makeMutClosure(arg0, arg1, 156, __wbg_adapter_44);
1272
+ return addHeapObject(ret);
1273
+ };
1274
+
1126
1275
  const path = require('path').join(__dirname, 'qsc_wasm_bg.wasm');
1127
1276
  const bytes = require('fs').readFileSync(path);
1128
1277
 
@@ -14,16 +14,16 @@ export function setLogLevel(level: number): void;
14
14
  */
15
15
  export function git_hash(): string;
16
16
  /**
17
- * @param {string} code
17
+ * @param {(Array<any>)[]} sources
18
18
  * @returns {string}
19
19
  */
20
- export function get_qir(code: string): string;
20
+ export function get_qir(sources: (Array<any>)[]): string;
21
21
  /**
22
- * @param {string} code
22
+ * @param {(Array<any>)[]} sources
23
23
  * @param {string} params
24
24
  * @returns {string}
25
25
  */
26
- export function get_estimates(code: string, params: string): string;
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 {string} code
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(code: string, expr: string, event_cb: Function, shots: number): boolean;
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?: string;
176
+ documentation: string;
177
177
  parameters: IParameterInformation[];
178
178
  }
179
179
 
180
180
  export interface IParameterInformation {
181
181
  label: ISpan;
182
- documentation?: string;
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 {string} path
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(path: string, source: string, target_profile: string, entry?: string): string;
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
- constructor(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void);
281
+ stop_background_work(): void;
273
282
  /**
274
283
  * @param {IWorkspaceConfiguration} config
275
284
  */
@@ -292,9 +301,8 @@ export class LanguageService {
292
301
  update_notebook_document(notebook_uri: string, notebook_metadata: INotebookMetadata, cells: (ICell)[]): void;
293
302
  /**
294
303
  * @param {string} notebook_uri
295
- * @param {(string)[]} cell_uris
296
304
  */
297
- close_notebook_document(notebook_uri: string, cell_uris: (string)[]): void;
305
+ close_notebook_document(notebook_uri: string): void;
298
306
  /**
299
307
  * @param {string} uri
300
308
  * @param {number} offset
@@ -340,3 +348,21 @@ export class LanguageService {
340
348
  */
341
349
  prepare_rename(uri: string, offset: number): ITextEdit | undefined;
342
350
  }
351
+ /**
352
+ * a minimal implementation for interacting with async JS filesystem callbacks to
353
+ * load project files
354
+ */
355
+ export class ProjectLoader {
356
+ free(): void;
357
+ /**
358
+ * @param {(uri: string) => Promise<string | null>} read_file
359
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
360
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
361
+ */
362
+ constructor(read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>);
363
+ /**
364
+ * @param {{ manifestDirectory: string }} manifest
365
+ * @returns {Promise<[string, string][]>}
366
+ */
367
+ load_project(manifest: { manifestDirectory: string }): Promise<[string, string][]>;
368
+ }
Binary file