@webgal/language-service 0.0.2-alpha.2 → 0.0.2-alpha.3
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/index.cjs +1 -1
- package/build/index.d.cts +1 -1
- package/build/index.d.mts +1 -1
- package/build/index.mjs +1 -1
- package/build/monaco/index.cjs +1 -1
- package/build/monaco/index.d.cts +1 -1
- package/build/monaco/index.d.mts +1 -1
- package/build/monaco/index.mjs +1 -1
- package/build/{monaco-init-PW92JiUH.cjs → monaco-init-D-ukBToI.cjs} +18 -6
- package/build/{monaco-init-BR2AgVuN.d.mts → monaco-init-DCRVIFZj.d.mts} +1 -0
- package/build/{monaco-init-D6m312d3.mjs → monaco-init-ThX3sjkW.mjs} +18 -6
- package/build/{monaco-init-DUnVu1qx.d.cts → monaco-init-c5VtDwAb.d.cts} +1 -0
- package/build/node.d.cts +1 -1
- package/build/node.d.mts +1 -1
- package/package.json +2 -2
package/build/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_monaco_init = require('./monaco-init-
|
|
2
|
+
const require_monaco_init = require('./monaco-init-D-ukBToI.cjs');
|
|
3
3
|
require('./monaco/index.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/index.ts
|
package/build/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as VirtualFileSystem, D as WebgalClientHandlers, E as VolarWritableFileSystem, S as VirtualFileEntry, T as VirtualFileSystemChangeListener, _ as DirectoryEntry, a as createWebgalMonacoLanguageClientWithWorker, b as VirtualDirectoryEntry, c as pathToUri, d as createMemoryVolarFileSystem, f as createVirtualFileSystem, g as CreateWebgalClientHandlersOptions, h as registerWebgalClientHandlers, i as createWebgalMonacoLanguageClient, l as toVfsPath, m as createWebgalClientHandlers, n as CreateWebgalMonacoLanguageClientOptions, o as joinPaths, p as createVolarFileSystem, r as CreateWebgalMonacoLanguageClientWorkerOptions, s as normalizePath, t as initWebgalMonaco, u as uriToPath, v as LanguageClientLike, w as VirtualFileSystemChange, x as VirtualEntry, y as MaybePromise } from "./monaco-init-
|
|
1
|
+
import { C as VirtualFileSystem, D as WebgalClientHandlers, E as VolarWritableFileSystem, S as VirtualFileEntry, T as VirtualFileSystemChangeListener, _ as DirectoryEntry, a as createWebgalMonacoLanguageClientWithWorker, b as VirtualDirectoryEntry, c as pathToUri, d as createMemoryVolarFileSystem, f as createVirtualFileSystem, g as CreateWebgalClientHandlersOptions, h as registerWebgalClientHandlers, i as createWebgalMonacoLanguageClient, l as toVfsPath, m as createWebgalClientHandlers, n as CreateWebgalMonacoLanguageClientOptions, o as joinPaths, p as createVolarFileSystem, r as CreateWebgalMonacoLanguageClientWorkerOptions, s as normalizePath, t as initWebgalMonaco, u as uriToPath, v as LanguageClientLike, w as VirtualFileSystemChange, x as VirtualEntry, y as MaybePromise } from "./monaco-init-c5VtDwAb.cjs";
|
|
2
2
|
import "./monaco/index.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
package/build/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as VirtualFileSystem, D as WebgalClientHandlers, E as VolarWritableFileSystem, S as VirtualFileEntry, T as VirtualFileSystemChangeListener, _ as DirectoryEntry, a as createWebgalMonacoLanguageClientWithWorker, b as VirtualDirectoryEntry, c as pathToUri, d as createMemoryVolarFileSystem, f as createVirtualFileSystem, g as CreateWebgalClientHandlersOptions, h as registerWebgalClientHandlers, i as createWebgalMonacoLanguageClient, l as toVfsPath, m as createWebgalClientHandlers, n as CreateWebgalMonacoLanguageClientOptions, o as joinPaths, p as createVolarFileSystem, r as CreateWebgalMonacoLanguageClientWorkerOptions, s as normalizePath, t as initWebgalMonaco, u as uriToPath, v as LanguageClientLike, w as VirtualFileSystemChange, x as VirtualEntry, y as MaybePromise } from "./monaco-init-
|
|
1
|
+
import { C as VirtualFileSystem, D as WebgalClientHandlers, E as VolarWritableFileSystem, S as VirtualFileEntry, T as VirtualFileSystemChangeListener, _ as DirectoryEntry, a as createWebgalMonacoLanguageClientWithWorker, b as VirtualDirectoryEntry, c as pathToUri, d as createMemoryVolarFileSystem, f as createVirtualFileSystem, g as CreateWebgalClientHandlersOptions, h as registerWebgalClientHandlers, i as createWebgalMonacoLanguageClient, l as toVfsPath, m as createWebgalClientHandlers, n as CreateWebgalMonacoLanguageClientOptions, o as joinPaths, p as createVolarFileSystem, r as CreateWebgalMonacoLanguageClientWorkerOptions, s as normalizePath, t as initWebgalMonaco, u as uriToPath, v as LanguageClientLike, w as VirtualFileSystemChange, x as VirtualEntry, y as MaybePromise } from "./monaco-init-DCRVIFZj.mjs";
|
|
2
2
|
import "./monaco/index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
package/build/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as registerWebgalClientHandlers, c as createVolarFileSystem, d as pathToUri, f as toVfsPath, i as createWebgalClientHandlers, l as joinPaths, n as createWebgalMonacoLanguageClient, o as createMemoryVolarFileSystem, p as uriToPath, r as createWebgalMonacoLanguageClientWithWorker, s as createVirtualFileSystem, t as initWebgalMonaco, u as normalizePath } from "./monaco-init-
|
|
1
|
+
import { a as registerWebgalClientHandlers, c as createVolarFileSystem, d as pathToUri, f as toVfsPath, i as createWebgalClientHandlers, l as joinPaths, n as createWebgalMonacoLanguageClient, o as createMemoryVolarFileSystem, p as uriToPath, r as createWebgalMonacoLanguageClientWithWorker, s as createVirtualFileSystem, t as initWebgalMonaco, u as normalizePath } from "./monaco-init-ThX3sjkW.mjs";
|
|
2
2
|
import "./monaco/index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
package/build/monaco/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_monaco_init = require('../monaco-init-
|
|
2
|
+
const require_monaco_init = require('../monaco-init-D-ukBToI.cjs');
|
|
3
3
|
|
|
4
4
|
exports.createWebgalMonacoLanguageClient = require_monaco_init.createWebgalMonacoLanguageClient;
|
|
5
5
|
exports.createWebgalMonacoLanguageClientWithWorker = require_monaco_init.createWebgalMonacoLanguageClientWithWorker;
|
package/build/monaco/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createWebgalMonacoLanguageClientWithWorker, i as createWebgalMonacoLanguageClient, n as CreateWebgalMonacoLanguageClientOptions, r as CreateWebgalMonacoLanguageClientWorkerOptions, t as initWebgalMonaco } from "../monaco-init-
|
|
1
|
+
import { a as createWebgalMonacoLanguageClientWithWorker, i as createWebgalMonacoLanguageClient, n as CreateWebgalMonacoLanguageClientOptions, r as CreateWebgalMonacoLanguageClientWorkerOptions, t as initWebgalMonaco } from "../monaco-init-c5VtDwAb.cjs";
|
|
2
2
|
export { CreateWebgalMonacoLanguageClientOptions, CreateWebgalMonacoLanguageClientWorkerOptions, createWebgalMonacoLanguageClient, createWebgalMonacoLanguageClientWithWorker, initWebgalMonaco };
|
package/build/monaco/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createWebgalMonacoLanguageClientWithWorker, i as createWebgalMonacoLanguageClient, n as CreateWebgalMonacoLanguageClientOptions, r as CreateWebgalMonacoLanguageClientWorkerOptions, t as initWebgalMonaco } from "../monaco-init-
|
|
1
|
+
import { a as createWebgalMonacoLanguageClientWithWorker, i as createWebgalMonacoLanguageClient, n as CreateWebgalMonacoLanguageClientOptions, r as CreateWebgalMonacoLanguageClientWorkerOptions, t as initWebgalMonaco } from "../monaco-init-DCRVIFZj.mjs";
|
|
2
2
|
export { CreateWebgalMonacoLanguageClientOptions, CreateWebgalMonacoLanguageClientWorkerOptions, createWebgalMonacoLanguageClient, createWebgalMonacoLanguageClientWithWorker, initWebgalMonaco };
|
package/build/monaco/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as createWebgalMonacoLanguageClient, r as createWebgalMonacoLanguageClientWithWorker, t as initWebgalMonaco } from "../monaco-init-
|
|
1
|
+
import { n as createWebgalMonacoLanguageClient, r as createWebgalMonacoLanguageClientWithWorker, t as initWebgalMonaco } from "../monaco-init-ThX3sjkW.mjs";
|
|
2
2
|
|
|
3
3
|
export { createWebgalMonacoLanguageClient, createWebgalMonacoLanguageClientWithWorker, initWebgalMonaco };
|
|
@@ -39,7 +39,7 @@ const uriToPath = (value) => {
|
|
|
39
39
|
return normalizePath(uriString);
|
|
40
40
|
};
|
|
41
41
|
const pathToUri = (path) => {
|
|
42
|
-
if (path.startsWith("file://")) return vscode_uri.URI.
|
|
42
|
+
if (path.startsWith("file://")) return vscode_uri.URI.file(uriToPath(path));
|
|
43
43
|
if (/^[a-zA-Z]:[\\/]/.test(path)) return vscode_uri.URI.file(path);
|
|
44
44
|
if (path.startsWith("/")) return vscode_uri.URI.file(path);
|
|
45
45
|
return vscode_uri.URI.parse(path);
|
|
@@ -336,11 +336,12 @@ function createWebgalClientHandlers(options) {
|
|
|
336
336
|
return change;
|
|
337
337
|
};
|
|
338
338
|
return {
|
|
339
|
+
"workspace/documentLink/refresh": () => null,
|
|
339
340
|
"client/showTip": options.showTip ?? (() => null),
|
|
340
341
|
"client/currentDirectory": () => options.vfs.currentDirectory(),
|
|
341
342
|
"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),
|
|
343
|
+
"client/FStat": (path) => options.vfs.stat(toVfsPath(path)),
|
|
344
|
+
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(toVfsPath(startPath), targetName),
|
|
344
345
|
"client/goPropertyDoc": options.goPropertyDoc ?? (() => null),
|
|
345
346
|
"client/readDirectory": (uriString) => options.vfs.readDirectory(uriToPath(uriString)),
|
|
346
347
|
"client/getAllTextWithScene": () => options.vfs.getAllTextWithScene(),
|
|
@@ -415,9 +416,17 @@ const createWebgalMonacoLanguageClientWithWorker = (options) => {
|
|
|
415
416
|
const createLanguageClient = (messageTransports, options) => {
|
|
416
417
|
const handlers = createWebgalClientHandlers({
|
|
417
418
|
vfs: options.vfs,
|
|
418
|
-
overrides: {
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
overrides: {
|
|
420
|
+
"client/showTip": function(message) {
|
|
421
|
+
console.log(message);
|
|
422
|
+
},
|
|
423
|
+
"workspace/documentLink/refresh": () => {
|
|
424
|
+
const model = options.editor.getModel();
|
|
425
|
+
if (!model) return null;
|
|
426
|
+
options.editor.setModel(model);
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
421
430
|
});
|
|
422
431
|
const client = new monaco_languageclient.MonacoLanguageClient({
|
|
423
432
|
name: "WebGAL Language Client",
|
|
@@ -463,6 +472,9 @@ const createLanguageClient = (messageTransports, options) => {
|
|
|
463
472
|
messageTransports
|
|
464
473
|
});
|
|
465
474
|
registerWebgalClientHandlers(client, handlers);
|
|
475
|
+
options.vfs.onDidChange(() => {
|
|
476
|
+
client.sendNotification("webgal/vfsChanged");
|
|
477
|
+
});
|
|
466
478
|
return client;
|
|
467
479
|
};
|
|
468
480
|
|
|
@@ -65,6 +65,7 @@ type VirtualFileSystem = {
|
|
|
65
65
|
onDidChange: (listener: VirtualFileSystemChangeListener) => () => void;
|
|
66
66
|
};
|
|
67
67
|
type WebgalClientHandlers = {
|
|
68
|
+
"workspace/documentLink/refresh": () => MaybePromise<unknown>;
|
|
68
69
|
"client/showTip": (message: string) => MaybePromise<unknown>;
|
|
69
70
|
"client/currentDirectory": () => MaybePromise<string | null>;
|
|
70
71
|
"client/FJoin": (args: string | string[]) => MaybePromise<string | null>;
|
|
@@ -35,7 +35,7 @@ const uriToPath = (value) => {
|
|
|
35
35
|
return normalizePath(uriString);
|
|
36
36
|
};
|
|
37
37
|
const pathToUri = (path) => {
|
|
38
|
-
if (path.startsWith("file://")) return URI.
|
|
38
|
+
if (path.startsWith("file://")) return URI.file(uriToPath(path));
|
|
39
39
|
if (/^[a-zA-Z]:[\\/]/.test(path)) return URI.file(path);
|
|
40
40
|
if (path.startsWith("/")) return URI.file(path);
|
|
41
41
|
return URI.parse(path);
|
|
@@ -332,11 +332,12 @@ function createWebgalClientHandlers(options) {
|
|
|
332
332
|
return change;
|
|
333
333
|
};
|
|
334
334
|
return {
|
|
335
|
+
"workspace/documentLink/refresh": () => null,
|
|
335
336
|
"client/showTip": options.showTip ?? (() => null),
|
|
336
337
|
"client/currentDirectory": () => options.vfs.currentDirectory(),
|
|
337
338
|
"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),
|
|
339
|
+
"client/FStat": (path) => options.vfs.stat(toVfsPath(path)),
|
|
340
|
+
"client/findFile": ([startPath, targetName]) => options.vfs.findFile(toVfsPath(startPath), targetName),
|
|
340
341
|
"client/goPropertyDoc": options.goPropertyDoc ?? (() => null),
|
|
341
342
|
"client/readDirectory": (uriString) => options.vfs.readDirectory(uriToPath(uriString)),
|
|
342
343
|
"client/getAllTextWithScene": () => options.vfs.getAllTextWithScene(),
|
|
@@ -411,9 +412,17 @@ const createWebgalMonacoLanguageClientWithWorker = (options) => {
|
|
|
411
412
|
const createLanguageClient = (messageTransports, options) => {
|
|
412
413
|
const handlers = createWebgalClientHandlers({
|
|
413
414
|
vfs: options.vfs,
|
|
414
|
-
overrides: {
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
overrides: {
|
|
416
|
+
"client/showTip": function(message) {
|
|
417
|
+
console.log(message);
|
|
418
|
+
},
|
|
419
|
+
"workspace/documentLink/refresh": () => {
|
|
420
|
+
const model = options.editor.getModel();
|
|
421
|
+
if (!model) return null;
|
|
422
|
+
options.editor.setModel(model);
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
417
426
|
});
|
|
418
427
|
const client = new MonacoLanguageClient({
|
|
419
428
|
name: "WebGAL Language Client",
|
|
@@ -459,6 +468,9 @@ const createLanguageClient = (messageTransports, options) => {
|
|
|
459
468
|
messageTransports
|
|
460
469
|
});
|
|
461
470
|
registerWebgalClientHandlers(client, handlers);
|
|
471
|
+
options.vfs.onDidChange(() => {
|
|
472
|
+
client.sendNotification("webgal/vfsChanged");
|
|
473
|
+
});
|
|
462
474
|
return client;
|
|
463
475
|
};
|
|
464
476
|
|
|
@@ -65,6 +65,7 @@ type VirtualFileSystem = {
|
|
|
65
65
|
onDidChange: (listener: VirtualFileSystemChangeListener) => () => void;
|
|
66
66
|
};
|
|
67
67
|
type WebgalClientHandlers = {
|
|
68
|
+
"workspace/documentLink/refresh": () => MaybePromise<unknown>;
|
|
68
69
|
"client/showTip": (message: string) => MaybePromise<unknown>;
|
|
69
70
|
"client/currentDirectory": () => MaybePromise<string | null>;
|
|
70
71
|
"client/FJoin": (args: string | string[]) => MaybePromise<string | null>;
|
package/build/node.d.cts
CHANGED
package/build/node.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webgal/language-service",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "build/index.cjs",
|
|
6
6
|
"module": "build/index.mjs",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"vscode-uri": "^3.1.0",
|
|
72
72
|
"vscode-ws-jsonrpc": "^3.5.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "ebff8c309c7b7940bdebed1dc096d99a318af3cc"
|
|
75
75
|
}
|