@gdscript-analyzer/wasm 0.3.0 → 0.4.0

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
@@ -29,7 +29,7 @@ const az = new Analyzer();
29
29
  const uri = "inmemory://main.gd";
30
30
  az.openDocument(uri, "extends Node\nfunc _ready():\n\tvar x = 5 / 2\n", null);
31
31
 
32
- console.log(JSON.parse(az.diagnostics(uri))); // → INTEGER_DIVISION warning
32
+ console.log(az.diagnostics(uri)); // → INTEGER_DIVISION warning (a native JS array, no JSON.parse)
33
33
  ```
34
34
 
35
35
  Bundlers and native ESM both work. With Vite/webpack, `import init` resolves the
@@ -58,7 +58,9 @@ at `playground/data/extension_api.bin` you can copy, or generate it from the rep
58
58
  ## API
59
59
 
60
60
  Same URI-keyed session model as the native package. Construct once, push
61
- documents, query by **UTF-8 byte offset**; data queries return a **JSON string**.
61
+ documents, query by **UTF-8 byte offset**; queries return **native JS values**
62
+ (no `JSON.parse`). Navigation/edit results (`gotoDefinition`, `findReferences`,
63
+ `rename`) carry a `uri` per target, so you need no `FileId`→URI mapping of your own.
62
64
 
63
65
  ```js
64
66
  az.openDocument(uri, text, resPath); // resPath ("res://…") enables cross-file resolution
@@ -67,13 +69,13 @@ az.closeDocument(uri);
67
69
  az.setProjectConfig(projectGodotText); // enables [autoload] resolution
68
70
  az.loadEngineApi(bytes); // optional engine model
69
71
 
