@emnudge/wat-lsp 0.4.0 → 0.4.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.
|
@@ -16,6 +16,11 @@ export class WatLSP {
|
|
|
16
16
|
* Provide hover information at the given position (uses tree-sitter based hover)
|
|
17
17
|
*/
|
|
18
18
|
provideHover(line: number, col: number): any;
|
|
19
|
+
/**
|
|
20
|
+
* Prepare rename: check if position has a renamable symbol and return its range
|
|
21
|
+
* Returns null if the symbol cannot be renamed, otherwise returns { range, placeholder }
|
|
22
|
+
*/
|
|
23
|
+
prepareRename(line: number, col: number): any;
|
|
19
24
|
/**
|
|
20
25
|
* Provide code completion items at the given position
|
|
21
26
|
* Returns an array of completion item objects
|
|
@@ -42,6 +47,13 @@ export class WatLSP {
|
|
|
42
47
|
* Returns an array of folding range objects with startLine, endLine, and kind
|
|
43
48
|
*/
|
|
44
49
|
provideFoldingRanges(): any;
|
|
50
|
+
/**
|
|
51
|
+
* Provide signature help at the given position
|
|
52
|
+
* Returns null if no signature help available, otherwise returns:
|
|
53
|
+
* { signatures: [{ label, documentation?, parameters: [{ label, documentation? }] }],
|
|
54
|
+
* activeSignature, activeParameter }
|
|
55
|
+
*/
|
|
56
|
+
provideSignatureHelp(line: number, col: number): any;
|
|
45
57
|
/**
|
|
46
58
|
* Provide semantic tokens for syntax highlighting
|
|
47
59
|
* Returns a flat array of u32 values in Monaco's delta-encoded format:
|
|
@@ -65,6 +77,11 @@ export class WatLSP {
|
|
|
65
77
|
* Parse a WAT document and build symbol table using tree-sitter
|
|
66
78
|
*/
|
|
67
79
|
parse(document: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* Rename a symbol at the given position to a new name
|
|
82
|
+
* Returns null if rename is not possible, otherwise returns { changes: [{ range, newText }] }
|
|
83
|
+
*/
|
|
84
|
+
rename(line: number, col: number, new_name: string): any;
|
|
68
85
|
/**
|
|
69
86
|
* Check if the LSP is ready
|
|
70
87
|
*/
|
|
@@ -87,6 +104,7 @@ export interface InitOutput {
|
|
|
87
104
|
readonly watlsp_initialize: (a: number) => any;
|
|
88
105
|
readonly watlsp_new: () => number;
|
|
89
106
|
readonly watlsp_parse: (a: number, b: number, c: number) => void;
|
|
107
|
+
readonly watlsp_prepareRename: (a: number, b: number, c: number) => any;
|
|
90
108
|
readonly watlsp_provideCompletion: (a: number, b: number, c: number) => any;
|
|
91
109
|
readonly watlsp_provideDefinition: (a: number, b: number, c: number) => any;
|
|
92
110
|
readonly watlsp_provideDiagnostics: (a: number) => any;
|
|
@@ -95,7 +113,9 @@ export interface InitOutput {
|
|
|
95
113
|
readonly watlsp_provideHover: (a: number, b: number, c: number) => any;
|
|
96
114
|
readonly watlsp_provideReferences: (a: number, b: number, c: number, d: number) => any;
|
|
97
115
|
readonly watlsp_provideSemanticTokens: (a: number) => any;
|
|
116
|
+
readonly watlsp_provideSignatureHelp: (a: number, b: number, c: number) => any;
|
|
98
117
|
readonly watlsp_ready: (a: number) => number;
|
|
118
|
+
readonly watlsp_rename: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
99
119
|
readonly init: () => void;
|
|
100
120
|
readonly wasm_bindgen__convert__closures_____invoke__hfee0e13a54da0cc9: (a: number, b: number, c: any) => void;
|
|
101
121
|
readonly wasm_bindgen__closure__destroy__hdb18b2b625d87f9d: (a: number, b: number) => void;
|
|
@@ -287,6 +287,17 @@ export class WatLSP {
|
|
|
287
287
|
const ret = wasm.watlsp_provideHover(this.__wbg_ptr, line, col);
|
|
288
288
|
return ret;
|
|
289
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Prepare rename: check if position has a renamable symbol and return its range
|
|
292
|
+
* Returns null if the symbol cannot be renamed, otherwise returns { range, placeholder }
|
|
293
|
+
* @param {number} line
|
|
294
|
+
* @param {number} col
|
|
295
|
+
* @returns {any}
|
|
296
|
+
*/
|
|
297
|
+
prepareRename(line, col) {
|
|
298
|
+
const ret = wasm.watlsp_prepareRename(this.__wbg_ptr, line, col);
|
|
299
|
+
return ret;
|
|
300
|
+
}
|
|
290
301
|
/**
|
|
291
302
|
* Provide code completion items at the given position
|
|
292
303
|
* Returns an array of completion item objects
|
|
@@ -352,6 +363,19 @@ export class WatLSP {
|
|
|
352
363
|
const ret = wasm.watlsp_provideFoldingRanges(this.__wbg_ptr);
|
|
353
364
|
return ret;
|
|
354
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* Provide signature help at the given position
|
|
368
|
+
* Returns null if no signature help available, otherwise returns:
|
|
369
|
+
* { signatures: [{ label, documentation?, parameters: [{ label, documentation? }] }],
|
|
370
|
+
* activeSignature, activeParameter }
|
|
371
|
+
* @param {number} line
|
|
372
|
+
* @param {number} col
|
|
373
|
+
* @returns {any}
|
|
374
|
+
*/
|
|
375
|
+
provideSignatureHelp(line, col) {
|
|
376
|
+
const ret = wasm.watlsp_provideSignatureHelp(this.__wbg_ptr, line, col);
|
|
377
|
+
return ret;
|
|
378
|
+
}
|
|
355
379
|
/**
|
|
356
380
|
* Provide semantic tokens for syntax highlighting
|
|
357
381
|
* Returns a flat array of u32 values in Monaco's delta-encoded format:
|
|
@@ -405,6 +429,20 @@ export class WatLSP {
|
|
|
405
429
|
const ret = wasm.watlsp_ready(this.__wbg_ptr);
|
|
406
430
|
return ret !== 0;
|
|
407
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* Rename a symbol at the given position to a new name
|
|
434
|
+
* Returns null if rename is not possible, otherwise returns { changes: [{ range, newText }] }
|
|
435
|
+
* @param {number} line
|
|
436
|
+
* @param {number} col
|
|
437
|
+
* @param {string} new_name
|
|
438
|
+
* @returns {any}
|
|
439
|
+
*/
|
|
440
|
+
rename(line, col, new_name) {
|
|
441
|
+
const ptr0 = passStringToWasm0(new_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
|
+
const len0 = WASM_VECTOR_LEN;
|
|
443
|
+
const ret = wasm.watlsp_rename(this.__wbg_ptr, line, col, ptr0, len0);
|
|
444
|
+
return ret;
|
|
445
|
+
}
|
|
408
446
|
}
|
|
409
447
|
if (Symbol.dispose) WatLSP.prototype[Symbol.dispose] = WatLSP.prototype.free;
|
|
410
448
|
|
|
@@ -735,8 +773,8 @@ function __wbg_get_imports() {
|
|
|
735
773
|
const ret = arg0;
|
|
736
774
|
return ret;
|
|
737
775
|
};
|
|
738
|
-
imports.wbg.
|
|
739
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
776
|
+
imports.wbg.__wbindgen_cast_f2161ef24e95b954 = function(arg0, arg1) {
|
|
777
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 733, function: Function { arguments: [Externref], shim_idx: 734, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
740
778
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hdb18b2b625d87f9d, wasm_bindgen__convert__closures_____invoke__hfee0e13a54da0cc9);
|
|
741
779
|
return ret;
|
|
742
780
|
};
|
|
Binary file
|