qsharp-lang 0.1.0-dev.1 → 1.0.5-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/README.md +0 -4
- package/dist/compiler/compiler.d.ts +2 -0
- package/dist/compiler/compiler.js +4 -1
- package/dist/compiler/worker-proxy.js +1 -0
- package/dist/debug-service/debug-service.js +11 -30
- package/dist/katas-content.generated.js +26 -26
- package/dist/language-service/language-service.d.ts +11 -7
- package/dist/language-service/language-service.js +54 -3
- package/dist/language-service/worker-proxy.js +2 -0
- package/lib/node/qsc_wasm.cjs +151 -177
- package/lib/node/qsc_wasm.d.cts +154 -139
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +169 -156
- package/lib/web/qsc_wasm.js +146 -172
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +3 -2
- package/LICENSE.txt +0 -21
|
@@ -12,9 +12,12 @@ export class QSharpLanguageService {
|
|
|
12
12
|
log.info("Constructing a QSharpLanguageService instance");
|
|
13
13
|
this.languageService = new wasm.LanguageService(this.onDiagnostics.bind(this));
|
|
14
14
|
}
|
|
15
|
-
async
|
|
15
|
+
async updateConfiguration(config) {
|
|
16
|
+
this.languageService.update_configuration(config);
|
|
17
|
+
}
|
|
18
|
+
async updateDocument(documentUri, version, code) {
|
|
16
19
|
this.code[documentUri] = code;
|
|
17
|
-
this.languageService.update_document(documentUri, version, code
|
|
20
|
+
this.languageService.update_document(documentUri, version, code);
|
|
18
21
|
}
|
|
19
22
|
async closeDocument(documentUri) {
|
|
20
23
|
delete this.code[documentUri];
|
|
@@ -22,6 +25,10 @@ export class QSharpLanguageService {
|
|
|
22
25
|
}
|
|
23
26
|
async getCompletions(documentUri, offset) {
|
|
24
27
|
const code = this.code[documentUri];
|
|
28
|
+
if (code === undefined) {
|
|
29
|
+
log.error(`getCompletions: expected ${documentUri} to be in the document map`);
|
|
30
|
+
return { items: [] };
|
|
31
|
+
}
|
|
25
32
|
const convertedOffset = mapUtf16UnitsToUtf8Units([offset], code)[offset];
|
|
26
33
|
const result = this.languageService.get_completions(documentUri, convertedOffset);
|
|
27
34
|
result.items.forEach((item) => item.additionalTextEdits?.forEach((edit) => {
|
|
@@ -33,6 +40,10 @@ export class QSharpLanguageService {
|
|
|
33
40
|
}
|
|
34
41
|
async getHover(documentUri, offset) {
|
|
35
42
|
const code = this.code[documentUri];
|
|
43
|
+
if (code === undefined) {
|
|
44
|
+
log.error(`getHover: expected ${documentUri} to be in the document map`);
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
36
47
|
const convertedOffset = mapUtf16UnitsToUtf8Units([offset], code)[offset];
|
|
37
48
|
const result = this.languageService.get_hover(documentUri, convertedOffset);
|
|
38
49
|
if (result) {
|
|
@@ -44,6 +55,10 @@ export class QSharpLanguageService {
|
|
|
44
55
|
}
|
|
45
56
|
async getDefinition(documentUri, offset) {
|
|
46
57
|
let code = this.code[documentUri];
|
|
58
|
+
if (code === undefined) {
|
|
59
|
+
log.error(`getDefinition: expected ${documentUri} to be in the document map`);
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
47
62
|
const convertedOffset = mapUtf16UnitsToUtf8Units([offset], code)[offset];
|
|
48
63
|
const result = this.languageService.get_definition(documentUri, convertedOffset);
|
|
49
64
|
if (result) {
|
|
@@ -53,11 +68,36 @@ export class QSharpLanguageService {
|
|
|
53
68
|
const url = new URL(result.source);
|
|
54
69
|
if (url.protocol === qsharpLibraryUriScheme + ":") {
|
|
55
70
|
code = wasm.get_library_source_content(url.pathname);
|
|
71
|
+
if (code === undefined) {
|
|
72
|
+
log.error(`getDefinition: expected ${url} to be in the library`);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
56
75
|
}
|
|
57
76
|
result.offset = mapUtf8UnitsToUtf16Units([result.offset], code)[result.offset];
|
|
58
77
|
}
|
|
59
78
|
return result;
|
|
60
79
|
}
|
|
80
|
+
async getSignatureHelp(documentUri, offset) {
|
|
81
|
+
const code = this.code[documentUri];
|
|
82
|
+
if (code === undefined) {
|
|
83
|
+
log.error(`expected ${documentUri} to be in the document map`);
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const convertedOffset = mapUtf16UnitsToUtf8Units([offset], code)[offset];
|
|
87
|
+
const result = this.languageService.get_signature_help(documentUri, convertedOffset);
|
|
88
|
+
if (result) {
|
|
89
|
+
result.signatures = result.signatures.map((sig) => {
|
|
90
|
+
sig.parameters = sig.parameters.map((param) => {
|
|
91
|
+
const mappedSpan = mapUtf8UnitsToUtf16Units([param.label.start, param.label.end], sig.label);
|
|
92
|
+
param.label.start = mappedSpan[param.label.start];
|
|
93
|
+
param.label.end = mappedSpan[param.label.end];
|
|
94
|
+
return param;
|
|
95
|
+
});
|
|
96
|
+
return sig;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
61
101
|
async dispose() {
|
|
62
102
|
this.languageService.free();
|
|
63
103
|
}
|
|
@@ -70,11 +110,22 @@ export class QSharpLanguageService {
|
|
|
70
110
|
onDiagnostics(uri, version, diagnostics) {
|
|
71
111
|
try {
|
|
72
112
|
const code = this.code[uri];
|
|
113
|
+
const empty = diagnostics.length === 0;
|
|
114
|
+
if (code === undefined && !empty) {
|
|
115
|
+
// We need the contents of the document to convert error offsets to utf16.
|
|
116
|
+
// But the contents aren't available after a document is closed.
|
|
117
|
+
// It is possible to get a diagnostics event after a document is closed,
|
|
118
|
+
// but it will be done with an empty array, to clear the diagnostics.
|
|
119
|
+
// In that case, it's ok not to have the document contents available,
|
|
120
|
+
// because there are no offsets to convert.
|
|
121
|
+
log.error(`onDiagnostics: expected ${uri} to be in the document map`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
73
124
|
const event = new Event("diagnostics");
|
|
74
125
|
event.detail = {
|
|
75
126
|
uri,
|
|
76
127
|
version,
|
|
77
|
-
diagnostics: mapDiagnostics(diagnostics, code),
|
|
128
|
+
diagnostics: empty ? [] : mapDiagnostics(diagnostics, code),
|
|
78
129
|
};
|
|
79
130
|
this.eventHandler.dispatchEvent(event);
|
|
80
131
|
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { createDispatcher, createProxy, } from "../worker-proxy.js";
|
|
4
4
|
const requests = {
|
|
5
|
+
updateConfiguration: "request",
|
|
5
6
|
updateDocument: "request",
|
|
6
7
|
closeDocument: "request",
|
|
7
8
|
getCompletions: "request",
|
|
8
9
|
getHover: "request",
|
|
9
10
|
getDefinition: "request",
|
|
11
|
+
getSignatureHelp: "request",
|
|
10
12
|
dispose: "request",
|
|
11
13
|
addEventListener: "addEventListener",
|
|
12
14
|
removeEventListener: "removeEventListener",
|
package/lib/node/qsc_wasm.cjs
CHANGED
|
@@ -191,52 +191,74 @@ function debugString(val) {
|
|
|
191
191
|
return className;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
* @
|
|
195
|
-
* @param {number} level
|
|
194
|
+
* @returns {string}
|
|
196
195
|
*/
|
|
197
|
-
module.exports.
|
|
196
|
+
module.exports.git_hash = function() {
|
|
198
197
|
try {
|
|
199
198
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
200
|
-
wasm.
|
|
199
|
+
wasm.git_hash(retptr);
|
|
201
200
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
202
201
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
203
|
-
|
|
204
|
-
throw takeObject(r0);
|
|
205
|
-
}
|
|
202
|
+
return getStringFromWasm0(r0, r1);
|
|
206
203
|
} finally {
|
|
207
204
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
205
|
+
wasm.__wbindgen_export_2(r0, r1);
|
|
208
206
|
}
|
|
209
207
|
};
|
|
210
208
|
|
|
211
209
|
/**
|
|
212
|
-
* @param {
|
|
213
|
-
|
|
214
|
-
module.exports.setLogLevel = function(level) {
|
|
215
|
-
wasm.setLogLevel(level);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @returns {any}
|
|
210
|
+
* @param {string} code
|
|
211
|
+
* @returns {string}
|
|
220
212
|
*/
|
|
221
|
-
module.exports.
|
|
222
|
-
|
|
223
|
-
|
|
213
|
+
module.exports.get_qir = function(code) {
|
|
214
|
+
try {
|
|
215
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
216
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
217
|
+
const len0 = WASM_VECTOR_LEN;
|
|
218
|
+
wasm.get_qir(retptr, ptr0, len0);
|
|
219
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
220
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
221
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
222
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
223
|
+
var ptr1 = r0;
|
|
224
|
+
var len1 = r1;
|
|
225
|
+
if (r3) {
|
|
226
|
+
ptr1 = 0; len1 = 0;
|
|
227
|
+
throw takeObject(r2);
|
|
228
|
+
}
|
|
229
|
+
return getStringFromWasm0(ptr1, len1);
|
|
230
|
+
} finally {
|
|
231
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
232
|
+
wasm.__wbindgen_export_2(ptr1, len1);
|
|
233
|
+
}
|
|
224
234
|
};
|
|
225
235
|
|
|
226
236
|
/**
|
|
227
237
|
* @param {string} name
|
|
228
|
-
* @returns {
|
|
238
|
+
* @returns {string | undefined}
|
|
229
239
|
*/
|
|
230
240
|
module.exports.get_library_source_content = function(name) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
241
|
+
try {
|
|
242
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
243
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
244
|
+
const len0 = WASM_VECTOR_LEN;
|
|
245
|
+
wasm.get_library_source_content(retptr, ptr0, len0);
|
|
246
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
247
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
248
|
+
let v1;
|
|
249
|
+
if (r0 !== 0) {
|
|
250
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
251
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
252
|
+
}
|
|
253
|
+
return v1;
|
|
254
|
+
} finally {
|
|
255
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
256
|
+
}
|
|
235
257
|
};
|
|
236
258
|
|
|
237
259
|
/**
|
|
238
260
|
* @param {string} code
|
|
239
|
-
* @returns {
|
|
261
|
+
* @returns {string}
|
|
240
262
|
*/
|
|
241
263
|
module.exports.get_hir = function(code) {
|
|
242
264
|
try {
|
|
@@ -246,13 +268,10 @@ module.exports.get_hir = function(code) {
|
|
|
246
268
|
wasm.get_hir(retptr, ptr0, len0);
|
|
247
269
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
248
270
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
249
|
-
|
|
250
|
-
if (r2) {
|
|
251
|
-
throw takeObject(r1);
|
|
252
|
-
}
|
|
253
|
-
return takeObject(r0);
|
|
271
|
+
return getStringFromWasm0(r0, r1);
|
|
254
272
|
} finally {
|
|
255
273
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
274
|
+
wasm.__wbindgen_export_2(r0, r1);
|
|
256
275
|
}
|
|
257
276
|
};
|
|
258
277
|
|
|
@@ -268,7 +287,7 @@ function addBorrowedObject(obj) {
|
|
|
268
287
|
* @param {string} expr
|
|
269
288
|
* @param {Function} event_cb
|
|
270
289
|
* @param {number} shots
|
|
271
|
-
* @returns {
|
|
290
|
+
* @returns {boolean}
|
|
272
291
|
*/
|
|
273
292
|
module.exports.run = function(code, expr, event_cb, shots) {
|
|
274
293
|
try {
|
|
@@ -284,7 +303,7 @@ module.exports.run = function(code, expr, event_cb, shots) {
|
|
|
284
303
|
if (r2) {
|
|
285
304
|
throw takeObject(r1);
|
|
286
305
|
}
|
|
287
|
-
return
|
|
306
|
+
return r0 !== 0;
|
|
288
307
|
} finally {
|
|
289
308
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
309
|
heap[stack_pointer++] = undefined;
|
|
@@ -295,27 +314,44 @@ module.exports.run = function(code, expr, event_cb, shots) {
|
|
|
295
314
|
* @param {string} solution_code
|
|
296
315
|
* @param {any} exercise_sources_js
|
|
297
316
|
* @param {Function} event_cb
|
|
298
|
-
* @returns {
|
|
317
|
+
* @returns {boolean}
|
|
299
318
|
*/
|
|
300
319
|
module.exports.check_exercise_solution = function(solution_code, exercise_sources_js, event_cb) {
|
|
301
320
|
try {
|
|
302
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
303
321
|
const ptr0 = passStringToWasm0(solution_code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
304
322
|
const len0 = WASM_VECTOR_LEN;
|
|
305
|
-
wasm.check_exercise_solution(
|
|
323
|
+
const ret = wasm.check_exercise_solution(ptr0, len0, addHeapObject(exercise_sources_js), addBorrowedObject(event_cb));
|
|
324
|
+
return ret !== 0;
|
|
325
|
+
} finally {
|
|
326
|
+
heap[stack_pointer++] = undefined;
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @param {any} callback
|
|
332
|
+
* @param {number} level
|
|
333
|
+
*/
|
|
334
|
+
module.exports.initLogging = function(callback, level) {
|
|
335
|
+
try {
|
|
336
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
337
|
+
wasm.initLogging(retptr, addHeapObject(callback), level);
|
|
306
338
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
307
339
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
throw takeObject(r1);
|
|
340
|
+
if (r1) {
|
|
341
|
+
throw takeObject(r0);
|
|
311
342
|
}
|
|
312
|
-
return takeObject(r0);
|
|
313
343
|
} finally {
|
|
314
344
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
315
|
-
heap[stack_pointer++] = undefined;
|
|
316
345
|
}
|
|
317
346
|
};
|
|
318
347
|
|
|
348
|
+
/**
|
|
349
|
+
* @param {number} level
|
|
350
|
+
*/
|
|
351
|
+
module.exports.setLogLevel = function(level) {
|
|
352
|
+
wasm.setLogLevel(level);
|
|
353
|
+
};
|
|
354
|
+
|
|
319
355
|
let cachedUint32Memory0 = null;
|
|
320
356
|
|
|
321
357
|
function getUint32Memory0() {
|
|
@@ -399,14 +435,14 @@ class DebugService {
|
|
|
399
435
|
}
|
|
400
436
|
}
|
|
401
437
|
/**
|
|
402
|
-
* @returns {
|
|
438
|
+
* @returns {IQuantumStateList}
|
|
403
439
|
*/
|
|
404
440
|
capture_quantum_state() {
|
|
405
441
|
const ret = wasm.debugservice_capture_quantum_state(this.ptr);
|
|
406
442
|
return takeObject(ret);
|
|
407
443
|
}
|
|
408
444
|
/**
|
|
409
|
-
* @returns {
|
|
445
|
+
* @returns {IStackFrameList}
|
|
410
446
|
*/
|
|
411
447
|
get_stack_frames() {
|
|
412
448
|
const ret = wasm.debugservice_get_stack_frames(this.ptr);
|
|
@@ -415,7 +451,7 @@ class DebugService {
|
|
|
415
451
|
/**
|
|
416
452
|
* @param {Function} event_cb
|
|
417
453
|
* @param {Uint32Array} ids
|
|
418
|
-
* @returns {
|
|
454
|
+
* @returns {IStructStepResult}
|
|
419
455
|
*/
|
|
420
456
|
eval_next(event_cb, ids) {
|
|
421
457
|
try {
|
|
@@ -438,7 +474,7 @@ class DebugService {
|
|
|
438
474
|
/**
|
|
439
475
|
* @param {Function} event_cb
|
|
440
476
|
* @param {Uint32Array} ids
|
|
441
|
-
* @returns {
|
|
477
|
+
* @returns {IStructStepResult}
|
|
442
478
|
*/
|
|
443
479
|
eval_continue(event_cb, ids) {
|
|
444
480
|
try {
|
|
@@ -461,7 +497,7 @@ class DebugService {
|
|
|
461
497
|
/**
|
|
462
498
|
* @param {Function} event_cb
|
|
463
499
|
* @param {Uint32Array} ids
|
|
464
|
-
* @returns {
|
|
500
|
+
* @returns {IStructStepResult}
|
|
465
501
|
*/
|
|
466
502
|
eval_step_in(event_cb, ids) {
|
|
467
503
|
try {
|
|
@@ -484,7 +520,7 @@ class DebugService {
|
|
|
484
520
|
/**
|
|
485
521
|
* @param {Function} event_cb
|
|
486
522
|
* @param {Uint32Array} ids
|
|
487
|
-
* @returns {
|
|
523
|
+
* @returns {IStructStepResult}
|
|
488
524
|
*/
|
|
489
525
|
eval_step_out(event_cb, ids) {
|
|
490
526
|
try {
|
|
@@ -506,7 +542,7 @@ class DebugService {
|
|
|
506
542
|
}
|
|
507
543
|
/**
|
|
508
544
|
* @param {string} path
|
|
509
|
-
* @returns {
|
|
545
|
+
* @returns {IBreakpointSpanList}
|
|
510
546
|
*/
|
|
511
547
|
get_breakpoints(path) {
|
|
512
548
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -515,7 +551,7 @@ class DebugService {
|
|
|
515
551
|
return takeObject(ret);
|
|
516
552
|
}
|
|
517
553
|
/**
|
|
518
|
-
* @returns {
|
|
554
|
+
* @returns {IVariableList}
|
|
519
555
|
*/
|
|
520
556
|
get_locals() {
|
|
521
557
|
const ret = wasm.debugservice_get_locals(this.ptr);
|
|
@@ -557,17 +593,22 @@ class LanguageService {
|
|
|
557
593
|
}
|
|
558
594
|
}
|
|
559
595
|
/**
|
|
596
|
+
* @param {IWorkspaceConfiguration} config
|
|
597
|
+
*/
|
|
598
|
+
update_configuration(config) {
|
|
599
|
+
wasm.languageservice_update_configuration(this.ptr, addHeapObject(config));
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
560
602
|
* @param {string} uri
|
|
561
603
|
* @param {number} version
|
|
562
604
|
* @param {string} text
|
|
563
|
-
* @param {boolean} is_exe
|
|
564
605
|
*/
|
|
565
|
-
update_document(uri, version, text
|
|
606
|
+
update_document(uri, version, text) {
|
|
566
607
|
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
567
608
|
const len0 = WASM_VECTOR_LEN;
|
|
568
609
|
const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
569
610
|
const len1 = WASM_VECTOR_LEN;
|
|
570
|
-
wasm.languageservice_update_document(this.ptr, ptr0, len0, version, ptr1, len1
|
|
611
|
+
wasm.languageservice_update_document(this.ptr, ptr0, len0, version, ptr1, len1);
|
|
571
612
|
}
|
|
572
613
|
/**
|
|
573
614
|
* @param {string} uri
|
|
@@ -580,139 +621,59 @@ class LanguageService {
|
|
|
580
621
|
/**
|
|
581
622
|
* @param {string} uri
|
|
582
623
|
* @param {number} offset
|
|
583
|
-
* @returns {
|
|
624
|
+
* @returns {ICompletionList}
|
|
584
625
|
*/
|
|
585
626
|
get_completions(uri, offset) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
wasm.languageservice_get_completions(retptr, this.ptr, ptr0, len0, offset);
|
|
591
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
592
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
593
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
594
|
-
if (r2) {
|
|
595
|
-
throw takeObject(r1);
|
|
596
|
-
}
|
|
597
|
-
return takeObject(r0);
|
|
598
|
-
} finally {
|
|
599
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
600
|
-
}
|
|
627
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
628
|
+
const len0 = WASM_VECTOR_LEN;
|
|
629
|
+
const ret = wasm.languageservice_get_completions(this.ptr, ptr0, len0, offset);
|
|
630
|
+
return takeObject(ret);
|
|
601
631
|
}
|
|
602
632
|
/**
|
|
603
633
|
* @param {string} uri
|
|
604
634
|
* @param {number} offset
|
|
605
|
-
* @returns {
|
|
635
|
+
* @returns {IDefinition | undefined}
|
|
606
636
|
*/
|
|
607
637
|
get_definition(uri, offset) {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
wasm.languageservice_get_definition(retptr, this.ptr, ptr0, len0, offset);
|
|
613
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
614
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
615
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
616
|
-
if (r2) {
|
|
617
|
-
throw takeObject(r1);
|
|
618
|
-
}
|
|
619
|
-
return takeObject(r0);
|
|
620
|
-
} finally {
|
|
621
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
622
|
-
}
|
|
638
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
639
|
+
const len0 = WASM_VECTOR_LEN;
|
|
640
|
+
const ret = wasm.languageservice_get_definition(this.ptr, ptr0, len0, offset);
|
|
641
|
+
return takeObject(ret);
|
|
623
642
|
}
|
|
624
643
|
/**
|
|
625
644
|
* @param {string} uri
|
|
626
645
|
* @param {number} offset
|
|
627
|
-
* @returns {
|
|
646
|
+
* @returns {IHover | undefined}
|
|
628
647
|
*/
|
|
629
648
|
get_hover(uri, offset) {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
wasm.languageservice_get_hover(retptr, this.ptr, ptr0, len0, offset);
|
|
635
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
636
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
637
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
638
|
-
if (r2) {
|
|
639
|
-
throw takeObject(r1);
|
|
640
|
-
}
|
|
641
|
-
return takeObject(r0);
|
|
642
|
-
} finally {
|
|
643
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
module.exports.LanguageService = LanguageService;
|
|
648
|
-
/**
|
|
649
|
-
*/
|
|
650
|
-
class StructStepResult {
|
|
651
|
-
|
|
652
|
-
static __wrap(ptr) {
|
|
653
|
-
const obj = Object.create(StructStepResult.prototype);
|
|
654
|
-
obj.ptr = ptr;
|
|
655
|
-
|
|
656
|
-
return obj;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
__destroy_into_raw() {
|
|
660
|
-
const ptr = this.ptr;
|
|
661
|
-
this.ptr = 0;
|
|
662
|
-
|
|
663
|
-
return ptr;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
free() {
|
|
667
|
-
const ptr = this.__destroy_into_raw();
|
|
668
|
-
wasm.__wbg_structstepresult_free(ptr);
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* @returns {number}
|
|
672
|
-
*/
|
|
673
|
-
get id() {
|
|
674
|
-
const ret = wasm.__wbg_get_structstepresult_id(this.ptr);
|
|
675
|
-
return ret >>> 0;
|
|
676
|
-
}
|
|
677
|
-
/**
|
|
678
|
-
* @param {number} arg0
|
|
679
|
-
*/
|
|
680
|
-
set id(arg0) {
|
|
681
|
-
wasm.__wbg_set_structstepresult_id(this.ptr, arg0);
|
|
682
|
-
}
|
|
683
|
-
/**
|
|
684
|
-
* @returns {number}
|
|
685
|
-
*/
|
|
686
|
-
get value() {
|
|
687
|
-
const ret = wasm.__wbg_get_structstepresult_value(this.ptr);
|
|
688
|
-
return ret >>> 0;
|
|
649
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
650
|
+
const len0 = WASM_VECTOR_LEN;
|
|
651
|
+
const ret = wasm.languageservice_get_hover(this.ptr, ptr0, len0, offset);
|
|
652
|
+
return takeObject(ret);
|
|
689
653
|
}
|
|
690
654
|
/**
|
|
691
|
-
* @param {
|
|
655
|
+
* @param {string} uri
|
|
656
|
+
* @param {number} offset
|
|
657
|
+
* @returns {ISignatureHelp | undefined}
|
|
692
658
|
*/
|
|
693
|
-
|
|
694
|
-
wasm.
|
|
659
|
+
get_signature_help(uri, offset) {
|
|
660
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
661
|
+
const len0 = WASM_VECTOR_LEN;
|
|
662
|
+
const ret = wasm.languageservice_get_signature_help(this.ptr, ptr0, len0, offset);
|
|
663
|
+
return takeObject(ret);
|
|
695
664
|
}
|
|
696
665
|
}
|
|
697
|
-
module.exports.
|
|
666
|
+
module.exports.LanguageService = LanguageService;
|
|
698
667
|
|
|
699
668
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
700
669
|
takeObject(arg0);
|
|
701
670
|
};
|
|
702
671
|
|
|
703
|
-
module.exports.
|
|
704
|
-
const ret =
|
|
672
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
673
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
705
674
|
return addHeapObject(ret);
|
|
706
675
|
};
|
|
707
676
|
|
|
708
|
-
module.exports.__wbg_stack_3090cd8fd3702c6e = function(arg0, arg1) {
|
|
709
|
-
const ret = getObject(arg1).stack;
|
|
710
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
711
|
-
const len0 = WASM_VECTOR_LEN;
|
|
712
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
713
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
714
|
-
};
|
|
715
|
-
|
|
716
677
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
717
678
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
718
679
|
return ret;
|
|
@@ -723,13 +684,8 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
|
723
684
|
return addHeapObject(ret);
|
|
724
685
|
};
|
|
725
686
|
|
|
726
|
-
module.exports.
|
|
727
|
-
const ret =
|
|
728
|
-
return addHeapObject(ret);
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
module.exports.__wbg_structstepresult_new = function(arg0) {
|
|
732
|
-
const ret = StructStepResult.__wrap(arg0);
|
|
687
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
688
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
733
689
|
return addHeapObject(ret);
|
|
734
690
|
};
|
|
735
691
|
|
|
@@ -742,9 +698,20 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
742
698
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
743
699
|
};
|
|
744
700
|
|
|
745
|
-
module.exports.
|
|
746
|
-
const
|
|
747
|
-
|
|
701
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
702
|
+
const val = getObject(arg0);
|
|
703
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
704
|
+
return ret;
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
708
|
+
const ret = getObject(arg0) === undefined;
|
|
709
|
+
return ret;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
713
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
714
|
+
return ret;
|
|
748
715
|
};
|
|
749
716
|
|
|
750
717
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
@@ -752,10 +719,22 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
|
752
719
|
return addHeapObject(ret);
|
|
753
720
|
};
|
|
754
721
|
|
|
755
|
-
module.exports.
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
|
|
722
|
+
module.exports.__wbg_new_0232637a3cb0b1a7 = function() {
|
|
723
|
+
const ret = new Error();
|
|
724
|
+
return addHeapObject(ret);
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
module.exports.__wbg_stack_3090cd8fd3702c6e = function(arg0, arg1) {
|
|
728
|
+
const ret = getObject(arg1).stack;
|
|
729
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
730
|
+
const len0 = WASM_VECTOR_LEN;
|
|
731
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
732
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
736
|
+
const ret = arg0;
|
|
737
|
+
return addHeapObject(ret);
|
|
759
738
|
};
|
|
760
739
|
|
|
761
740
|
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
@@ -776,8 +755,8 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
|
776
755
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
777
756
|
};
|
|
778
757
|
|
|
779
|
-
module.exports.
|
|
780
|
-
const ret =
|
|
758
|
+
module.exports.__wbg_getwithrefkey_5e6d9547403deab8 = function(arg0, arg1) {
|
|
759
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
781
760
|
return addHeapObject(ret);
|
|
782
761
|
};
|
|
783
762
|
|
|
@@ -908,11 +887,6 @@ module.exports.__wbg_global_c85a9259e621f3db = function() { return handleError(f
|
|
|
908
887
|
return addHeapObject(ret);
|
|
909
888
|
}, arguments) };
|
|
910
889
|
|
|
911
|
-
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
912
|
-
const ret = getObject(arg0) === undefined;
|
|
913
|
-
return ret;
|
|
914
|
-
};
|
|
915
|
-
|
|
916
890
|
module.exports.__wbg_set_17224bc548dd1d7b = function(arg0, arg1, arg2) {
|
|
917
891
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
918
892
|
};
|