70
- JSON.parse(az.diagnostics(uri));
71
- JSON.parse(az.documentSymbols(uri));
72
- JSON.parse(az.completions(uri, byteOffset));
73
- const hover = az.hover(uri, byteOffset); // string | null
74
- JSON.parse(az.gotoDefinition(uri, byteOffset));
75
- JSON.parse(az.inlayHints(uri));
76
- JSON.parse(az.foldingRanges(uri));
72
+ az.diagnostics(uri); // array
73
+ az.documentSymbols(uri); // array
74
+ az.completions(uri, byteOffset); // array
75
+ const hover = az.hover(uri, byteOffset); // object | null
76
+ az.gotoDefinition(uri, byteOffset); // array, each target has a `uri`
77
+ az.inlayHints(uri); // array
78
+ az.foldingRanges(uri); // array
77
79
  ```
78
80
 
79
81
  ### Positions (byte offsets)
@@ -19,41 +19,42 @@ export class Analyzer {
19
19
  */
20
20
  closeDocument(uri: string): void;
21
21
  /**
22
- * Code actions at a byte `offset` in `uri`, as a JSON array string.
22
+ * Code actions at a byte `offset` in `uri`, as a JS array.
23
23
  */
24
- codeActions(uri: string, offset: number): string;
24
+ codeActions(uri: string, offset: number): any;
25
25
  /**
26
- * Completions at a byte `offset` in `uri`, as a JSON array string.
26
+ * Completions at a byte `offset` in `uri`, as a JS array.
27
27
  */
28
- completions(uri: string, offset: number): string;
28
+ completions(uri: string, offset: number): any;
29
29
  /**
30
- * Parse + type diagnostics for `uri`, as a JSON array string.
30
+ * Parse + type diagnostics for `uri`, as a JS array.
31
31
  */
32
- diagnostics(uri: string): string;
32
+ diagnostics(uri: string): any;
33
33
  /**
34
- * The document outline for `uri`, as a JSON array string.
34
+ * The document outline for `uri`, as a JS array.
35
35
  */
36
- documentSymbols(uri: string): string;
36
+ documentSymbols(uri: string): any;
37
37
  /**
38
- * Every reference to the symbol at a byte `offset` in `uri`, as a JSON array string.
38
+ * Every reference to the symbol at a byte `offset` in `uri`, as a JS array (each carries a `uri`).
39
39
  */
40
- findReferences(uri: string, offset: number): string;
40
+ findReferences(uri: string, offset: number): any;
41
41
  /**
42
- * Foldable ranges for `uri`, as a JSON array string.
42
+ * Foldable ranges for `uri`, as a JS array.
43
43
  */
44
- foldingRanges(uri: string): string;
44
+ foldingRanges(uri: string): any;
45
45
  /**
46
- * Go-to-definition target(s) for the symbol at a byte `offset` in `uri`, as a JSON array string.
46
+ * Go-to-definition target(s) for the symbol at a byte `offset` in `uri`, as a JS array (each
47
+ * target carries a `uri`).
47
48
  */
48
- gotoDefinition(uri: string, offset: number): string;
49
+ gotoDefinition(uri: string, offset: number): any;
49
50
  /**
50
- * Hover at a byte `offset` in `uri`; `undefined` when there is nothing typed there.
51
+ * Hover at a byte `offset` in `uri`; `null` when there is nothing typed there.
51
52
  */
52
- hover(uri: string, offset: number): string | undefined;
53
+ hover(uri: string, offset: number): any;
53
54
  /**
54
- * Inlay hints for `uri`, as a JSON array string.
55
+ * Inlay hints for `uri`, as a JS array.
55
56
  */
56
- inlayHints(uri: string): string;
57
+ inlayHints(uri: string): any;
57
58
  /**
58
59
  * Whether `uri` is currently open (distinguishes "not tracked" from a genuine empty result).
59
60
  */
@@ -74,26 +75,26 @@ export class Analyzer {
74
75
  */
75
76
  openDocument(uri: string, text: string, res_path?: string | null): void;
76
77
  /**
77
- * Rename the symbol at a byte `offset` in `uri` to `newName`. JSON object string:
78
- * `{"ok": <SourceChange>}` | `{"error": <RenameError | reason>}`.
78
+ * Rename the symbol at a byte `offset` in `uri` to `newName`. A JS object:
79
+ * `{ ok: <SourceChange> }` | `{ error: <RenameError | reason> }` (edits carry a `uri`).
79
80
  */
80
- rename(uri: string, offset: number, new_name: string): string;
81
+ rename(uri: string, offset: number, new_name: string): any;
81
82
  /**
82
83
  * Set the project's `project.godot` text (enables `[autoload]` singleton resolution).
83
84
  */
84
85
  setProjectConfig(text: string): void;
85
86
  /**
86
- * Signature help at a byte `offset` in `uri`; `undefined` when not at a call site.
87
+ * Signature help at a byte `offset` in `uri`; `null` when not at a call site.
87
88
  */
88
- signatureHelp(uri: string, offset: number): string | undefined;
89
+ signatureHelp(uri: string, offset: number): any;
89
90
  /**
90
91
  * The pretty-printed syntax tree for `uri` (debugging); `undefined` for an unknown `uri`.
91
92
  */
92
93
  syntaxTree(uri: string): string | undefined;
93
94
  /**
94
- * Project-wide symbols matching `query`, as a JSON array string.
95
+ * Project-wide symbols matching `query`, as a JS array.
95
96
  */
96
- workspaceSymbols(query: string): string;
97
+ workspaceSymbols(query: string): any;
97
98
  }
98
99
 
99
100
  /**
@@ -108,24 +109,24 @@ export interface InitOutput {
108
109
  readonly __wbg_analyzer_free: (a: number, b: number) => void;
109
110
  readonly analyzer_changeDocument: (a: number, b: number, c: number, d: number, e: number) => void;
110
111
  readonly analyzer_closeDocument: (a: number, b: number, c: number) => void;
111
- readonly analyzer_codeActions: (a: number, b: number, c: number, d: number) => [number, number];
112
- readonly analyzer_completions: (a: number, b: number, c: number, d: number) => [number, number];
113
- readonly analyzer_diagnostics: (a: number, b: number, c: number) => [number, number];
114
- readonly analyzer_documentSymbols: (a: number, b: number, c: number) => [number, number];
115
- readonly analyzer_findReferences: (a: number, b: number, c: number, d: number) => [number, number];
116
- readonly analyzer_foldingRanges: (a: number, b: number, c: number) => [number, number];
117
- readonly analyzer_gotoDefinition: (a: number, b: number, c: number, d: number) => [number, number];
118
- readonly analyzer_hover: (a: number, b: number, c: number, d: number) => [number, number];
119
- readonly analyzer_inlayHints: (a: number, b: number, c: number) => [number, number];
112
+ readonly analyzer_codeActions: (a: number, b: number, c: number, d: number) => any;
113
+ readonly analyzer_completions: (a: number, b: number, c: number, d: number) => any;
114
+ readonly analyzer_diagnostics: (a: number, b: number, c: number) => any;
115
+ readonly analyzer_documentSymbols: (a: number, b: number, c: number) => any;
116
+ readonly analyzer_findReferences: (a: number, b: number, c: number, d: number) => any;
117
+ readonly analyzer_foldingRanges: (a: number, b: number, c: number) => any;
118
+ readonly analyzer_gotoDefinition: (a: number, b: number, c: number, d: number) => any;
119
+ readonly analyzer_hover: (a: number, b: number, c: number, d: number) => any;
120
+ readonly analyzer_inlayHints: (a: number, b: number, c: number) => any;
120
121
  readonly analyzer_isOpen: (a: number, b: number, c: number) => number;
121
122
  readonly analyzer_loadEngineApi: (a: number, b: number, c: number) => number;
122
123
  readonly analyzer_new: () => number;
123
124
  readonly analyzer_openDocument: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
124
- readonly analyzer_rename: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
125
+ readonly analyzer_rename: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
125
126
  readonly analyzer_setProjectConfig: (a: number, b: number, c: number) => void;
126
- readonly analyzer_signatureHelp: (a: number, b: number, c: number, d: number) => [number, number];
127
+ readonly analyzer_signatureHelp: (a: number, b: number, c: number, d: number) => any;
127
128
  readonly analyzer_syntaxTree: (a: number, b: number, c: number) => [number, number];
128
- readonly analyzer_workspaceSymbols: (a: number, b: number, c: number) => [number, number];
129
+ readonly analyzer_workspaceSymbols: (a: number, b: number, c: number) => any;
129
130
  readonly start: () => void;
130
131
  readonly __wbindgen_free_command_export: (a: number, b: number, c: number) => void;
131
132
  readonly __wbindgen_malloc_command_export: (a: number, b: number) => number;
package/gdscript_wasm.js CHANGED
@@ -39,177 +39,109 @@ export class Analyzer {
39
39
  wasm.analyzer_closeDocument(this.__wbg_ptr, ptr0, len0);
40
40
  }
41
41
  /**
42
- * Code actions at a byte `offset` in `uri`, as a JSON array string.
42
+ * Code actions at a byte `offset` in `uri`, as a JS array.
43
43
  * @param {string} uri
44
44
  * @param {number} offset
45
- * @returns {string}
45
+ * @returns {any}
46
46
  */
47
47
  codeActions(uri, offset) {
48
- let deferred2_0;
49
- let deferred2_1;
50
- try {
51
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
52
- const len0 = WASM_VECTOR_LEN;
53
- const ret = wasm.analyzer_codeActions(this.__wbg_ptr, ptr0, len0, offset);
54
- deferred2_0 = ret[0];
55
- deferred2_1 = ret[1];
56
- return getStringFromWasm0(ret[0], ret[1]);
57
- } finally {
58
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
59
- }
48
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
49
+ const len0 = WASM_VECTOR_LEN;
50
+ const ret = wasm.analyzer_codeActions(this.__wbg_ptr, ptr0, len0, offset);
51
+ return ret;
60
52
  }
61
53
  /**
62
- * Completions at a byte `offset` in `uri`, as a JSON array string.
54
+ * Completions at a byte `offset` in `uri`, as a JS array.
63
55
  * @param {string} uri
64
56
  * @param {number} offset
65
- * @returns {string}
57
+ * @returns {any}
66
58
  */
67
59
  completions(uri, offset) {
68
- let deferred2_0;
69
- let deferred2_1;
70
- try {
71
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
72
- const len0 = WASM_VECTOR_LEN;
73
- const ret = wasm.analyzer_completions(this.__wbg_ptr, ptr0, len0, offset);
74
- deferred2_0 = ret[0];
75
- deferred2_1 = ret[1];
76
- return getStringFromWasm0(ret[0], ret[1]);
77
- } finally {
78
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
79
- }
60
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
61
+ const len0 = WASM_VECTOR_LEN;
62
+ const ret = wasm.analyzer_completions(this.__wbg_ptr, ptr0, len0, offset);
63
+ return ret;
80
64
  }
81
65
  /**
82
- * Parse + type diagnostics for `uri`, as a JSON array string.
66
+ * Parse + type diagnostics for `uri`, as a JS array.
83
67
  * @param {string} uri
84
- * @returns {string}
68
+ * @returns {any}
85
69
  */
86
70
  diagnostics(uri) {
87
- let deferred2_0;
88
- let deferred2_1;
89
- try {
90
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
91
- const len0 = WASM_VECTOR_LEN;
92
- const ret = wasm.analyzer_diagnostics(this.__wbg_ptr, ptr0, len0);
93
- deferred2_0 = ret[0];
94
- deferred2_1 = ret[1];
95
- return getStringFromWasm0(ret[0], ret[1]);
96
- } finally {
97
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
98
- }
71
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
72
+ const len0 = WASM_VECTOR_LEN;
73
+ const ret = wasm.analyzer_diagnostics(this.__wbg_ptr, ptr0, len0);
74
+ return ret;
99
75
  }
100
76
  /**
101
- * The document outline for `uri`, as a JSON array string.
77
+ * The document outline for `uri`, as a JS array.
102
78
  * @param {string} uri
103
- * @returns {string}
79
+ * @returns {any}
104
80
  */
105
81
  documentSymbols(uri) {
106
- let deferred2_0;
107
- let deferred2_1;
108
- try {
109
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
110
- const len0 = WASM_VECTOR_LEN;
111
- const ret = wasm.analyzer_documentSymbols(this.__wbg_ptr, ptr0, len0);
112
- deferred2_0 = ret[0];
113
- deferred2_1 = ret[1];
114
- return getStringFromWasm0(ret[0], ret[1]);
115
- } finally {
116
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
117
- }
82
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
83
+ const len0 = WASM_VECTOR_LEN;
84
+ const ret = wasm.analyzer_documentSymbols(this.__wbg_ptr, ptr0, len0);
85
+ return ret;
118
86
  }
119
87
  /**
120
- * Every reference to the symbol at a byte `offset` in `uri`, as a JSON array string.
88
+ * Every reference to the symbol at a byte `offset` in `uri`, as a JS array (each carries a `uri`).
121
89
  * @param {string} uri
122
90
  * @param {number} offset
123
- * @returns {string}
91
+ * @returns {any}
124
92
  */
125
93
  findReferences(uri, offset) {
126
- let deferred2_0;
127
- let deferred2_1;
128
- try {
129
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
130
- const len0 = WASM_VECTOR_LEN;
131
- const ret = wasm.analyzer_findReferences(this.__wbg_ptr, ptr0, len0, offset);
132
- deferred2_0 = ret[0];
133
- deferred2_1 = ret[1];
134
- return getStringFromWasm0(ret[0], ret[1]);
135
- } finally {
136
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
137
- }
94
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
95
+ const len0 = WASM_VECTOR_LEN;
96
+ const ret = wasm.analyzer_findReferences(this.__wbg_ptr, ptr0, len0, offset);
97
+ return ret;
138
98
  }
139
99
  /**
140
- * Foldable ranges for `uri`, as a JSON array string.
100
+ * Foldable ranges for `uri`, as a JS array.
141
101
  * @param {string} uri
142
- * @returns {string}
102
+ * @returns {any}
143
103
  */
144
104
  foldingRanges(uri) {
145
- let deferred2_0;
146
- let deferred2_1;
147
- try {
148
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
149
- const len0 = WASM_VECTOR_LEN;
150
- const ret = wasm.analyzer_foldingRanges(this.__wbg_ptr, ptr0, len0);
151
- deferred2_0 = ret[0];
152
- deferred2_1 = ret[1];
153
- return getStringFromWasm0(ret[0], ret[1]);
154
- } finally {
155
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
156
- }
105
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
106
+ const len0 = WASM_VECTOR_LEN;
107
+ const ret = wasm.analyzer_foldingRanges(this.__wbg_ptr, ptr0, len0);
108
+ return ret;
157
109
  }
158
110
  /**
159
- * Go-to-definition target(s) for the symbol at a byte `offset` in `uri`, as a JSON array string.
111
+ * Go-to-definition target(s) for the symbol at a byte `offset` in `uri`, as a JS array (each
112
+ * target carries a `uri`).
160
113
  * @param {string} uri
161
114
  * @param {number} offset
162
- * @returns {string}
115
+ * @returns {any}
163
116
  */
164
117
  gotoDefinition(uri, offset) {
165
- let deferred2_0;
166
- let deferred2_1;
167
- try {
168
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
169
- const len0 = WASM_VECTOR_LEN;
170
- const ret = wasm.analyzer_gotoDefinition(this.__wbg_ptr, ptr0, len0, offset);
171
- deferred2_0 = ret[0];
172
- deferred2_1 = ret[1];
173
- return getStringFromWasm0(ret[0], ret[1]);
174
- } finally {
175
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
176
- }
118
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
119
+ const len0 = WASM_VECTOR_LEN;
120
+ const ret = wasm.analyzer_gotoDefinition(this.__wbg_ptr, ptr0, len0, offset);
121
+ return ret;
177
122
  }
178
123
  /**
179
- * Hover at a byte `offset` in `uri`; `undefined` when there is nothing typed there.
124
+ * Hover at a byte `offset` in `uri`; `null` when there is nothing typed there.
180
125
  * @param {string} uri
181
126
  * @param {number} offset
182
- * @returns {string | undefined}
127
+ * @returns {any}
183
128
  */
184
129
  hover(uri, offset) {
185
130
  const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
186
131
  const len0 = WASM_VECTOR_LEN;
187
132
  const ret = wasm.analyzer_hover(this.__wbg_ptr, ptr0, len0, offset);
188
- let v2;
189
- if (ret[0] !== 0) {
190
- v2 = getStringFromWasm0(ret[0], ret[1]).slice();
191
- wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
192
- }
193
- return v2;
133
+ return ret;
194
134
  }
195
135
  /**
196
- * Inlay hints for `uri`, as a JSON array string.
136
+ * Inlay hints for `uri`, as a JS array.
197
137
  * @param {string} uri
198
- * @returns {string}
138
+ * @returns {any}
199
139
  */
200
140
  inlayHints(uri) {
201
- let deferred2_0;
202
- let deferred2_1;
203
- try {
204
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
205
- const len0 = WASM_VECTOR_LEN;
206
- const ret = wasm.analyzer_inlayHints(this.__wbg_ptr, ptr0, len0);
207
- deferred2_0 = ret[0];
208
- deferred2_1 = ret[1];
209
- return getStringFromWasm0(ret[0], ret[1]);
210
- } finally {
211
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
212
- }
141
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
142
+ const len0 = WASM_VECTOR_LEN;
143
+ const ret = wasm.analyzer_inlayHints(this.__wbg_ptr, ptr0, len0);
144
+ return ret;
213
145
  }
214
146
  /**
215
147
  * Whether `uri` is currently open (distinguishes "not tracked" from a genuine empty result).
@@ -261,28 +193,20 @@ export class Analyzer {
261
193
  wasm.analyzer_openDocument(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
262
194
  }
263
195
  /**
264
- * Rename the symbol at a byte `offset` in `uri` to `newName`. JSON object string:
265
- * `{"ok": <SourceChange>}` | `{"error": <RenameError | reason>}`.
196
+ * Rename the symbol at a byte `offset` in `uri` to `newName`. A JS object:
197
+ * `{ ok: <SourceChange> }` | `{ error: <RenameError | reason> }` (edits carry a `uri`).
266
198
  * @param {string} uri
267
199
  * @param {number} offset
268
200
  * @param {string} new_name
269
- * @returns {string}
201
+ * @returns {any}
270
202
  */
271
203
  rename(uri, offset, new_name) {
272
- let deferred3_0;
273
- let deferred3_1;
274
- try {
275
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
276
- const len0 = WASM_VECTOR_LEN;
277
- const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
278
- const len1 = WASM_VECTOR_LEN;
279
- const ret = wasm.analyzer_rename(this.__wbg_ptr, ptr0, len0, offset, ptr1, len1);
280
- deferred3_0 = ret[0];
281
- deferred3_1 = ret[1];
282
- return getStringFromWasm0(ret[0], ret[1]);
283
- } finally {
284
- wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
285
- }
204
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
205
+ const len0 = WASM_VECTOR_LEN;
206
+ const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
207
+ const len1 = WASM_VECTOR_LEN;
208
+ const ret = wasm.analyzer_rename(this.__wbg_ptr, ptr0, len0, offset, ptr1, len1);
209
+ return ret;
286
210
  }
287
211
  /**
288
212
  * Set the project's `project.godot` text (enables `[autoload]` singleton resolution).
@@ -294,21 +218,16 @@ export class Analyzer {
294
218
  wasm.analyzer_setProjectConfig(this.__wbg_ptr, ptr0, len0);
295
219
  }
296
220
  /**
297
- * Signature help at a byte `offset` in `uri`; `undefined` when not at a call site.
221
+ * Signature help at a byte `offset` in `uri`; `null` when not at a call site.
298
222
  * @param {string} uri
299
223
  * @param {number} offset
300
- * @returns {string | undefined}
224
+ * @returns {any}
301
225
  */
302
226
  signatureHelp(uri, offset) {
303
227
  const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
304
228
  const len0 = WASM_VECTOR_LEN;
305
229
  const ret = wasm.analyzer_signatureHelp(this.__wbg_ptr, ptr0, len0, offset);
306
- let v2;
307
- if (ret[0] !== 0) {
308
- v2 = getStringFromWasm0(ret[0], ret[1]).slice();
309
- wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
310
- }
311
- return v2;
230
+ return ret;
312
231
  }
313
232
  /**
314
233
  * The pretty-printed syntax tree for `uri` (debugging); `undefined` for an unknown `uri`.
@@ -327,23 +246,15 @@ export class Analyzer {
327
246
  return v2;
328
247
  }
329
248
  /**
330
- * Project-wide symbols matching `query`, as a JSON array string.
249
+ * Project-wide symbols matching `query`, as a JS array.
331
250
  * @param {string} query
332
- * @returns {string}
251
+ * @returns {any}
333
252
  */
334
253
  workspaceSymbols(query) {
335
- let deferred2_0;
336
- let deferred2_1;
337
- try {
338
- const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
339
- const len0 = WASM_VECTOR_LEN;
340
- const ret = wasm.analyzer_workspaceSymbols(this.__wbg_ptr, ptr0, len0);
341
- deferred2_0 = ret[0];
342
- deferred2_1 = ret[1];
343
- return getStringFromWasm0(ret[0], ret[1]);
344
- } finally {
345
- wasm.__wbindgen_free_command_export(deferred2_0, deferred2_1, 1);
346
- }
254
+ const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ const ret = wasm.analyzer_workspaceSymbols(this.__wbg_ptr, ptr0, len0);
257
+ return ret;
347
258
  }
348
259
  }
349
260
  if (Symbol.dispose) Analyzer.prototype[Symbol.dispose] = Analyzer.prototype.free;
@@ -357,6 +268,14 @@ export function start() {
357
268
  function __wbg_get_imports() {
358
269
  const import0 = {
359
270
  __proto__: null,
271
+ __wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
272
+ const ret = Error(getStringFromWasm0(arg0, arg1));
273
+ return ret;
274
+ },
275
+ __wbg___wbindgen_is_string_1fca8072260dd261: function(arg0) {
276
+ const ret = typeof(arg0) === 'string';
277
+ return ret;
278
+ },
360
279
  __wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
361
280
  throw new Error(getStringFromWasm0(arg0, arg1));
362
281
  },
@@ -375,6 +294,28 @@ function __wbg_get_imports() {
375
294
  const ret = new Error();
376
295
  return ret;
377
296
  },
297
+ __wbg_new_2e117a478906f062: function() {
298
+ const ret = new Object();
299
+ return ret;
300
+ },
301
+ __wbg_new_3444eb7412549f0b: function() {
302
+ const ret = new Map();
303
+ return ret;
304
+ },
305
+ __wbg_new_36e147a8ced3c6e0: function() {
306
+ const ret = new Array();
307
+ return ret;
308
+ },
309
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
310
+ arg0[arg1] = arg2;
311
+ },
312
+ __wbg_set_9a1d61e17de7054c: function(arg0, arg1, arg2) {
313
+ const ret = arg0.set(arg1, arg2);
314
+ return ret;
315
+ },
316
+ __wbg_set_dc601f4a69da0bc2: function(arg0, arg1, arg2) {
317
+ arg0[arg1 >>> 0] = arg2;
318
+ },
378
319
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
379
320
  const ret = arg1.stack;
380
321
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
@@ -382,6 +323,26 @@ function __wbg_get_imports() {
382
323
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
383
324
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
384
325
  },
326
+ __wbindgen_cast_0000000000000001: function(arg0) {
327
+ // Cast intrinsic for `F64 -> Externref`.
328
+ const ret = arg0;
329
+ return ret;
330
+ },
331
+ __wbindgen_cast_0000000000000002: function(arg0) {
332
+ // Cast intrinsic for `I64 -> Externref`.
333
+ const ret = arg0;
334
+ return ret;
335
+ },
336
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
337
+ // Cast intrinsic for `Ref(String) -> Externref`.
338
+ const ret = getStringFromWasm0(arg0, arg1);
339
+ return ret;
340
+ },
341
+ __wbindgen_cast_0000000000000004: function(arg0) {
342
+ // Cast intrinsic for `U64 -> Externref`.
343
+ const ret = BigInt.asUintN(64, arg0);
344
+ return ret;
345
+ },
385
346
  __wbindgen_init_externref_table: function() {
386
347
  const table = wasm.__wbindgen_externrefs;
387
348
  const offset = table.grow(4);
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Yaniv Kalfa <yanivkalfa@gmail.com>"
6
6
  ],
7
7
  "description": "Run a full GDScript (Godot 4.x) static analyzer in the browser — diagnostics, type-aware hover, completion, symbols, navigation. The wasm-bindgen binding of gdscript-analyzer (Roslyn for Godot).",
8
- "version": "0.3.0",
8
+ "version": "0.4.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",