@joinezco/codeblock 0.0.9 → 0.0.11

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.
Files changed (59) hide show
  1. package/dist/editor.d.ts +23 -2
  2. package/dist/editor.js +346 -41
  3. package/dist/index.d.ts +3 -2
  4. package/dist/index.js +3 -2
  5. package/dist/lsps/index.d.ts +5 -0
  6. package/dist/lsps/index.js +9 -2
  7. package/dist/panels/{footer.d.ts → settings.d.ts} +7 -1
  8. package/dist/panels/{footer.js → settings.js} +12 -3
  9. package/dist/panels/terminal.d.ts +3 -0
  10. package/dist/panels/terminal.js +76 -0
  11. package/dist/panels/toolbar.d.ts +40 -3
  12. package/dist/panels/toolbar.js +919 -160
  13. package/dist/themes/index.js +63 -17
  14. package/dist/types.d.ts +5 -0
  15. package/dist/utils/fs.d.ts +7 -0
  16. package/dist/utils/fs.js +41 -15
  17. package/dist/workers/fs.worker.d.ts +4 -8
  18. package/dist/workers/fs.worker.js +27 -53
  19. package/package.json +14 -12
  20. package/dist/assets/clike-C8IJ2oj_.js +0 -1
  21. package/dist/assets/cmake-BQqOBYOt.js +0 -1
  22. package/dist/assets/dockerfile-C_y-rIpk.js +0 -1
  23. package/dist/assets/fs.worker-DfanUHpQ.js +0 -21
  24. package/dist/assets/go-CTD25R5P.js +0 -1
  25. package/dist/assets/haskell-BWDZoCOh.js +0 -1
  26. package/dist/assets/index-BAnLzvMk.js +0 -1
  27. package/dist/assets/index-BBC9WDX6.js +0 -1
  28. package/dist/assets/index-BEXYxRro.js +0 -1
  29. package/dist/assets/index-BfYmUKH9.js +0 -13
  30. package/dist/assets/index-BhaTNAWE.js +0 -1
  31. package/dist/assets/index-CCbYDSng.js +0 -1
  32. package/dist/assets/index-CIi8tLT6.js +0 -1
  33. package/dist/assets/index-CaANcgI2.js +0 -3
  34. package/dist/assets/index-CkWzFNzm.js +0 -208
  35. package/dist/assets/index-D_XGv9QZ.js +0 -1
  36. package/dist/assets/index-DkmiPfkD.js +0 -1
  37. package/dist/assets/index-DmNlLMQ4.js +0 -6
  38. package/dist/assets/index-DmX_vI7D.js +0 -1
  39. package/dist/assets/index-DogEEevD.js +0 -1
  40. package/dist/assets/index-DsDl5qZV.js +0 -2
  41. package/dist/assets/index-gAy5mDg-.js +0 -1
  42. package/dist/assets/index-i5qJLB2h.js +0 -1
  43. package/dist/assets/javascript.worker-ClsyHOLi.js +0 -552
  44. package/dist/assets/lua-BgMRiT3U.js +0 -1
  45. package/dist/assets/perl-CdXCOZ3F.js +0 -1
  46. package/dist/assets/process-Dw9K5EnD.js +0 -1357
  47. package/dist/assets/properties-C78fOPTZ.js +0 -1
  48. package/dist/assets/ruby-B2Rjki9n.js +0 -1
  49. package/dist/assets/shell-CjFT_Tl9.js +0 -1
  50. package/dist/assets/swift-BzpIVaGY.js +0 -1
  51. package/dist/assets/toml-BXUEaScT.js +0 -1
  52. package/dist/assets/vb-CmGdzxic.js +0 -1
  53. package/dist/e2e/editor.spec.d.ts +0 -1
  54. package/dist/e2e/editor.spec.js +0 -309
  55. package/dist/e2e/example.spec.d.ts +0 -5
  56. package/dist/e2e/example.spec.js +0 -44
  57. package/dist/index.html +0 -15
  58. package/dist/resources/config.json +0 -13
  59. package/dist/styles.css +0 -7
