@webgal/language-service 0.0.2-alpha.2 → 0.0.2-alpha.4
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/build/{monaco-init-D6m312d3.mjs → client-handlers-CrU8stw6.mjs} +5 -181
- package/build/{monaco-init-PW92JiUH.cjs → client-handlers-DVUjG46C.cjs} +4 -201
- package/build/index-75hRTxvB.d.mts +24 -0
- package/build/index.cjs +11 -22
- package/build/index.d.cts +24 -6
- package/build/index.d.mts +6 -8
- package/build/index.mjs +2 -9
- package/build/monaco/index.cjs +203 -4
- package/build/monaco/index.d.cts +605 -2
- package/build/monaco/index.d.mts +607 -2
- package/build/monaco/index.mjs +195 -2
- package/build/node.d.cts +1 -2
- package/build/node.d.mts +1 -2
- package/build/{monaco-init-BR2AgVuN.d.mts → types-BPQnQEAd.d.cts} +2 -49
- package/build/{monaco-init-DUnVu1qx.d.cts → types-FltMUZDB.d.mts} +2 -49
- package/package.json +7 -12
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import { webgalConfigGrammar, webgalGrammar, webgalLanguageConfiguration } from "./syntaxes.mjs";
|
|
2
|
-
import { webgalDarkTheme, webgalWhiteTheme } from "./themes.mjs";
|
|
3
|
-
import { createMemoryFileSystem } from "./index.mjs";
|
|
4
1
|
import { FileType } from "@volar/language-service";
|
|
5
2
|
import { URI } from "vscode-uri";
|
|
6
|
-
import { WebSocketMessageReader, WebSocketMessageWriter, toSocket } from "vscode-ws-jsonrpc";
|
|
7
|
-
import { BrowserMessageReader, BrowserMessageWriter, CloseAction, ErrorAction } from "vscode-languageclient/browser.js";
|
|
8
|
-
import { MonacoLanguageClient } from "monaco-languageclient";
|
|
9
|
-
import { initialize } from "@codingame/monaco-vscode-api";
|
|
10
|
-
import { ExtensionHostKind, registerExtension } from "@codingame/monaco-vscode-api/extensions";
|
|
11
|
-
import "vscode/localExtensionHost";
|
|
12
|
-
import getLanguagesServiceOverride from "@codingame/monaco-vscode-languages-service-override";
|
|
13
|
-
import getThemeServiceOverride from "@codingame/monaco-vscode-theme-service-override";
|
|
14
|
-
import getTextMateServiceOverride from "@codingame/monaco-vscode-textmate-service-override";
|
|
15
3
|
|
|
16
4
|
//#region src/vfs/utils.ts
|
|
17
5
|
const normalizePath = (input) => {
|
|
@@ -35,7 +23,7 @@ const uriToPath = (value) => {
|
|
|
35
23
|
return normalizePath(uriString);
|
|
36
24
|
};
|
|
37
25
|
const pathToUri = (path) => {
|
|
38
|
-
if (path.startsWith("file://")) return URI.
|
|
26
|
+
if (path.startsWith("file://")) return URI.file(uriToPath(path));
|
|
39
27
|
if (/^[a-zA-Z]:[\\/]/.test(path)) return URI.file(path);
|
|
40
28
|
if (path.startsWith("/")) return URI.file(path);
|
|
41
29
|
return URI.parse(path);
|
|
@@ -332,11 +320,12 @@ function createWebgalClientHandlers(options) {
|
|
|
332
320
|
return change;
|
|
333
321
|
};
|
|
334
322
|
return {
|
|
323
|
+
"workspace/documentLink/refresh": () => null,
|
|
335
324
|
"client/showTip": options.showTip ?? (() => null),
|
|
336
325
|
"client/currentDirectory": () => options.vfs.currentDirectory(),
|
|
337
326
|
"client/FJoin": (args) => options.vfs.join(...Array.isArray(args) ? args : [args]),
|
|
338
|
-
"client/FStat": (path) => options.vfs.stat(path),
|
|
339
|
-
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(startPath, targetName),
|
|
327
|
+
"client/FStat": (path) => options.vfs.stat(toVfsPath(path)),
|
|
328
|
+
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(toVfsPath(startPath), targetName),
|
|
340
329
|
"client/goPropertyDoc": options.goPropertyDoc ?? (() => null),
|
|
341
330
|
"client/readDirectory": (uriString) => options.vfs.readDirectory(uriToPath(uriString)),
|
|
342
331
|
"client/getAllTextWithScene": () => options.vfs.getAllTextWithScene(),
|
|
@@ -357,169 +346,4 @@ function registerWebgalClientHandlers(client, handlers) {
|
|
|
357
346
|
}
|
|
358
347
|
|
|
359
348
|
//#endregion
|
|
360
|
-
|
|
361
|
-
const createWebgalMonacoLanguageClient = (options) => {
|
|
362
|
-
const { languageServerUrl, editor } = options;
|
|
363
|
-
const editorInstance = editor;
|
|
364
|
-
const vfs = options.virtualFileSystem || createMemoryFileSystem({ root: "file:///game" });
|
|
365
|
-
if (!options.virtualFileSystem) {
|
|
366
|
-
vfs.writeFile("file:///game/scene/start.txt", "WebGal:Start;");
|
|
367
|
-
vfs.writeFile("file:///game/config.txt", "");
|
|
368
|
-
}
|
|
369
|
-
const webSocket = new WebSocket(languageServerUrl);
|
|
370
|
-
webSocket.onopen = () => {
|
|
371
|
-
const socket = toSocket(webSocket);
|
|
372
|
-
const reader = new WebSocketMessageReader(socket);
|
|
373
|
-
const languageClient = createLanguageClient({
|
|
374
|
-
reader,
|
|
375
|
-
writer: new WebSocketMessageWriter(socket)
|
|
376
|
-
}, {
|
|
377
|
-
editor: editorInstance,
|
|
378
|
-
vfs
|
|
379
|
-
});
|
|
380
|
-
languageClient.start();
|
|
381
|
-
reader.onClose(() => languageClient.stop());
|
|
382
|
-
};
|
|
383
|
-
return {
|
|
384
|
-
webSocket,
|
|
385
|
-
vfs
|
|
386
|
-
};
|
|
387
|
-
};
|
|
388
|
-
const createWebgalMonacoLanguageClientWithWorker = (options) => {
|
|
389
|
-
const { worker, editor } = options;
|
|
390
|
-
const editorInstance = editor;
|
|
391
|
-
const vfs = options.virtualFileSystem || createMemoryFileSystem({ root: "file:///game" });
|
|
392
|
-
if (!options.virtualFileSystem) {
|
|
393
|
-
vfs.writeFile("file:///game/scene/start.txt", "WebGal:Start;");
|
|
394
|
-
vfs.writeFile("file:///game/config.txt", "");
|
|
395
|
-
}
|
|
396
|
-
const languageClient = createLanguageClient({
|
|
397
|
-
reader: new BrowserMessageReader(worker),
|
|
398
|
-
writer: new BrowserMessageWriter(worker)
|
|
399
|
-
}, {
|
|
400
|
-
editor: editorInstance,
|
|
401
|
-
vfs
|
|
402
|
-
});
|
|
403
|
-
languageClient.start();
|
|
404
|
-
worker.onerror = () => languageClient.stop();
|
|
405
|
-
worker.onmessageerror = () => languageClient.stop();
|
|
406
|
-
return {
|
|
407
|
-
worker,
|
|
408
|
-
vfs
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
|
-
const createLanguageClient = (messageTransports, options) => {
|
|
412
|
-
const handlers = createWebgalClientHandlers({
|
|
413
|
-
vfs: options.vfs,
|
|
414
|
-
overrides: { "client/showTip": function(message) {
|
|
415
|
-
console.log(message);
|
|
416
|
-
} }
|
|
417
|
-
});
|
|
418
|
-
const client = new MonacoLanguageClient({
|
|
419
|
-
name: "WebGAL Language Client",
|
|
420
|
-
clientOptions: {
|
|
421
|
-
documentSelector: [
|
|
422
|
-
{
|
|
423
|
-
scheme: "file",
|
|
424
|
-
language: "webgal"
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
scheme: "file",
|
|
428
|
-
language: "webgal-config"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
scheme: "inmemory",
|
|
432
|
-
language: "webgal"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
scheme: "inmemory",
|
|
436
|
-
language: "webgal-config"
|
|
437
|
-
}
|
|
438
|
-
],
|
|
439
|
-
errorHandler: {
|
|
440
|
-
error: () => ({ action: ErrorAction.Continue }),
|
|
441
|
-
closed: () => ({ action: CloseAction.DoNotRestart })
|
|
442
|
-
},
|
|
443
|
-
synchronize: { configurationSection: ["webgal", "http"] },
|
|
444
|
-
initializationOptions() {
|
|
445
|
-
const model = options.editor.getModel();
|
|
446
|
-
return {
|
|
447
|
-
processId: Math.random(),
|
|
448
|
-
rootPath: "file:///game",
|
|
449
|
-
rootUri: "file:///game",
|
|
450
|
-
capabilities: {},
|
|
451
|
-
workspaceFolders: [{
|
|
452
|
-
uri: "file:///game",
|
|
453
|
-
name: "example"
|
|
454
|
-
}],
|
|
455
|
-
...model ? { textDocument: { uri: model.uri.toString() } } : {}
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
messageTransports
|
|
460
|
-
});
|
|
461
|
-
registerWebgalClientHandlers(client, handlers);
|
|
462
|
-
return client;
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region src/monaco/monaco-init.ts
|
|
467
|
-
let initPromise = null;
|
|
468
|
-
async function initWebgalMonaco() {
|
|
469
|
-
if (initPromise) return initPromise;
|
|
470
|
-
initPromise = (async () => {
|
|
471
|
-
const { registerFileUrl } = registerExtension({
|
|
472
|
-
name: "webgal",
|
|
473
|
-
publisher: "openwebgal",
|
|
474
|
-
version: "1.0.0",
|
|
475
|
-
engines: { vscode: "^1.0.0" },
|
|
476
|
-
activationEvents: ["onLanguage:webgal", "onLanguage:webgal-config"],
|
|
477
|
-
contributes: {
|
|
478
|
-
languages: [{
|
|
479
|
-
id: "webgal",
|
|
480
|
-
extensions: [".webgal"],
|
|
481
|
-
aliases: ["WebGAL"],
|
|
482
|
-
configuration: "./language-configuration.json"
|
|
483
|
-
}, {
|
|
484
|
-
id: "webgal-config",
|
|
485
|
-
extensions: [".webgal-config"],
|
|
486
|
-
aliases: ["WebGAL Config"]
|
|
487
|
-
}],
|
|
488
|
-
grammars: [{
|
|
489
|
-
language: "webgal",
|
|
490
|
-
scopeName: "source.webgal",
|
|
491
|
-
path: "./webgal.tmLanguage.json"
|
|
492
|
-
}, {
|
|
493
|
-
language: "webgal-config",
|
|
494
|
-
scopeName: "source.webgal-config",
|
|
495
|
-
path: "./webgal-config.tmLanguage.json"
|
|
496
|
-
}],
|
|
497
|
-
themes: [{
|
|
498
|
-
id: "webgal-dark",
|
|
499
|
-
label: "WebGAL Dark",
|
|
500
|
-
uiTheme: "vs-dark",
|
|
501
|
-
path: "./dark.json"
|
|
502
|
-
}, {
|
|
503
|
-
id: "webgal-white",
|
|
504
|
-
label: "WebGAL White",
|
|
505
|
-
uiTheme: "vs",
|
|
506
|
-
path: "./white.json"
|
|
507
|
-
}]
|
|
508
|
-
}
|
|
509
|
-
}, ExtensionHostKind.LocalProcess);
|
|
510
|
-
registerFileUrl("./webgal.tmLanguage.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(webgalGrammar)))), import.meta.url).href);
|
|
511
|
-
registerFileUrl("./webgal-config.tmLanguage.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(webgalConfigGrammar)))), import.meta.url).href);
|
|
512
|
-
registerFileUrl("./language-configuration.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(webgalLanguageConfiguration)))), import.meta.url).href);
|
|
513
|
-
registerFileUrl("./dark.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(webgalDarkTheme)))), import.meta.url).href);
|
|
514
|
-
registerFileUrl("./white.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(webgalWhiteTheme)))), import.meta.url).href);
|
|
515
|
-
await initialize({
|
|
516
|
-
...getTextMateServiceOverride(),
|
|
517
|
-
...getThemeServiceOverride(),
|
|
518
|
-
...getLanguagesServiceOverride()
|
|
519
|
-
});
|
|
520
|
-
})();
|
|
521
|
-
return initPromise;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
//#endregion
|
|
525
|
-
export { registerWebgalClientHandlers as a, createVolarFileSystem as c, pathToUri as d, toVfsPath as f, createWebgalClientHandlers as i, joinPaths as l, createWebgalMonacoLanguageClient as n, createMemoryVolarFileSystem as o, uriToPath as p, createWebgalMonacoLanguageClientWithWorker as r, createVirtualFileSystem as s, initWebgalMonaco as t, normalizePath as u };
|
|
349
|
+
export { createVolarFileSystem as a, pathToUri as c, createVirtualFileSystem as i, toVfsPath as l, registerWebgalClientHandlers as n, joinPaths as o, createMemoryVolarFileSystem as r, normalizePath as s, createWebgalClientHandlers as t, uriToPath as u };
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
2
|
-
const require_syntaxes = require('./syntaxes.cjs');
|
|
3
|
-
const require_themes = require('./themes.cjs');
|
|
4
|
-
const require_index = require('./index.cjs');
|
|
5
2
|
let _volar_language_service = require("@volar/language-service");
|
|
6
3
|
let vscode_uri = require("vscode-uri");
|
|
7
|
-
let vscode_ws_jsonrpc = require("vscode-ws-jsonrpc");
|
|
8
|
-
let vscode_languageclient_browser_js = require("vscode-languageclient/browser.js");
|
|
9
|
-
let monaco_languageclient = require("monaco-languageclient");
|
|
10
|
-
let _codingame_monaco_vscode_api = require("@codingame/monaco-vscode-api");
|
|
11
|
-
let _codingame_monaco_vscode_api_extensions = require("@codingame/monaco-vscode-api/extensions");
|
|
12
|
-
require("vscode/localExtensionHost");
|
|
13
|
-
let _codingame_monaco_vscode_languages_service_override = require("@codingame/monaco-vscode-languages-service-override");
|
|
14
|
-
_codingame_monaco_vscode_languages_service_override = require_chunk.__toESM(_codingame_monaco_vscode_languages_service_override);
|
|
15
|
-
let _codingame_monaco_vscode_theme_service_override = require("@codingame/monaco-vscode-theme-service-override");
|
|
16
|
-
_codingame_monaco_vscode_theme_service_override = require_chunk.__toESM(_codingame_monaco_vscode_theme_service_override);
|
|
17
|
-
let _codingame_monaco_vscode_textmate_service_override = require("@codingame/monaco-vscode-textmate-service-override");
|
|
18
|
-
_codingame_monaco_vscode_textmate_service_override = require_chunk.__toESM(_codingame_monaco_vscode_textmate_service_override);
|
|
19
4
|
|
|
20
5
|
//#region src/vfs/utils.ts
|
|
21
6
|
const normalizePath = (input) => {
|
|
@@ -39,7 +24,7 @@ const uriToPath = (value) => {
|
|
|
39
24
|
return normalizePath(uriString);
|
|
40
25
|
};
|
|
41
26
|
const pathToUri = (path) => {
|
|
42
|
-
if (path.startsWith("file://")) return vscode_uri.URI.
|
|
27
|
+
if (path.startsWith("file://")) return vscode_uri.URI.file(uriToPath(path));
|
|
43
28
|
if (/^[a-zA-Z]:[\\/]/.test(path)) return vscode_uri.URI.file(path);
|
|
44
29
|
if (path.startsWith("/")) return vscode_uri.URI.file(path);
|
|
45
30
|
return vscode_uri.URI.parse(path);
|
|
@@ -336,11 +321,12 @@ function createWebgalClientHandlers(options) {
|
|
|
336
321
|
return change;
|
|
337
322
|
};
|
|
338
323
|
return {
|
|
324
|
+
"workspace/documentLink/refresh": () => null,
|
|
339
325
|
"client/showTip": options.showTip ?? (() => null),
|
|
340
326
|
"client/currentDirectory": () => options.vfs.currentDirectory(),
|
|
341
327
|
"client/FJoin": (args) => options.vfs.join(...Array.isArray(args) ? args : [args]),
|
|
342
|
-
"client/FStat": (path) => options.vfs.stat(path),
|
|
343
|
-
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(startPath, targetName),
|
|
328
|
+
"client/FStat": (path) => options.vfs.stat(toVfsPath(path)),
|
|
329
|
+
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(toVfsPath(startPath), targetName),
|
|
344
330
|
"client/goPropertyDoc": options.goPropertyDoc ?? (() => null),
|
|
345
331
|
"client/readDirectory": (uriString) => options.vfs.readDirectory(uriToPath(uriString)),
|
|
346
332
|
"client/getAllTextWithScene": () => options.vfs.getAllTextWithScene(),
|
|
@@ -360,171 +346,6 @@ function registerWebgalClientHandlers(client, handlers) {
|
|
|
360
346
|
for (const [method, handler] of Object.entries(handlers)) client.onRequest(method, handler);
|
|
361
347
|
}
|
|
362
348
|
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region src/monaco/monaco.ts
|
|
365
|
-
const createWebgalMonacoLanguageClient = (options) => {
|
|
366
|
-
const { languageServerUrl, editor } = options;
|
|
367
|
-
const editorInstance = editor;
|
|
368
|
-
const vfs = options.virtualFileSystem || require_index.createMemoryFileSystem({ root: "file:///game" });
|
|
369
|
-
if (!options.virtualFileSystem) {
|
|
370
|
-
vfs.writeFile("file:///game/scene/start.txt", "WebGal:Start;");
|
|
371
|
-
vfs.writeFile("file:///game/config.txt", "");
|
|
372
|
-
}
|
|
373
|
-
const webSocket = new WebSocket(languageServerUrl);
|
|
374
|
-
webSocket.onopen = () => {
|
|
375
|
-
const socket = (0, vscode_ws_jsonrpc.toSocket)(webSocket);
|
|
376
|
-
const reader = new vscode_ws_jsonrpc.WebSocketMessageReader(socket);
|
|
377
|
-
const languageClient = createLanguageClient({
|
|
378
|
-
reader,
|
|
379
|
-
writer: new vscode_ws_jsonrpc.WebSocketMessageWriter(socket)
|
|
380
|
-
}, {
|
|
381
|
-
editor: editorInstance,
|
|
382
|
-
vfs
|
|
383
|
-
});
|
|
384
|
-
languageClient.start();
|
|
385
|
-
reader.onClose(() => languageClient.stop());
|
|
386
|
-
};
|
|
387
|
-
return {
|
|
388
|
-
webSocket,
|
|
389
|
-
vfs
|
|
390
|
-
};
|
|
391
|
-
};
|
|
392
|
-
const createWebgalMonacoLanguageClientWithWorker = (options) => {
|
|
393
|
-
const { worker, editor } = options;
|
|
394
|
-
const editorInstance = editor;
|
|
395
|
-
const vfs = options.virtualFileSystem || require_index.createMemoryFileSystem({ root: "file:///game" });
|
|
396
|
-
if (!options.virtualFileSystem) {
|
|
397
|
-
vfs.writeFile("file:///game/scene/start.txt", "WebGal:Start;");
|
|
398
|
-
vfs.writeFile("file:///game/config.txt", "");
|
|
399
|
-
}
|
|
400
|
-
const languageClient = createLanguageClient({
|
|
401
|
-
reader: new vscode_languageclient_browser_js.BrowserMessageReader(worker),
|
|
402
|
-
writer: new vscode_languageclient_browser_js.BrowserMessageWriter(worker)
|
|
403
|
-
}, {
|
|
404
|
-
editor: editorInstance,
|
|
405
|
-
vfs
|
|
406
|
-
});
|
|
407
|
-
languageClient.start();
|
|
408
|
-
worker.onerror = () => languageClient.stop();
|
|
409
|
-
worker.onmessageerror = () => languageClient.stop();
|
|
410
|
-
return {
|
|
411
|
-
worker,
|
|
412
|
-
vfs
|
|
413
|
-
};
|
|
414
|
-
};
|
|
415
|
-
const createLanguageClient = (messageTransports, options) => {
|
|
416
|
-
const handlers = createWebgalClientHandlers({
|
|
417
|
-
vfs: options.vfs,
|
|
418
|
-
overrides: { "client/showTip": function(message) {
|
|
419
|
-
console.log(message);
|
|
420
|
-
} }
|
|
421
|
-
});
|
|
422
|
-
const client = new monaco_languageclient.MonacoLanguageClient({
|
|
423
|
-
name: "WebGAL Language Client",
|
|
424
|
-
clientOptions: {
|
|
425
|
-
documentSelector: [
|
|
426
|
-
{
|
|
427
|
-
scheme: "file",
|
|
428
|
-
language: "webgal"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
scheme: "file",
|
|
432
|
-
language: "webgal-config"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
scheme: "inmemory",
|
|
436
|
-
language: "webgal"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
scheme: "inmemory",
|
|
440
|
-
language: "webgal-config"
|
|
441
|
-
}
|
|
442
|
-
],
|
|
443
|
-
errorHandler: {
|
|
444
|
-
error: () => ({ action: vscode_languageclient_browser_js.ErrorAction.Continue }),
|
|
445
|
-
closed: () => ({ action: vscode_languageclient_browser_js.CloseAction.DoNotRestart })
|
|
446
|
-
},
|
|
447
|
-
synchronize: { configurationSection: ["webgal", "http"] },
|
|
448
|
-
initializationOptions() {
|
|
449
|
-
const model = options.editor.getModel();
|
|
450
|
-
return {
|
|
451
|
-
processId: Math.random(),
|
|
452
|
-
rootPath: "file:///game",
|
|
453
|
-
rootUri: "file:///game",
|
|
454
|
-
capabilities: {},
|
|
455
|
-
workspaceFolders: [{
|
|
456
|
-
uri: "file:///game",
|
|
457
|
-
name: "example"
|
|
458
|
-
}],
|
|
459
|
-
...model ? { textDocument: { uri: model.uri.toString() } } : {}
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
|
-
messageTransports
|
|
464
|
-
});
|
|
465
|
-
registerWebgalClientHandlers(client, handlers);
|
|
466
|
-
return client;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
//#endregion
|
|
470
|
-
//#region src/monaco/monaco-init.ts
|
|
471
|
-
let initPromise = null;
|
|
472
|
-
async function initWebgalMonaco() {
|
|
473
|
-
if (initPromise) return initPromise;
|
|
474
|
-
initPromise = (async () => {
|
|
475
|
-
const { registerFileUrl } = (0, _codingame_monaco_vscode_api_extensions.registerExtension)({
|
|
476
|
-
name: "webgal",
|
|
477
|
-
publisher: "openwebgal",
|
|
478
|
-
version: "1.0.0",
|
|
479
|
-
engines: { vscode: "^1.0.0" },
|
|
480
|
-
activationEvents: ["onLanguage:webgal", "onLanguage:webgal-config"],
|
|
481
|
-
contributes: {
|
|
482
|
-
languages: [{
|
|
483
|
-
id: "webgal",
|
|
484
|
-
extensions: [".webgal"],
|
|
485
|
-
aliases: ["WebGAL"],
|
|
486
|
-
configuration: "./language-configuration.json"
|
|
487
|
-
}, {
|
|
488
|
-
id: "webgal-config",
|
|
489
|
-
extensions: [".webgal-config"],
|
|
490
|
-
aliases: ["WebGAL Config"]
|
|
491
|
-
}],
|
|
492
|
-
grammars: [{
|
|
493
|
-
language: "webgal",
|
|
494
|
-
scopeName: "source.webgal",
|
|
495
|
-
path: "./webgal.tmLanguage.json"
|
|
496
|
-
}, {
|
|
497
|
-
language: "webgal-config",
|
|
498
|
-
scopeName: "source.webgal-config",
|
|
499
|
-
path: "./webgal-config.tmLanguage.json"
|
|
500
|
-
}],
|
|
501
|
-
themes: [{
|
|
502
|
-
id: "webgal-dark",
|
|
503
|
-
label: "WebGAL Dark",
|
|
504
|
-
uiTheme: "vs-dark",
|
|
505
|
-
path: "./dark.json"
|
|
506
|
-
}, {
|
|
507
|
-
id: "webgal-white",
|
|
508
|
-
label: "WebGAL White",
|
|
509
|
-
uiTheme: "vs",
|
|
510
|
-
path: "./white.json"
|
|
511
|
-
}]
|
|
512
|
-
}
|
|
513
|
-
}, _codingame_monaco_vscode_api_extensions.ExtensionHostKind.LocalProcess);
|
|
514
|
-
registerFileUrl("./webgal.tmLanguage.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(require_syntaxes.webgalGrammar)))), require("url").pathToFileURL(__filename).href).href);
|
|
515
|
-
registerFileUrl("./webgal-config.tmLanguage.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(require_syntaxes.webgalConfigGrammar)))), require("url").pathToFileURL(__filename).href).href);
|
|
516
|
-
registerFileUrl("./language-configuration.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(require_syntaxes.webgalLanguageConfiguration)))), require("url").pathToFileURL(__filename).href).href);
|
|
517
|
-
registerFileUrl("./dark.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(require_themes.webgalDarkTheme)))), require("url").pathToFileURL(__filename).href).href);
|
|
518
|
-
registerFileUrl("./white.json", new URL("data:application/json;base64," + btoa(decodeURIComponent(encodeURIComponent(JSON.stringify(require_themes.webgalWhiteTheme)))), require("url").pathToFileURL(__filename).href).href);
|
|
519
|
-
await (0, _codingame_monaco_vscode_api.initialize)({
|
|
520
|
-
...(0, _codingame_monaco_vscode_textmate_service_override.default)(),
|
|
521
|
-
...(0, _codingame_monaco_vscode_theme_service_override.default)(),
|
|
522
|
-
...(0, _codingame_monaco_vscode_languages_service_override.default)()
|
|
523
|
-
});
|
|
524
|
-
})();
|
|
525
|
-
return initPromise;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
349
|
//#endregion
|
|
529
350
|
Object.defineProperty(exports, 'createMemoryVolarFileSystem', {
|
|
530
351
|
enumerable: true,
|
|
@@ -550,24 +371,6 @@ Object.defineProperty(exports, 'createWebgalClientHandlers', {
|
|
|
550
371
|
return createWebgalClientHandlers;
|
|
551
372
|
}
|
|
552
373
|
});
|
|
553
|
-
Object.defineProperty(exports, 'createWebgalMonacoLanguageClient', {
|
|
554
|
-
enumerable: true,
|
|
555
|
-
get: function () {
|
|
556
|
-
return createWebgalMonacoLanguageClient;
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
Object.defineProperty(exports, 'createWebgalMonacoLanguageClientWithWorker', {
|
|
560
|
-
enumerable: true,
|
|
561
|
-
get: function () {
|
|
562
|
-
return createWebgalMonacoLanguageClientWithWorker;
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
Object.defineProperty(exports, 'initWebgalMonaco', {
|
|
566
|
-
enumerable: true,
|
|
567
|
-
get: function () {
|
|
568
|
-
return initWebgalMonaco;
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
374
|
Object.defineProperty(exports, 'joinPaths', {
|
|
572
375
|
enumerable: true,
|
|
573
376
|
get: function () {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c as VirtualFileSystem, d as VolarWritableFileSystem, o as VirtualEntry } from "./types-FltMUZDB.mjs";
|
|
2
|
+
import { FileSystem } from "@volar/language-service";
|
|
3
|
+
import { URI } from "vscode-uri";
|
|
4
|
+
|
|
5
|
+
//#region src/vfs/adapter.d.ts
|
|
6
|
+
declare function createVirtualFileSystem(fs: VolarWritableFileSystem): VirtualFileSystem;
|
|
7
|
+
declare function createVolarFileSystem(vfs: VirtualFileSystem, options?: {
|
|
8
|
+
uriToPath?: (uri: URI) => string;
|
|
9
|
+
}): FileSystem;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/vfs/memory.d.ts
|
|
12
|
+
declare function createMemoryVolarFileSystem(options?: {
|
|
13
|
+
root?: string;
|
|
14
|
+
tree?: VirtualEntry;
|
|
15
|
+
}): VolarWritableFileSystem;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/vfs/utils.d.ts
|
|
18
|
+
declare const normalizePath: (input: string) => string;
|
|
19
|
+
declare const joinPaths: (...parts: string[]) => string;
|
|
20
|
+
declare const uriToPath: (value: string | URI) => string;
|
|
21
|
+
declare const pathToUri: (path: string) => URI;
|
|
22
|
+
declare const toVfsPath: (value: string) => string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { uriToPath as a, createVolarFileSystem as c, toVfsPath as i, normalizePath as n, createMemoryVolarFileSystem as o, pathToUri as r, createVirtualFileSystem as s, joinPaths as t };
|
package/build/index.cjs
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
require('./monaco/index.cjs');
|
|
2
|
+
const require_client_handlers = require('./client-handlers-DVUjG46C.cjs');
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.createWebgalClientHandlers = require_monaco_init.createWebgalClientHandlers;
|
|
16
|
-
exports.createWebgalMonacoLanguageClient = require_monaco_init.createWebgalMonacoLanguageClient;
|
|
17
|
-
exports.createWebgalMonacoLanguageClientWithWorker = require_monaco_init.createWebgalMonacoLanguageClientWithWorker;
|
|
18
|
-
exports.initWebgalMonaco = require_monaco_init.initWebgalMonaco;
|
|
19
|
-
exports.joinPaths = require_monaco_init.joinPaths;
|
|
20
|
-
exports.normalizePath = require_monaco_init.normalizePath;
|
|
21
|
-
exports.pathToUri = require_monaco_init.pathToUri;
|
|
22
|
-
exports.registerWebgalClientHandlers = require_monaco_init.registerWebgalClientHandlers;
|
|
23
|
-
exports.toVfsPath = require_monaco_init.toVfsPath;
|
|
24
|
-
exports.uriToPath = require_monaco_init.uriToPath;
|
|
4
|
+
exports.createMemoryVolarFileSystem = require_client_handlers.createMemoryVolarFileSystem;
|
|
5
|
+
exports.createVirtualFileSystem = require_client_handlers.createVirtualFileSystem;
|
|
6
|
+
exports.createVolarFileSystem = require_client_handlers.createVolarFileSystem;
|
|
7
|
+
exports.createWebgalClientHandlers = require_client_handlers.createWebgalClientHandlers;
|
|
8
|
+
exports.joinPaths = require_client_handlers.joinPaths;
|
|
9
|
+
exports.normalizePath = require_client_handlers.normalizePath;
|
|
10
|
+
exports.pathToUri = require_client_handlers.pathToUri;
|
|
11
|
+
exports.registerWebgalClientHandlers = require_client_handlers.registerWebgalClientHandlers;
|
|
12
|
+
exports.toVfsPath = require_client_handlers.toVfsPath;
|
|
13
|
+
exports.uriToPath = require_client_handlers.uriToPath;
|
package/build/index.d.cts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
1
|
+
import { a as VirtualDirectoryEntry, c as VirtualFileSystem, d as VolarWritableFileSystem, f as WebgalClientHandlers, i as MaybePromise, l as VirtualFileSystemChange, n as DirectoryEntry, o as VirtualEntry, r as LanguageClientLike, s as VirtualFileEntry, t as CreateWebgalClientHandlersOptions, u as VirtualFileSystemChangeListener } from "./types-BPQnQEAd.cjs";
|
|
2
|
+
import { FileSystem } from "@volar/language-service";
|
|
3
|
+
import { URI } from "vscode-uri";
|
|
3
4
|
|
|
4
|
-
//#region src/
|
|
5
|
-
declare function
|
|
5
|
+
//#region src/vfs/adapter.d.ts
|
|
6
|
+
declare function createVirtualFileSystem(fs: VolarWritableFileSystem): VirtualFileSystem;
|
|
7
|
+
declare function createVolarFileSystem(vfs: VirtualFileSystem, options?: {
|
|
8
|
+
uriToPath?: (uri: URI) => string;
|
|
9
|
+
}): FileSystem;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/vfs/memory.d.ts
|
|
12
|
+
declare function createMemoryVolarFileSystem(options?: {
|
|
6
13
|
root?: string;
|
|
7
14
|
tree?: VirtualEntry;
|
|
8
|
-
}):
|
|
15
|
+
}): VolarWritableFileSystem;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/vfs/utils.d.ts
|
|
18
|
+
declare const normalizePath: (input: string) => string;
|
|
19
|
+
declare const joinPaths: (...parts: string[]) => string;
|
|
20
|
+
declare const uriToPath: (value: string | URI) => string;
|
|
21
|
+
declare const pathToUri: (path: string) => URI;
|
|
22
|
+
declare const toVfsPath: (value: string) => string;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/client-handlers.d.ts
|
|
25
|
+
declare function createWebgalClientHandlers(options: CreateWebgalClientHandlersOptions): WebgalClientHandlers;
|
|
26
|
+
declare function registerWebgalClientHandlers(client: LanguageClientLike, handlers: Partial<WebgalClientHandlers>): void;
|
|
9
27
|
//#endregion
|
|
10
|
-
export { CreateWebgalClientHandlersOptions,
|
|
28
|
+
export { CreateWebgalClientHandlersOptions, DirectoryEntry, LanguageClientLike, MaybePromise, VirtualDirectoryEntry, VirtualEntry, VirtualFileEntry, VirtualFileSystem, VirtualFileSystemChange, VirtualFileSystemChangeListener, VolarWritableFileSystem, WebgalClientHandlers, createMemoryVolarFileSystem, createVirtualFileSystem, createVolarFileSystem, createWebgalClientHandlers, joinPaths, normalizePath, pathToUri, registerWebgalClientHandlers, toVfsPath, uriToPath };
|
package/build/index.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { a as VirtualDirectoryEntry, c as VirtualFileSystem, d as VolarWritableFileSystem, f as WebgalClientHandlers, i as MaybePromise, l as VirtualFileSystemChange, n as DirectoryEntry, o as VirtualEntry, r as LanguageClientLike, s as VirtualFileEntry, t as CreateWebgalClientHandlersOptions, u as VirtualFileSystemChangeListener } from "./types-FltMUZDB.mjs";
|
|
2
|
+
import { a as uriToPath, c as createVolarFileSystem, i as toVfsPath, n as normalizePath, o as createMemoryVolarFileSystem, r as pathToUri, s as createVirtualFileSystem, t as joinPaths } from "./index-75hRTxvB.mjs";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
5
|
-
declare function
|
|
6
|
-
|
|
7
|
-
tree?: VirtualEntry;
|
|
8
|
-
}): VirtualFileSystem;
|
|
4
|
+
//#region src/client-handlers.d.ts
|
|
5
|
+
declare function createWebgalClientHandlers(options: CreateWebgalClientHandlersOptions): WebgalClientHandlers;
|
|
6
|
+
declare function registerWebgalClientHandlers(client: LanguageClientLike, handlers: Partial<WebgalClientHandlers>): void;
|
|
9
7
|
//#endregion
|
|
10
|
-
export { CreateWebgalClientHandlersOptions,
|
|
8
|
+
export { CreateWebgalClientHandlersOptions, DirectoryEntry, LanguageClientLike, MaybePromise, VirtualDirectoryEntry, VirtualEntry, VirtualFileEntry, VirtualFileSystem, VirtualFileSystemChange, VirtualFileSystemChangeListener, VolarWritableFileSystem, WebgalClientHandlers, createMemoryVolarFileSystem, createVirtualFileSystem, createVolarFileSystem, createWebgalClientHandlers, joinPaths, normalizePath, pathToUri, registerWebgalClientHandlers, toVfsPath, uriToPath };
|
package/build/index.mjs
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import "./monaco/index.mjs";
|
|
1
|
+
import { a as createVolarFileSystem, c as pathToUri, i as createVirtualFileSystem, l as toVfsPath, n as registerWebgalClientHandlers, o as joinPaths, r as createMemoryVolarFileSystem, s as normalizePath, t as createWebgalClientHandlers, u as uriToPath } from "./client-handlers-CrU8stw6.mjs";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
function createMemoryFileSystem(options) {
|
|
6
|
-
return createVirtualFileSystem(createMemoryVolarFileSystem(options));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { createMemoryFileSystem, createMemoryVolarFileSystem, createVirtualFileSystem, createVolarFileSystem, createWebgalClientHandlers, createWebgalMonacoLanguageClient, createWebgalMonacoLanguageClientWithWorker, initWebgalMonaco, joinPaths, normalizePath, pathToUri, registerWebgalClientHandlers, toVfsPath, uriToPath };
|
|
3
|
+
export { createMemoryVolarFileSystem, createVirtualFileSystem, createVolarFileSystem, createWebgalClientHandlers, joinPaths, normalizePath, pathToUri, registerWebgalClientHandlers, toVfsPath, uriToPath };
|