@@ -43,16 +43,20 @@ export const codeblockTheme = EditorView.theme({
43
43
  color: 'var(--cm-search-result-color)',
44
44
  display: 'flex',
45
45
  cursor: 'pointer',
46
+ lineHeight: 1.4,
46
47
  '&.cm-command-result': {
47
48
  color: 'var(--cm-command-result-color)'
48
49
  },
49
50
  '& > .cm-search-result-icon-container': {
50
51
  width: 'var(--cm-gutter-width)',
52
+ minWidth: 'var(--cm-icon-col-width, 2ch)',
51
53
  '& > .cm-search-result-icon': {
52
54
  fontSize: FS,
53
- textAlign: 'center',
55
+ textAlign: 'right',
56
+ paddingRight: 'calc(1ch + 3px)',
54
57
  boxSizing: 'border-box',
55
58
  width: 'var(--cm-gutter-lineno-width)',
59
+ minWidth: 'var(--cm-icon-col-width, 2ch)',
56
60
  }
57
61
  },
58
62
  '&:hover': {
@@ -74,20 +78,21 @@ export const codeblockTheme = EditorView.theme({
74
78
  },
75
79
  '.cm-toolbar-state-icon-container': {
76
80
  width: 'var(--cm-gutter-width)',
81
+ minWidth: 'var(--cm-icon-col-width, 2ch)',
77
82
  display: 'flex',
78
83
  },
79
- // Nerd Font icon glyphs have visual widths (700-920 units) that far exceed
80
- // their monospace advance width (500 units), overflowing to the right.
81
- // text-align operates on the advance width, not the visual bounds, so
82
- // 'right' misaligns the icon. 'center' partially compensates for the
83
- // rightward overflow and visually aligns with gutter line numbers.
84
+ // Icon right-aligned to match CM's right-aligned line numbers.
85
+ // padding-right: 3px matches CM's .cm-gutterElement right padding.
84
86
  '.cm-toolbar-state-icon': {
85
87
  fontSize: FS,
86
88
  color: 'var(--cm-foreground)',
87
89
  fontFamily: 'var(--cm-icon-font-family)',
88
- textAlign: 'center',
90
+ paddingRight: 'calc(1ch + 3px)',
91
+ textAlign: 'right',
89
92
  boxSizing: 'border-box',
90
93
  width: 'var(--cm-gutter-lineno-width)',
94
+ minWidth: 'var(--cm-icon-col-width, 2ch)',
95
+ transition: 'opacity 0.15s ease',
91
96
  },
92
97
  '&': {
93
98
  fontSize: FS,
@@ -171,7 +176,7 @@ export const codeblockTheme = EditorView.theme({
171
176
  fontSize: FS,
172
177
  listStyleType: 'none',
173
178
  width: '100%',
174
- maxHeight: '25vh',
179
+ maxHeight: `calc(${FS} * 1.4 * 10)`,
175
180
  overflowY: 'auto',
176
181
  zIndex: 200,
177
182
  },
@@ -182,24 +187,27 @@ export const codeblockTheme = EditorView.theme({
182
187
  borderBottom: 'none',
183
188
  zIndex: 301,
184
189
  },
185
- // CSS border spinner for file loading indicator
190
+ // CSS border spinner for file loading indicator.
191
+ // Rendered as a separate element inside .cm-toolbar-state-icon-container,
192
+ // so it has fixed dimensions and doesn't inherit gutter-width sizing.
186
193
  '.cm-loading': {
187
194
  display: 'inline-block',
188
195
  width: FS,
189
196
  height: FS,
190
- border: '2px solid currentColor',
197
+ border: '2px solid var(--cm-foreground, currentColor)',
191
198
  borderTopColor: 'transparent',
192
199
  borderRadius: '50%',
193
200
  boxSizing: 'border-box',
194
201
  animation: 'cm-spin 0.8s linear infinite',
195
- marginLeft: '4px'
202
+ transition: 'opacity 0.15s ease-out',
203
+ margin: 'auto',
196
204
  },
197
205
  '@keyframes cm-spin': {
198
206
  '0%': { transform: 'rotate(0deg)' },
199
207
  '100%': { transform: 'rotate(360deg)' },
200
208
  },
201
- // Settings cog + LSP log button in toolbar (far right)
202
- '.cm-toolbar-settings-cog, .cm-toolbar-lsp-log': {
209
+ // LSP log button in toolbar (far right)
210
+ '.cm-toolbar-lsp-log': {
203
211
  border: 'none',
204
212
  background: 'transparent',
205
213
  color: 'var(--cm-toolbar-color)',
@@ -208,10 +216,6 @@ export const codeblockTheme = EditorView.theme({
208
216
  fontSize: FS_875,
209
217
  lineHeight: 'inherit',
210
218
  flexShrink: '0',
211
- transition: 'transform 0.25s ease',
212
- },
213
- '.cm-toolbar-settings-cog.cm-cog-active': {
214
- transform: 'rotate(90deg)',
215
219
  },
216
220
  // Settings / log overlay — anchored at top, grows downward
217
221
  '.cm-settings-overlay': {
@@ -333,4 +337,46 @@ export const codeblockTheme = EditorView.theme({
333
337
  '.cm-lsp-log-log': {
334
338
  opacity: '0.6',
335
339
  },
340
+ // Terminal panel
341
+ '.cm-terminal-panel': {
342
+ borderTop: '1px solid var(--cm-tooltip-border)',
343
+ display: 'flex',
344
+ flexDirection: 'column',
345
+ height: '200px',
346
+ minHeight: '80px',
347
+ },
348
+ '.cm-terminal-header': {
349
+ display: 'flex',
350
+ alignItems: 'center',
351
+ justifyContent: 'space-between',
352
+ padding: '2px 6px',
353
+ background: 'var(--cm-toolbar-background)',
354
+ fontSize: FS_85,
355
+ flexShrink: '0',
356
+ },
357
+ '.cm-terminal-title': {
358
+ opacity: '0.7',
359
+ fontFamily: 'var(--cm-font-family)',
360
+ },
361
+ '.cm-terminal-close': {
362
+ border: 'none',
363
+ background: 'transparent',
364
+ color: 'var(--cm-toolbar-color)',
365
+ cursor: 'pointer',
366
+ padding: '2px 4px',
367
+ fontSize: FS_875,
368
+ lineHeight: '1',
369
+ },
370
+ '.cm-terminal-container': {
371
+ flex: 1,
372
+ overflow: 'hidden',
373
+ },
374
+ // Auto-hide toolbar: JS manages retract/expand by toggling
375
+ // .cm-toolbar-retracted on .cm-panels-top (see toolbar.ts).
376
+ // The transition makes expand/retract feel smooth.
377
+ '& .cm-panels-top.cm-toolbar-retracted': {
378
+ maxHeight: '0px',
379
+ overflow: 'hidden',
380
+ transition: 'max-height 0.15s ease-out',
381
+ },
336
382
  });
package/dist/types.d.ts CHANGED
@@ -41,6 +41,11 @@ export interface VfsInterface {
41
41
  */
42
42
  exists: (path: string) => Promise<boolean>;
43
43
  stat: (path: string) => Promise<any | undefined>;
44
+ /**
45
+ * Deletes a file
46
+ * @param path A path to a file
47
+ */
48
+ unlink: (path: string) => Promise<void>;
44
49
  }
45
50
  export type FsMountOptions = {
46
51
  mount: (args: {
@@ -10,6 +10,13 @@ export declare namespace Vfs {
10
10
  const fromJswasiFs: (jswasiFs: TopLevelFs) => Promise<VfsInterface>;
11
11
  const fromMemfs: (fs: FsApi) => VfsInterface;
12
12
  const fromNodelike: (fs: typeof promises) => VfsInterface;
13
+ /**
14
+ * Create an FSA (File System Access / OPFS) backed filesystem.
15
+ * Data persists across page reloads via the browser's Origin Private File System.
16
+ *
17
+ * @param name - Unique name for the FSA storage bucket (default: 'codeblock')
18
+ */
19
+ const fsa: (name?: string) => Promise<VfsInterface>;
13
20
  /**
14
21
  * Create a filesystem worker with optional snapshot data.
15
22
  *
package/dist/utils/fs.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as Comlink from "comlink";
2
2
  import { watchOptionsTransferHandler, asyncGeneratorTransferHandler } from "../rpc/serde";
3
3
  import { FileType } from '@volar/language-service';
4
+ import { TopLevelFs } from "@joinezco/jswasi/filesystem";
4
5
  import { constants } from "@joinezco/jswasi";
5
6
  Comlink.transferHandlers.set("asyncGenerator", asyncGeneratorTransferHandler);
6
7
  Comlink.transferHandlers.set("watchOptions", watchOptionsTransferHandler);
@@ -114,13 +115,25 @@ export var Vfs;
114
115
  type: toVolarFileType(filestat.filetype),
115
116
  };
116
117
  },
118
+ async unlink(path) {
119
+ const abs = ensureAbs(path);
120
+ const res = await jswasiFs.removeEntry(abs, false);
121
+ if (res !== WASI_ESUCCESS) {
122
+ throw new Error(`unlink failed (${res}) for ${abs}`);
123
+ }
124
+ },
117
125
  };
118
126
  };
119
- // TODO: this is incorrect, fs is a Comlink proxy
120
127
  Vfs.fromMemfs = (fs) => {
121
128
  return {
122
129
  async readFile(path) {
123
- return fs.promises.readFile(path, { encoding: "utf-8" });
130
+ const result = await fs.promises.readFile(path, { encoding: "utf-8" });
131
+ // memfs may return a Buffer — ensure we return a string
132
+ if (typeof result === 'string')
133
+ return result;
134
+ if (result && typeof result.toString === 'function')
135
+ return result.toString('utf-8');
136
+ return String(result ?? '');
124
137
  },
125
138
  async writeFile(path, data) {
126
139
  await fs.promises.writeFile(path, data);
@@ -177,7 +190,10 @@ export var Vfs;
177
190
  catch (err) {
178
191
  return null;
179
192
  }
180
- }
193
+ },
194
+ async unlink(path) {
195
+ await fs.promises.unlink(path);
196
+ },
181
197
  };
182
198
  };
183
199
  Vfs.fromNodelike = (fs) => {
@@ -245,9 +261,25 @@ export var Vfs;
245
261
  catch (err) {
246
262
  return null;
247
263
  }
248
- }
264
+ },
265
+ async unlink(path) {
266
+ await fs.unlink(path);
267
+ },
249
268
  };
250
269
  };
270
+ /**
271
+ * Create an FSA (File System Access / OPFS) backed filesystem.
272
+ * Data persists across page reloads via the browser's Origin Private File System.
273
+ *
274
+ * @param name - Unique name for the FSA storage bucket (default: 'codeblock')
275
+ */
276
+ Vfs.fsa = async (name = 'codeblock') => {
277
+ const topFs = new TopLevelFs();
278
+ await topFs.addMount(
279
+ // @ts-ignore - TopLevelFs.addMount typing
280
+ undefined, "", undefined, "/", "fsa", 0n, { name, keepMetadata: "true", create: "true" });
281
+ return Vfs.fromJswasiFs(topFs);
282
+ };
251
283
  /**
252
284
  * Create a filesystem worker with optional snapshot data.
253
285
  *
@@ -260,24 +292,18 @@ export var Vfs;
260
292
  const worker = new SharedWorker(new URL('../workers/fs.worker.js', import.meta.url), { type: 'module' });
261
293
  worker.port.start();
262
294
  const proxy = Comlink.wrap(worker.port);
263
- let fs;
295
+ let vfs;
264
296
  if (!bufferOrUrl) {
265
- // No buffer or URL provided - create empty filesystem
266
- ({ fs } = await proxy.mount({ mountPoint: '/' }));
297
+ vfs = await proxy.mount({ mountPoint: '/' });
267
298
  }
268
299
  else if (typeof bufferOrUrl === 'string') {
269
- // URL provided - use optimized mountFromUrl for better performance
270
- ({ fs } = await proxy.mountFromUrl({
271
- url: bufferOrUrl,
272
- mountPoint: '/'
273
- }));
300
+ vfs = await proxy.mountFromUrl({ url: bufferOrUrl, mountPoint: '/' });
274
301
  }
275
302
  else {
276
- // Buffer provided - use traditional mount method
277
- ({ fs } = await proxy.mount(Comlink.transfer({ buffer: bufferOrUrl, mountPoint: "/" }, [bufferOrUrl])));
303
+ vfs = await proxy.mount(Comlink.transfer({ buffer: bufferOrUrl, mountPoint: "/" }, [bufferOrUrl]));
278
304
  }
279
305
  console.debug('Filesystem worker mounted');
280
- return Comlink.proxy(Vfs.fromMemfs(fs));
306
+ return vfs;
281
307
  };
282
308
  async function* walk(fs, path) {
283
309
  const files = await fs.readDir(path);
@@ -1,11 +1,7 @@
1
- import { MountArgs, MountResult } from "../types";
2
- export declare const mount: ({ buffer, mountPoint }: MountArgs) => Promise<MountResult>;
3
- /**
4
- * Optimized mount function that loads snapshots directly from URLs.
5
- * This is much more efficient for large snapshots as it avoids transferring
6
- * data through the main thread.
7
- */
1
+ import * as Comlink from "comlink";
2
+ import { MountArgs } from "../types";
3
+ export declare const mount: ({ buffer, mountPoint }: MountArgs) => Promise<import("..").VfsInterface & Comlink.ProxyMarked>;
8
4
  export declare const mountFromUrl: ({ url, mountPoint }: {
9
5
  url: string;
10
6
  mountPoint?: string;
11
- }) => Promise<MountResult>;
7
+ }) => Promise<import("..").VfsInterface & Comlink.ProxyMarked>;
@@ -2,82 +2,56 @@ import * as Comlink from "comlink";
2
2
  import { watchOptionsTransferHandler, asyncGeneratorTransferHandler } from '../rpc/serde';
3
3
  import { Snapshot } from "../utils";
4
4
  import { fs } from '@joinezco/memfs';
5
+ import { Vfs } from "../utils/fs";
5
6
  Comlink.transferHandlers.set('asyncGenerator', asyncGeneratorTransferHandler);
6
7
  Comlink.transferHandlers.set('watchOptions', watchOptionsTransferHandler);
7
8
  let filesystems = [];
9
+ // Create VfsInterface directly in the worker so all memfs calls are local (no nested Comlink proxies)
10
+ function createWorkerVfs() {
11
+ return Vfs.fromMemfs(fs);
12
+ }
8
13
  export const mount = async ({ buffer, mountPoint = '/' }) => {
9
- let filesystem;
10
14
  try {
11
- try {
12
- if (buffer) {
13
- console.debug(`Mounting filesystem snapshot at [${mountPoint}]...`, buffer);
14
- // Convert Node Buffer to ArrayBuffer if needed
15
- const uint8 = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
16
- const aligned = uint8.byteOffset === 0 && uint8.byteLength === uint8.buffer.byteLength
17
- ? uint8.buffer
18
- : uint8.buffer.slice(uint8.byteOffset, uint8.byteOffset + uint8.byteLength);
19
- await Snapshot.mount(new Uint8Array(aligned), {
20
- // @ts-ignore
21
- fs,
22
- });
23
- }
24
- else {
25
- console.debug('Getting storage directory...');
26
- // const handle = await navigator.storage.getDirectory();
27
- console.debug('Got storage directory');
28
- console.debug('Attempting to remove directory...');
29
- try {
30
- // TODO: clear storage button
31
- // @ts-ignore
32
- // await handle.remove({ recursive: true });
33
- console.debug('Successfully removed directory');
34
- }
35
- catch (removeErr) {
36
- console.error('Error removing directory:', removeErr);
37
- // Continue anyway, this might not be critical
38
- }
39
- }
40
- console.debug('Returning proxy from worker', fs);
41
- filesystem = Comlink.proxy({ fs });
42
- filesystems.push(filesystem);
43
- }
44
- catch (e) {
45
- console.error('Worker initialization failed with error:', e);
46
- throw e; // Make sure error propagates
15
+ if (buffer) {
16
+ console.debug(`Mounting filesystem snapshot at [${mountPoint}]...`, buffer);
17
+ const uint8 = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
18
+ const aligned = uint8.byteOffset === 0 && uint8.byteLength === uint8.buffer.byteLength
19
+ ? uint8.buffer
20
+ : uint8.buffer.slice(uint8.byteOffset, uint8.byteOffset + uint8.byteLength);
21
+ await Snapshot.mount(new Uint8Array(aligned), {
22
+ // @ts-ignore
23
+ fs,
24
+ });
47
25
  }
48
26
  }
49
27
  catch (e) {
50
- console.error('Error using memfs:', e);
28
+ console.error('Worker initialization failed:', e);
29
+ throw e;
51
30
  }
52
- console.debug('mounting fs', { buffer, mountPoint });
53
- return filesystem;
31
+ const vfs = createWorkerVfs();
32
+ const proxy = Comlink.proxy(vfs);
33
+ filesystems.push(proxy);
34
+ return proxy;
54
35
  };
55
- /**
56
- * Optimized mount function that loads snapshots directly from URLs.
57
- * This is much more efficient for large snapshots as it avoids transferring
58
- * data through the main thread.
59
- */
60
36
  export const mountFromUrl = async ({ url, mountPoint = '/' }) => {
61
- let filesystem;
62
37
  try {
63
- console.debug(`Loading and mounting filesystem snapshot from URL: ${url} at [${mountPoint}]...`);
38
+ console.debug(`Loading snapshot from URL: ${url} at [${mountPoint}]...`);
64
39
  const startTime = performance.now();
65
40
  await Snapshot.loadAndMount(url, {
66
41
  // @ts-ignore
67
42
  fs,
68
43
  path: mountPoint
69
44
  });
70
- const endTime = performance.now();
71
- console.debug(`Snapshot loaded and mounted in ${Math.round(endTime - startTime)}ms`);
72
- console.debug('Returning proxy from worker', fs);
73
- filesystem = Comlink.proxy({ fs });
74
- filesystems.push(filesystem);
45
+ console.debug(`Snapshot mounted in ${Math.round(performance.now() - startTime)}ms`);
75
46
  }
76
47
  catch (e) {
77
48
  console.error('Error loading snapshot from URL:', e);
78
49
  throw e;
79
50
  }
80
- return filesystem;
51
+ const vfs = createWorkerVfs();
52
+ const proxy = Comlink.proxy(vfs);
53
+ filesystems.push(proxy);
54
+ return proxy;
81
55
  };
82
56
  onconnect = async function (event) {
83
57
  const [port] = event.ports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joinezco/codeblock",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -21,18 +21,17 @@
21
21
  "@playwright/test": "^1.52.0",
22
22
  "@types/lodash": "^4.17.16",
23
23
  "@types/markdown-it": "^14.1.2",
24
- "@types/node": "^24.3.1",
24
+ "@types/node": "^25.5.0",
25
25
  "@types/parse-gitignore": "^1.0.2",
26
- "@types/sharedworker": "^0.0.181",
27
- "multimatch": "^7.0.0",
26
+ "@types/sharedworker": "^0.0.223",
27
+ "multimatch": "^8.0.0",
28
28
  "process": "^0.11.10",
29
29
  "puppeteer-core": "^24.37.5",
30
30
  "tsx": "^4.19.4",
31
- "vite": "^7.0.6",
32
- "vitest": "^3.2.4"
31
+ "vite": "^8.0.1",
32
+ "vitest": "^4.1.0"
33
33
  },
34
34
  "dependencies": {
35
- "@babel/runtime": "^7.27.1",
36
35
  "@codemirror/autocomplete": "^6.18.6",
37
36
  "@codemirror/commands": "^6.8.1",
38
37
  "@codemirror/lang-cpp": "^6.0.3",
@@ -67,6 +66,7 @@
67
66
  "@volar/typescript": "2.4.13",
68
67
  "comlink": "^4.4.2",
69
68
  "events": "^3.3.0",
69
+ "ghostty-web": "^0.4.0",
70
70
  "ignore": "^7.0.4",
71
71
  "lodash": "^4.17.21",
72
72
  "lz-string": "^1.5.0",
@@ -76,21 +76,23 @@
76
76
  "path-browserify": "^1.0.1",
77
77
  "style-mod": "^4.1.2",
78
78
  "typescript": "~5.9.2",
79
- "uuid": "^11.1.0",
80
- "vite-plugin-node-polyfills": "^0.24.0",
81
- "volar-service-typescript": "0.0.65",
79
+ "uuid": "^13.0.0",
80
+ "vite-plugin-node-polyfills": "^0.25.0",
81
+ "volar-service-typescript": "0.0.70",
82
82
  "vscode-languageserver": "^9.0.1",
83
83
  "vscode-languageserver-protocol": "^3.17.5",
84
84
  "vscode-languageserver-textdocument": "^1.0.12",
85
85
  "vscode-uri": "^3.1.0",
86
- "@joinezco/jswasi": "0.0.1",
87
86
  "@codemirror/lsp-client": "6.2.2",
87
+ "@joinezco/jswasi": "0.0.1",
88
88
  "@joinezco/memfs": "4.23.0"
89
89
  },
90
90
  "scripts": {
91
91
  "dev": "vite",
92
92
  "build": "tsc",
93
93
  "build:preview": "vite build",
94
- "preview": "vite preview"
94
+ "preview": "vite preview",
95
+ "test": "vitest run src/e2e/",
96
+ "test:e2e": "vitest run src/e2e/"
95
97
  }
96
98
  }
@@ -1 +0,0 @@
1
- function O(e,n,t,l,u,d){this.indented=e,this.column=n,this.type=t,this.info=l,this.align=u,this.prev=d}function D(e,n,t,l){var u=e.indented;return e.context&&e.context.type=="statement"&&t!="statement"&&(u=e.context.indented),e.context=new O(u,n,t,l,null,e.context)}function x(e){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}function V(e,n,t){if(n.prevToken=="variable"||n.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,t))||n.typeAtEndOfLine&&e.column()==e.indentation())return!0}function P(e){for(;;){if(!e||e.type=="top")return!0;if(e.type=="}"&&e.prev.info!="namespace")return!1;e=e.prev}}function h(e){var n=e.statementIndentUnit,t=e.dontAlignCalls,l=e.keywords||{},u=e.types||{},d=e.builtin||{},b=e.blockKeywords||{},_=e.defKeywords||{},w=e.atoms||{},y=e.hooks||{},te=e.multiLineStrings,re=e.indentStatements!==!1,ie=e.indentSwitch!==!1,F=e.namespaceSeparator,oe=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,ae=e.numberStart||/[\d\.]/,le=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,j=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,B=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/,U=e.isReservedIdentifier||!1,p,C;function K(i,a){var c=i.next();if(y[c]){var o=y[c](i,a);if(o!==!1)return o}if(c=='"'||c=="'")return a.tokenize=ce(c),a.tokenize(i,a);if(ae.test(c)){if(i.backUp(1),i.match(le))return"number";i.next()}if(oe.test(c))return p=c,null;if(c=="/"){if(i.eat("*"))return a.tokenize=A,A(i,a);if(i.eat("/"))return i.skipToEnd(),"comment"}if(j.test(c)){for(;!i.match(/^\/[\/*]/,!1)&&i.eat(j););return"operator"}if(i.eatWhile(B),F)for(;i.match(F);)i.eatWhile(B);var s=i.current();return m(l,s)?(m(b,s)&&(p="newstatement"),m(_,s)&&(C=!0),"keyword"):m(u,s)?"type":m(d,s)||U&&U(s)?(m(b,s)&&(p="newstatement"),"builtin"):m(w,s)?"atom":"variable"}function ce(i){return function(a,c){for(var o=!1,s,v=!1;(s=a.next())!=null;){if(s==i&&!o){v=!0;break}o=!o&&s=="\\"}return(v||!(o||te))&&(c.tokenize=null),"string"}}function A(i,a){for(var c=!1,o;o=i.next();){if(o=="/"&&c){a.tokenize=null;break}c=o=="*"}return"comment"}function $(i,a){e.typeFirstDefinitions&&i.eol()&&P(a.context)&&(a.typeAtEndOfLine=V(i,a,i.pos))}return{name:e.name,startState:function(i){return{tokenize:null,context:new O(-i,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(i,a){var c=a.context;if(i.sol()&&(c.align==null&&(c.align=!1),a.indented=i.indentation(),a.startOfLine=!0),i.eatSpace())return $(i,a),null;p=C=null;var o=(a.tokenize||K)(i,a);if(o=="comment"||o=="meta")return o;if(c.align==null&&(c.align=!0),p==";"||p==":"||p==","&&i.match(/^\s*(?:\/\/.*)?$/,!1))for(;a.context.type=="statement";)x(a);else if(p=="{")D(a,i.column(),"}");else if(p=="[")D(a,i.column(),"]");else if(p=="(")D(a,i.column(),")");else if(p=="}"){for(;c.type=="statement";)c=x(a);for(c.type=="}"&&(c=x(a));c.type=="statement";)c=x(a)}else p==c.type?x(a):re&&((c.type=="}"||c.type=="top")&&p!=";"||c.type=="statement"&&p=="newstatement")&&D(a,i.column(),"statement",i.current());if(o=="variable"&&(a.prevToken=="def"||e.typeFirstDefinitions&&V(i,a,i.start)&&P(a.context)&&i.match(/^\s*\(/,!1))&&(o="def"),y.token){var s=y.token(i,a,o);s!==void 0&&(o=s)}return o=="def"&&e.styleDefs===!1&&(o="variable"),a.startOfLine=!1,a.prevToken=C?"def":o||p,$(i,a),o},indent:function(i,a,c){if(i.tokenize!=K&&i.tokenize!=null||i.typeAtEndOfLine&&P(i.context))return null;var o=i.context,s=a&&a.charAt(0),v=s==o.type;if(o.type=="statement"&&s=="}"&&(o=o.prev),e.dontIndentStatements)for(;o.type=="statement"&&e.dontIndentStatements.test(o.info);)o=o.prev;if(y.indent){var q=y.indent(i,o,a,c.unit);if(typeof q=="number")return q}var ue=o.prev&&o.prev.info=="switch";if(e.allmanIndentation&&/[{(]/.test(s)){for(;o.type!="top"&&o.type!="}";)o=o.prev;return o.indented}return o.type=="statement"?o.indented+(s=="{"?0:n||c.unit):o.align&&(!t||o.type!=")")?o.column+(v?0:1):o.type==")"&&!v?o.indented+(n||c.unit):o.indented+(v?0:c.unit)+(!v&&ue&&!/^(?:case|default)\b/.test(a)?c.unit:0)},languageData:{indentOnInput:ie?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},autocomplete:Object.keys(l).concat(Object.keys(u)).concat(Object.keys(d)).concat(Object.keys(w)),...e.languageData}}}function r(e){for(var n={},t=e.split(" "),l=0;l<t.length;++l)n[t[l]]=!0;return n}function m(e,n){return typeof e=="function"?e(n):e.propertyIsEnumerable(n)}var T="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",H="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",Q="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",Z="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",se=r("int long char short double float unsigned signed void bool"),fe=r("SEL instancetype id Class Protocol BOOL");function I(e){return m(se,e)||/.+_t$/.test(e)}function X(e){return I(e)||m(fe,e)}var N="case do else for if switch while struct enum union",z="struct enum union";function g(e,n){if(!n.startOfLine)return!1;for(var t,l=null;t=e.peek();){if(t=="\\"&&e.match(/^.$/)){l=g;break}else if(t=="/"&&e.match(/^\/[\/\*]/,!1))break;e.next()}return n.tokenize=l,"meta"}function M(e,n){return n.prevToken=="type"?"type":!1}function E(e){return!e||e.length<2||e[0]!="_"?!1:e[1]=="_"||e[1]!==e[1].toLowerCase()}function f(e){return e.eatWhile(/[\w\.']/),"number"}function k(e,n){if(e.backUp(1),e.match(/^(?:R|u8R|uR|UR|LR)/)){var t=e.match(/^"([^\s\\()]{0,16})\(/);return t?(n.cpp11RawStringDelim=t[1],n.tokenize=G,G(e,n)):!1}return e.match(/^(?:u8|u|U|L)/)?e.match(/^["']/,!1)?"string":!1:(e.next(),!1)}function Y(e){var n=/(\w+)::~?(\w+)$/.exec(e);return n&&n[1]==n[2]}function W(e,n){for(var t;(t=e.next())!=null;)if(t=='"'&&!e.eat('"')){n.tokenize=null;break}return"string"}function G(e,n){var t=n.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),l=e.match(new RegExp(".*?\\)"+t+'"'));return l?n.tokenize=null:e.skipToEnd(),"string"}h({name:"c",keywords:r(T),types:I,blockKeywords:r(N),defKeywords:r(z),typeFirstDefinitions:!0,atoms:r("NULL true false"),isReservedIdentifier:E,hooks:{"#":g,"*":M}});h({name:"cpp",keywords:r(T+" "+H),types:I,blockKeywords:r(N+" class try catch"),defKeywords:r(z+" class namespace"),typeFirstDefinitions:!0,atoms:r("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:E,hooks:{"#":g,"*":M,u:k,U:k,L:k,R:k,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&Y(e.current()))return"def"}},namespaceSeparator:"::"});h({name:"java",keywords:r("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:r("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:r("catch class do else finally for if switch try while"),defKeywords:r("class interface enum @interface"),typeFirstDefinitions:!0,atoms:r("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return e.match("interface",!1)?!1:(e.eatWhile(/[\w\$_]/),"meta")},'"':function(e,n){return e.match(/""$/)?(n.tokenize=J,n.tokenize(e,n)):!1}}});const ke=h({name:"csharp",keywords:r("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:r("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:r("catch class do else finally for foreach if struct switch try while"),defKeywords:r("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:r("true false null"),hooks:{"@":function(e,n){return e.eat('"')?(n.tokenize=W,W(e,n)):(e.eatWhile(/[\w\$_]/),"meta")}}});function J(e,n){for(var t=!1;!e.eol();){if(!t&&e.match('"""')){n.tokenize=null;break}t=e.next()=="\\"&&!t}return"string"}function S(e){return function(n,t){for(var l;l=n.next();)if(l=="*"&&n.eat("/"))if(e==1){t.tokenize=null;break}else return t.tokenize=S(e-1),t.tokenize(n,t);else if(l=="/"&&n.eat("*"))return t.tokenize=S(e+1),t.tokenize(n,t);return"comment"}}const ge=h({name:"scala",keywords:r("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:r("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:r("catch class enum do else finally for forSome if match switch try while"),defKeywords:r("class enum def object package trait type val var"),atoms:r("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return e.match('""')?(n.tokenize=J,n.tokenize(e,n)):!1},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"character":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(e,n){var t=n.context;return t.type=="}"&&t.align&&e.eat(">")?(n.context=new O(t.indented,t.column,t.type,t.info,null,t.prev),"operator"):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function de(e){return function(n,t){for(var l=!1,u,d=!1;!n.eol();){if(!e&&!l&&n.match('"')){d=!0;break}if(e&&n.match('"""')){d=!0;break}u=n.next(),!l&&u=="$"&&n.match("{")&&n.skipTo("}"),l=!l&&u=="\\"&&!e}return(d||!e)&&(t.tokenize=null),"string"}}const be=h({name:"kotlin",keywords:r("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:r("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:r("catch class do else finally for if where try while enum"),defKeywords:r("class val var object interface fun"),atoms:r("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,n){return n.prevToken=="."?"variable":"operator"},'"':function(e,n){return n.tokenize=de(e.match('""')),n.tokenize(e,n)},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1},indent:function(e,n,t,l){var u=t&&t.charAt(0);if((e.prevToken=="}"||e.prevToken==")")&&t=="")return e.indented;if(e.prevToken=="operator"&&t!="}"&&e.context.type!="}"||e.prevToken=="variable"&&u=="."||(e.prevToken=="}"||e.prevToken==")")&&u==".")return l*2+n.indented;if(n.align&&n.type=="}")return n.indented+(e.context.type==(t||"").charAt(0)?0:l)}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});h({name:"shader",keywords:r("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:r("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:r("for while do if else struct"),builtin:r("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:r("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":g}});h({name:"nesc",keywords:r(T+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:I,blockKeywords:r(N),atoms:r("null true false"),hooks:{"#":g}});h({name:"objectivec",keywords:r(T+" "+Q),types:X,builtin:r(Z),blockKeywords:r(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:r(z+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:r("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:E,hooks:{"#":g,"*":M}});h({name:"objectivecpp",keywords:r(T+" "+Q+" "+H),types:X,builtin:r(Z),blockKeywords:r(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:r(z+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:r("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:E,hooks:{"#":g,"*":M,u:k,U:k,L:k,R:k,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&Y(e.current()))return"def"}},namespaceSeparator:"::"});h({name:"squirrel",keywords:r("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:I,blockKeywords:r("case catch class else for foreach if switch try while"),defKeywords:r("function local class"),typeFirstDefinitions:!0,atoms:r("true false null"),hooks:{"#":g}});var L=null;function ee(e){return function(n,t){for(var l=!1,u,d=!1;!n.eol();){if(!l&&n.match('"')&&(e=="single"||n.match('""'))){d=!0;break}if(!l&&n.match("``")){L=ee(e),d=!0;break}u=n.next(),l=e=="single"&&!l&&u=="\\"}return d&&(t.tokenize=null),"string"}}h({name:"ceylon",keywords:r("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var n=e.charAt(0);return n===n.toUpperCase()&&n!==n.toLowerCase()},blockKeywords:r("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:r("class dynamic function interface module object package value"),builtin:r("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:r("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return n.tokenize=ee(e.match('""')?"triple":"single"),n.tokenize(e,n)},"`":function(e,n){return!L||!e.match("`")?!1:(n.tokenize=L,L=null,n.tokenize(e,n))},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"string.special":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},token:function(e,n,t){if((t=="variable"||t=="type")&&n.prevToken==".")return"variableName.special"}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function pe(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function ne(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function he(e){return e.interpolationStack?e.interpolationStack.length:0}function R(e,n,t,l){var u=!1;if(n.eat(e))if(n.eat(e))u=!0;else return"string";function d(b,_){for(var w=!1;!b.eol();){if(!l&&!w&&b.peek()=="$")return pe(_),_.tokenize=ye,"string";var y=b.next();if(y==e&&!w&&(!u||b.match(e+e))){_.tokenize=null;break}w=!l&&!w&&y=="\\"}return"string"}return t.tokenize=d,d(n,t)}function ye(e,n){return e.eat("$"),e.eat("{")?n.tokenize=null:n.tokenize=me,null}function me(e,n){return e.eatWhile(/[\w_]/),n.tokenize=ne(n),"variable"}h({name:"dart",keywords:r("this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline"),blockKeywords:r("try catch finally do else for if switch while"),builtin:r("void bool num int double dynamic var String Null Never"),atoms:r("true false null"),number:/^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,n){return R("'",e,n,!1)},'"':function(e,n){return R('"',e,n,!1)},r:function(e,n){var t=e.peek();return t=="'"||t=='"'?R(e.next(),e,n,!0):!1},"}":function(e,n){return he(n)>0?(n.tokenize=ne(n),null):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1},token:function(e,n,t){if(t=="variable"){var l=RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g");if(l.test(e.current()))return"type"}}}});export{h as clike,ke as csharp,be as kotlin,ge as scala};
@@ -1 +0,0 @@
1
- var c=/({)?[a-zA-Z0-9_]+(})?/;function t(n,i){for(var e,r,u=!1;!n.eol()&&(e=n.next())!=i.pending;){if(e==="$"&&r!="\\"&&i.pending=='"'){u=!0;break}r=e}return u&&n.backUp(1),e==i.pending?i.continueString=!1:i.continueString=!0,"string"}function f(n,i){var e=n.next();return e==="$"?n.match(c)?"variableName.special":"variable":i.continueString?(n.backUp(1),t(n,i)):n.match(/(\s+)?\w+\(/)||n.match(/(\s+)?\w+\ \(/)?(n.backUp(1),"def"):e=="#"?(n.skipToEnd(),"comment"):e=="'"||e=='"'?(i.pending=e,t(n,i)):e=="("||e==")"?"bracket":e.match(/[0-9]/)?"number":(n.eatWhile(/[\w-]/),null)}const a={name:"cmake",startState:function(){var n={};return n.inDefinition=!1,n.inInclude=!1,n.continueString=!1,n.pending=!1,n},token:function(n,i){return n.eatSpace()?null:f(n,i)}};export{a as cmake};
@@ -1 +0,0 @@
1
- function c(n){a(n,"start");var t={},e=n.languageData||{},l=!1;for(var s in n)if(s!=e&&n.hasOwnProperty(s))for(var u=t[s]=[],o=n[s],r=0;r<o.length;r++){var i=o[r];u.push(new w(i,n)),(i.indent||i.dedent)&&(l=!0)}return{name:e.name,startState:function(){return{state:"start",pending:null,indent:l?[]:null}},copyState:function(g){var x={state:g.state,pending:g.pending,indent:g.indent&&g.indent.slice(0)};return g.stack&&(x.stack=g.stack.slice(0)),x},token:v(t),indent:R(t,e),mergeTokens:e.mergeTokens,languageData:e}}function a(n,t){if(!n.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function h(n,t){if(!n)return/(?:)/;var e="";return n instanceof RegExp?(n.ignoreCase&&(e="i"),n=n.source):n=String(n),new RegExp("^(?:"+n+")",e)}function y(n){if(!n)return null;if(n.apply)return n;if(typeof n=="string")return n.replace(/\./g," ");for(var t=[],e=0;e<n.length;e++)t.push(n[e]&&n[e].replace(/\./g," "));return t}function w(n,t){(n.next||n.push)&&a(t,n.next||n.push),this.regex=h(n.regex),this.token=y(n.token),this.data=n}function v(n){return function(t,e){if(e.pending){var l=e.pending.shift();return e.pending.length==0&&(e.pending=null),t.pos+=l.text.length,l.token}for(var s=n[e.state],u=0;u<s.length;u++){var o=s[u],r=(!o.data.sol||t.sol())&&t.match(o.regex);if(r){o.data.next?e.state=o.data.next:o.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=o.data.push):o.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),o.data.indent&&e.indent.push(t.indentation()+t.indentUnit),o.data.dedent&&e.indent.pop();var i=o.token;if(i&&i.apply&&(i=i(r)),r.length>2&&o.token&&typeof o.token!="string"){e.pending=[];for(var g=2;g<r.length;g++)r[g]&&e.pending.push({text:r[g],token:o.token[g-1]});return t.backUp(r[0].length-(r[1]?r[1].length:0)),i[0]}else return i&&i.join?i[0]:i}}return t.next(),null}}function R(n,t){return function(e,l){if(e.indent==null||t.dontIndentStates&&t.dontIndentStates.indexOf(e.state)>-1)return null;var s=e.indent.length-1,u=n[e.state];n:for(;;){for(var o=0;o<u.length;o++){var r=u[o];if(r.data.dedent&&r.data.dedentIfLineStart!==!1){var i=r.regex.exec(l);if(i&&i[0]){s--,(r.next||r.push)&&(u=n[r.next||r.push]),l=l.slice(i[0].length);continue n}}}break}return s<0?0:e.indent[s]}}var p="from",m=new RegExp("^(\\s*)\\b("+p+")\\b","i"),d=["run","cmd","entrypoint","shell"],$=new RegExp("^(\\s*)("+d.join("|")+")(\\s+\\[)","i"),f="expose",b=new RegExp("^(\\s*)("+f+")(\\s+)","i"),S=["arg","from","maintainer","label","env","add","copy","volume","user","workdir","onbuild","stopsignal","healthcheck","shell"],E=[p,f].concat(d).concat(S),k="("+E.join("|")+")",I=new RegExp("^(\\s*)"+k+"(\\s*)(#.*)?$","i"),O=new RegExp("^(\\s*)"+k+"(\\s+)","i");const T=c({start:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:m,token:[null,"keyword"],sol:!0,next:"from"},{regex:I,token:[null,"keyword",null,"error"],sol:!0},{regex:$,token:[null,"keyword",null],sol:!0,next:"array"},{regex:b,token:[null,"keyword",null],sol:!0,next:"expose"},{regex:O,token:[null,"keyword",null],sol:!0,next:"arguments"},{regex:/./,token:null}],from:[{regex:/\s*$/,token:null,next:"start"},{regex:/(\s*)(#.*)$/,token:[null,"error"],next:"start"},{regex:/(\s*\S+\s+)(as)/i,token:[null,"keyword"],next:"start"},{token:null,next:"start"}],single:[{regex:/(?:[^\\']|\\.)/,token:"string"},{regex:/'/,token:"string",pop:!0}],double:[{regex:/(?:[^\\"]|\\.)/,token:"string"},{regex:/"/,token:"string",pop:!0}],array:[{regex:/\]/,token:null,next:"start"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"}],expose:[{regex:/\d+$/,token:"number",next:"start"},{regex:/[^\d]+$/,token:null,next:"start"},{regex:/\d+/,token:"number"},{regex:/[^\d]+/,token:null},{token:null,next:"start"}],arguments:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:/"(?:[^\\"]|\\.)*"?$/,token:"string",next:"start"},{regex:/"/,token:"string",push:"double"},{regex:/'(?:[^\\']|\\.)*'?$/,token:"string",next:"start"},{regex:/'/,token:"string",push:"single"},{regex:/[^#"']+[\\`]$/,token:null},{regex:/[^#"']+$/,token:null,next:"start"},{regex:/[^#"']+/,token:null},{token:null,next:"start"}],languageData:{commentTokens:{line:"#"}}});export{T as dockerFile};