@webgal/language-service 0.0.2-alpha.4 → 0.0.2-alpha.6

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 (35) hide show
  1. package/README.en.md +15 -0
  2. package/README.md +15 -0
  3. package/build/{client-handlers-CrU8stw6.mjs → client-handlers-B6JBICcy.mjs} +36 -1
  4. package/build/{client-handlers-DVUjG46C.cjs → client-handlers-BOZETgwF.cjs} +36 -1
  5. package/build/index-Bbu_H5AG.d.mts +46 -0
  6. package/build/index.cjs +1 -1
  7. package/build/index.d.cts +35 -1
  8. package/build/index.d.mts +14 -2
  9. package/build/index.mjs +1 -1
  10. package/build/monaco/index.cjs +34 -1
  11. package/build/monaco/index.d.cts +34 -1
  12. package/build/monaco/index.d.mts +35 -2
  13. package/build/monaco/index.mjs +34 -1
  14. package/build/node.d.cts +1 -1
  15. package/build/node.d.mts +1 -1
  16. package/build/providerState-Dip2XHx4.cjs +3133 -0
  17. package/build/providerState-_ZvKXErw.mjs +3127 -0
  18. package/build/syntaxes.cjs +1 -1
  19. package/build/syntaxes.mjs +1 -1
  20. package/build/themes.cjs +1 -1
  21. package/build/themes.mjs +1 -1
  22. package/build/types-B7zc-Eke.d.mts +166 -0
  23. package/build/types-DwRo8Zlp.d.cts +166 -0
  24. package/build/utils/index.cjs +4 -0
  25. package/build/utils/index.d.cts +15 -0
  26. package/build/utils/index.d.mts +15 -0
  27. package/build/utils/index.mjs +3 -0
  28. package/package.json +22 -10
  29. package/build/index-75hRTxvB.d.mts +0 -24
  30. package/build/types-BPQnQEAd.d.cts +0 -111
  31. package/build/types-FltMUZDB.d.mts +0 -111
  32. /package/build/{language-configuration-CXgHqltm.mjs → language-configuration-BpugOv-W.mjs} +0 -0
  33. /package/build/{language-configuration-Dogb_mCE.cjs → language-configuration-DsFXNyL0.cjs} +0 -0
  34. /package/build/{white-DKaUkz8d.cjs → white-C5tT5Wl0.cjs} +0 -0
  35. /package/build/{white-DO2qVBHF.mjs → white-kL9BQca_.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_language_configuration = require('./language-configuration-Dogb_mCE.cjs');
2
+ const require_language_configuration = require('./language-configuration-DsFXNyL0.cjs');
3
3
 
4
4
  //#region src/syntaxes.ts
5
5
  const webgalGrammar = require_language_configuration.webgal_tmLanguage_default;
@@ -1,4 +1,4 @@
1
- import { n as webgal_config_tmLanguage_default, r as webgal_tmLanguage_default, t as language_configuration_default } from "./language-configuration-CXgHqltm.mjs";
1
+ import { n as webgal_config_tmLanguage_default, r as webgal_tmLanguage_default, t as language_configuration_default } from "./language-configuration-BpugOv-W.mjs";
2
2
 
3
3
  //#region src/syntaxes.ts
4
4
  const webgalGrammar = webgal_tmLanguage_default;
package/build/themes.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_white = require('./white-DKaUkz8d.cjs');
2
+ const require_white = require('./white-C5tT5Wl0.cjs');
3
3
 
4
4
  //#region src/themes.ts
5
5
  const webgalDarkTheme = require_white.dark_default;
package/build/themes.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as dark_default, t as white_default } from "./white-DO2qVBHF.mjs";
1
+ import { n as dark_default, t as white_default } from "./white-kL9BQca_.mjs";
2
2
 
3
3
  //#region src/themes.ts
4
4
  const webgalDarkTheme = dark_default;
@@ -0,0 +1,166 @@
1
+ import { FileSystem } from "@volar/language-service";
2
+ import { URI } from "vscode-uri";
3
+
4
+ //#region src/vfs/types.d.ts
5
+ /**
6
+ * 目录条目类型
7
+ * 表示目录中的一个条目
8
+ */
9
+ type DirectoryEntry = {
10
+ /** 条目名称 */name: string; /** 是否为目录 */
11
+ isDirectory: boolean;
12
+ };
13
+ /**
14
+ * 虚拟文件条目类型
15
+ * 表示虚拟文件系统中的一个文件
16
+ */
17
+ type VirtualFileEntry = {
18
+ /** 条目类型标识 */type: "file"; /** 文件内容 */
19
+ content: string;
20
+ };
21
+ /**
22
+ * 虚拟目录条目类型
23
+ * 表示虚拟文件系统中的一个目录
24
+ */
25
+ type VirtualDirectoryEntry = {
26
+ /** 条目类型标识 */type: "dir"; /** 子条目映射,键为名称,值为虚拟条目 */
27
+ children: Record<string, VirtualEntry>;
28
+ };
29
+ /**
30
+ * 虚拟文件系统条目类型
31
+ * 可以是文件或目录
32
+ */
33
+ type VirtualEntry = VirtualFileEntry | VirtualDirectoryEntry;
34
+ /**
35
+ * 可能是Promise的类型
36
+ * 表示一个值或Promise包装的值
37
+ */
38
+ type MaybePromise<T> = T | Promise<T>;
39
+ /**
40
+ * 虚拟文件系统变更类型
41
+ * 表示虚拟文件系统中的各种变更操作
42
+ */
43
+ type VirtualFileSystemChange = {
44
+ type: "writeFile";
45
+ path: string;
46
+ content: string;
47
+ } | {
48
+ type: "deletePath";
49
+ path: string;
50
+ } | {
51
+ type: "mkdir";
52
+ path: string;
53
+ } | {
54
+ type: "rename";
55
+ from: string;
56
+ to: string;
57
+ } | {
58
+ type: "setTree";
59
+ tree: VirtualEntry;
60
+ };
61
+ /**
62
+ * 虚拟文件系统变更监听器类型
63
+ * 当文件系统发生变更时被调用
64
+ */
65
+ type VirtualFileSystemChangeListener = (/** 变更事件数组 */changes: VirtualFileSystemChange[]) => void;
66
+ /**
67
+ * 虚拟文件系统接口
68
+ * 定义了虚拟文件系统的所有操作方法
69
+ */
70
+ type VirtualFileSystem = {
71
+ /** 根目录路径 */root: string; /** 获取当前工作目录 */
72
+ currentDirectory: () => string | null; /** 拼接路径 */
73
+ join: (...parts: string[]) => string; /** 获取文件或目录状态 */
74
+ stat: (path: string) => Promise<{
75
+ isFile: boolean;
76
+ isDirectory: boolean;
77
+ } | null>; /** 读取目录内容 */
78
+ readDirectory: (path: string) => Promise<DirectoryEntry[] | null>; /** 读取文件内容 */
79
+ readFile: (path: string) => Promise<string | null>; /** 查找文件 */
80
+ findFile: (startPath: string, targetName: string) => Promise<string | null>; /** 获取资源目录 */
81
+ getResourceDirectory: (urls: string[]) => Promise<DirectoryEntry[] | null>; /** 获取所有场景文本 */
82
+ getAllTextWithScene: () => Promise<Record<string, {
83
+ path: string;
84
+ name: string;
85
+ text: string;
86
+ fullPath: string;
87
+ }> | null>; /** 获取文件树 */
88
+ getTree: () => VirtualEntry; /** 设置文件树 */
89
+ setTree: (tree: VirtualEntry) => void; /** 写入文件 */
90
+ writeFile: (path: string, content: string) => Promise<void>; /** 删除路径 */
91
+ deletePath: (path: string) => Promise<void>; /** 创建目录 */
92
+ mkdir: (path: string) => Promise<void>; /** 重命名文件或目录 */
93
+ rename: (from: string, to: string) => Promise<void>; /** 应用变更 */
94
+ applyChanges: (changes: VirtualFileSystemChange[]) => Promise<void>; /** 注册变更监听器,返回取消监听的函数 */
95
+ onDidChange: (listener: VirtualFileSystemChangeListener) => () => void;
96
+ };
97
+ /**
98
+ * WebGAL客户端处理器类型
99
+ * 定义了语言服务器可以调用的各种客户端方法
100
+ */
101
+ type WebgalClientHandlers = {
102
+ /** 刷新文档链接 */"workspace/documentLink/refresh": () => MaybePromise<unknown>; /** 显示提示信息 */
103
+ "client/showTip": (message: string) => MaybePromise<unknown>; /** 获取当前目录 */
104
+ "client/currentDirectory": () => MaybePromise<string | null>; /** 拼接路径 */
105
+ "client/FJoin": (args: string | string[]) => MaybePromise<string | null>; /** 获取文件状态 */
106
+ "client/FStat": (path: string) => MaybePromise<unknown>; /** 查找文件 */
107
+ "client/findFile": (args: [string, string]) => MaybePromise<string | null>; /** 跳转到属性文档 */
108
+ "client/goPropertyDoc": (pathSegments: string[]) => MaybePromise<unknown>; /** 读取目录 */
109
+ "client/readDirectory": (uriString: string) => MaybePromise<unknown>; /** 获取所有场景文本 */
110
+ "client/getAllTextWithScene": () => MaybePromise<unknown>; /** 获取资源目录 */
111
+ "client/getResourceDirectory": (urls: string[]) => MaybePromise<unknown>; /** 获取VFS文件树 */
112
+ "client/vfs/getTree": () => MaybePromise<VirtualEntry>; /** 设置VFS文件树 */
113
+ "client/vfs/setTree": (tree: VirtualEntry) => MaybePromise<unknown>; /** 读取VFS文件 */
114
+ "client/vfs/readFile": (path: string) => MaybePromise<string | null>; /** 写入VFS文件 */
115
+ "client/vfs/writeFile": (args: {
116
+ path: string;
117
+ content: string;
118
+ }) => MaybePromise<unknown>; /** 删除VFS路径 */
119
+ "client/vfs/deletePath": (path: string) => MaybePromise<unknown>; /** 创建VFS目录 */
120
+ "client/vfs/mkdir": (path: string) => MaybePromise<unknown>; /** 重命名VFS文件或目录 */
121
+ "client/vfs/rename": (args: {
122
+ from: string;
123
+ to: string;
124
+ }) => MaybePromise<unknown>; /** 应用VFS变更 */
125
+ "client/vfs/applyChanges": (changes: VirtualFileSystemChange[]) => MaybePromise<unknown>;
126
+ };
127
+ /**
128
+ * 语言客户端接口类型
129
+ * 定义了语言客户端的基本方法
130
+ */
131
+ type LanguageClientLike = {
132
+ /** 注册请求处理器 */onRequest: (method: string, handler: (...args: any[]) => unknown) => void;
133
+ };
134
+ /**
135
+ * 创建WebGAL客户端处理器的配置选项
136
+ */
137
+ type CreateWebgalClientHandlersOptions = {
138
+ /** 虚拟文件系统实例 */vfs: VirtualFileSystem; /** 显示提示的回调函数 */
139
+ showTip?: (message: string) => unknown; /** 跳转到属性文档的回调函数 */
140
+ goPropertyDoc?: (pathSegments: string[]) => unknown; /** 覆盖默认的处理器 */
141
+ overrides?: Partial<WebgalClientHandlers>;
142
+ };
143
+ /**
144
+ * Volar可写文件系统接口
145
+ * 扩展了Volar的FileSystem接口,添加了写操作和变更监听功能
146
+ */
147
+ interface VolarWritableFileSystem extends FileSystem {
148
+ /** 写入文件 */
149
+ writeFile(uri: URI, content: string): Promise<void>;
150
+ /** 创建目录 */
151
+ mkdir(uri: URI): Promise<void>;
152
+ /** 删除文件或目录 */
153
+ delete(uri: URI): Promise<void>;
154
+ /** 重命名文件或目录 */
155
+ rename(oldUri: URI, newUri: URI): Promise<void>;
156
+ /** 获取文件树 */
157
+ getTree(): VirtualEntry;
158
+ /** 设置文件树 */
159
+ setTree(tree: VirtualEntry): void;
160
+ /** 注册变更监听器,返回取消监听的函数 */
161
+ onDidChange(listener: VirtualFileSystemChangeListener): () => void;
162
+ /** 根目录路径 */
163
+ root: string;
164
+ }
165
+ //#endregion
166
+ export { VirtualDirectoryEntry as a, VirtualFileSystem as c, VolarWritableFileSystem as d, WebgalClientHandlers as f, MaybePromise as i, VirtualFileSystemChange as l, DirectoryEntry as n, VirtualEntry as o, LanguageClientLike as r, VirtualFileEntry as s, CreateWebgalClientHandlersOptions as t, VirtualFileSystemChangeListener as u };
@@ -0,0 +1,166 @@
1
+ import { FileSystem } from "@volar/language-service";
2
+ import { URI } from "vscode-uri";
3
+
4
+ //#region src/vfs/types.d.ts
5
+ /**
6
+ * 目录条目类型
7
+ * 表示目录中的一个条目
8
+ */
9
+ type DirectoryEntry = {
10
+ /** 条目名称 */name: string; /** 是否为目录 */
11
+ isDirectory: boolean;
12
+ };
13
+ /**
14
+ * 虚拟文件条目类型
15
+ * 表示虚拟文件系统中的一个文件
16
+ */
17
+ type VirtualFileEntry = {
18
+ /** 条目类型标识 */type: "file"; /** 文件内容 */
19
+ content: string;
20
+ };
21
+ /**
22
+ * 虚拟目录条目类型
23
+ * 表示虚拟文件系统中的一个目录
24
+ */
25
+ type VirtualDirectoryEntry = {
26
+ /** 条目类型标识 */type: "dir"; /** 子条目映射,键为名称,值为虚拟条目 */
27
+ children: Record<string, VirtualEntry>;
28
+ };
29
+ /**
30
+ * 虚拟文件系统条目类型
31
+ * 可以是文件或目录
32
+ */
33
+ type VirtualEntry = VirtualFileEntry | VirtualDirectoryEntry;
34
+ /**
35
+ * 可能是Promise的类型
36
+ * 表示一个值或Promise包装的值
37
+ */
38
+ type MaybePromise<T> = T | Promise<T>;
39
+ /**
40
+ * 虚拟文件系统变更类型
41
+ * 表示虚拟文件系统中的各种变更操作
42
+ */
43
+ type VirtualFileSystemChange = {
44
+ type: "writeFile";
45
+ path: string;
46
+ content: string;
47
+ } | {
48
+ type: "deletePath";
49
+ path: string;
50
+ } | {
51
+ type: "mkdir";
52
+ path: string;
53
+ } | {
54
+ type: "rename";
55
+ from: string;
56
+ to: string;
57
+ } | {
58
+ type: "setTree";
59
+ tree: VirtualEntry;
60
+ };
61
+ /**
62
+ * 虚拟文件系统变更监听器类型
63
+ * 当文件系统发生变更时被调用
64
+ */
65
+ type VirtualFileSystemChangeListener = (/** 变更事件数组 */changes: VirtualFileSystemChange[]) => void;
66
+ /**
67
+ * 虚拟文件系统接口
68
+ * 定义了虚拟文件系统的所有操作方法
69
+ */
70
+ type VirtualFileSystem = {
71
+ /** 根目录路径 */root: string; /** 获取当前工作目录 */
72
+ currentDirectory: () => string | null; /** 拼接路径 */
73
+ join: (...parts: string[]) => string; /** 获取文件或目录状态 */
74
+ stat: (path: string) => Promise<{
75
+ isFile: boolean;
76
+ isDirectory: boolean;
77
+ } | null>; /** 读取目录内容 */
78
+ readDirectory: (path: string) => Promise<DirectoryEntry[] | null>; /** 读取文件内容 */
79
+ readFile: (path: string) => Promise<string | null>; /** 查找文件 */
80
+ findFile: (startPath: string, targetName: string) => Promise<string | null>; /** 获取资源目录 */
81
+ getResourceDirectory: (urls: string[]) => Promise<DirectoryEntry[] | null>; /** 获取所有场景文本 */
82
+ getAllTextWithScene: () => Promise<Record<string, {
83
+ path: string;
84
+ name: string;
85
+ text: string;
86
+ fullPath: string;
87
+ }> | null>; /** 获取文件树 */
88
+ getTree: () => VirtualEntry; /** 设置文件树 */
89
+ setTree: (tree: VirtualEntry) => void; /** 写入文件 */
90
+ writeFile: (path: string, content: string) => Promise<void>; /** 删除路径 */
91
+ deletePath: (path: string) => Promise<void>; /** 创建目录 */
92
+ mkdir: (path: string) => Promise<void>; /** 重命名文件或目录 */
93
+ rename: (from: string, to: string) => Promise<void>; /** 应用变更 */
94
+ applyChanges: (changes: VirtualFileSystemChange[]) => Promise<void>; /** 注册变更监听器,返回取消监听的函数 */
95
+ onDidChange: (listener: VirtualFileSystemChangeListener) => () => void;
96
+ };
97
+ /**
98
+ * WebGAL客户端处理器类型
99
+ * 定义了语言服务器可以调用的各种客户端方法
100
+ */
101
+ type WebgalClientHandlers = {
102
+ /** 刷新文档链接 */"workspace/documentLink/refresh": () => MaybePromise<unknown>; /** 显示提示信息 */
103
+ "client/showTip": (message: string) => MaybePromise<unknown>; /** 获取当前目录 */
104
+ "client/currentDirectory": () => MaybePromise<string | null>; /** 拼接路径 */
105
+ "client/FJoin": (args: string | string[]) => MaybePromise<string | null>; /** 获取文件状态 */
106
+ "client/FStat": (path: string) => MaybePromise<unknown>; /** 查找文件 */
107
+ "client/findFile": (args: [string, string]) => MaybePromise<string | null>; /** 跳转到属性文档 */
108
+ "client/goPropertyDoc": (pathSegments: string[]) => MaybePromise<unknown>; /** 读取目录 */
109
+ "client/readDirectory": (uriString: string) => MaybePromise<unknown>; /** 获取所有场景文本 */
110
+ "client/getAllTextWithScene": () => MaybePromise<unknown>; /** 获取资源目录 */
111
+ "client/getResourceDirectory": (urls: string[]) => MaybePromise<unknown>; /** 获取VFS文件树 */
112
+ "client/vfs/getTree": () => MaybePromise<VirtualEntry>; /** 设置VFS文件树 */
113
+ "client/vfs/setTree": (tree: VirtualEntry) => MaybePromise<unknown>; /** 读取VFS文件 */
114
+ "client/vfs/readFile": (path: string) => MaybePromise<string | null>; /** 写入VFS文件 */
115
+ "client/vfs/writeFile": (args: {
116
+ path: string;
117
+ content: string;
118
+ }) => MaybePromise<unknown>; /** 删除VFS路径 */
119
+ "client/vfs/deletePath": (path: string) => MaybePromise<unknown>; /** 创建VFS目录 */
120
+ "client/vfs/mkdir": (path: string) => MaybePromise<unknown>; /** 重命名VFS文件或目录 */
121
+ "client/vfs/rename": (args: {
122
+ from: string;
123
+ to: string;
124
+ }) => MaybePromise<unknown>; /** 应用VFS变更 */
125
+ "client/vfs/applyChanges": (changes: VirtualFileSystemChange[]) => MaybePromise<unknown>;
126
+ };
127
+ /**
128
+ * 语言客户端接口类型
129
+ * 定义了语言客户端的基本方法
130
+ */
131
+ type LanguageClientLike = {
132
+ /** 注册请求处理器 */onRequest: (method: string, handler: (...args: any[]) => unknown) => void;
133
+ };
134
+ /**
135
+ * 创建WebGAL客户端处理器的配置选项
136
+ */
137
+ type CreateWebgalClientHandlersOptions = {
138
+ /** 虚拟文件系统实例 */vfs: VirtualFileSystem; /** 显示提示的回调函数 */
139
+ showTip?: (message: string) => unknown; /** 跳转到属性文档的回调函数 */
140
+ goPropertyDoc?: (pathSegments: string[]) => unknown; /** 覆盖默认的处理器 */
141
+ overrides?: Partial<WebgalClientHandlers>;
142
+ };
143
+ /**
144
+ * Volar可写文件系统接口
145
+ * 扩展了Volar的FileSystem接口,添加了写操作和变更监听功能
146
+ */
147
+ interface VolarWritableFileSystem extends FileSystem {
148
+ /** 写入文件 */
149
+ writeFile(uri: URI, content: string): Promise<void>;
150
+ /** 创建目录 */
151
+ mkdir(uri: URI): Promise<void>;
152
+ /** 删除文件或目录 */
153
+ delete(uri: URI): Promise<void>;
154
+ /** 重命名文件或目录 */
155
+ rename(oldUri: URI, newUri: URI): Promise<void>;
156
+ /** 获取文件树 */
157
+ getTree(): VirtualEntry;
158
+ /** 设置文件树 */
159
+ setTree(tree: VirtualEntry): void;
160
+ /** 注册变更监听器,返回取消监听的函数 */
161
+ onDidChange(listener: VirtualFileSystemChangeListener): () => void;
162
+ /** 根目录路径 */
163
+ root: string;
164
+ }
165
+ //#endregion
166
+ export { VirtualDirectoryEntry as a, VirtualFileSystem as c, VolarWritableFileSystem as d, WebgalClientHandlers as f, MaybePromise as i, VirtualFileSystemChange as l, DirectoryEntry as n, VirtualEntry as o, LanguageClientLike as r, VirtualFileEntry as s, CreateWebgalClientHandlersOptions as t, VirtualFileSystemChangeListener as u };
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_providerState = require('../providerState-Dip2XHx4.cjs');
3
+
4
+ exports.getState = require_providerState.getState;
@@ -0,0 +1,15 @@
1
+ //#region src/utils/providerState.d.ts
2
+ interface StateMap {
3
+ key: string;
4
+ description: string;
5
+ type?: {
6
+ key: string;
7
+ description: string;
8
+ };
9
+ value?: StateMap | Record<string, StateMap> | string;
10
+ __WG$key?: string;
11
+ __WG$description?: string;
12
+ }
13
+ declare const getState: (propertiesArray: string[], prev?: any) => any;
14
+ //#endregion
15
+ export { StateMap, getState };
@@ -0,0 +1,15 @@
1
+ //#region src/utils/providerState.d.ts
2
+ interface StateMap {
3
+ key: string;
4
+ description: string;
5
+ type?: {
6
+ key: string;
7
+ description: string;
8
+ };
9
+ value?: StateMap | Record<string, StateMap> | string;
10
+ __WG$key?: string;
11
+ __WG$description?: string;
12
+ }
13
+ declare const getState: (propertiesArray: string[], prev?: any) => any;
14
+ //#endregion
15
+ export { StateMap, getState };
@@ -0,0 +1,3 @@
1
+ import { t as getState } from "../providerState-_ZvKXErw.mjs";
2
+
3
+ export { getState };
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "@webgal/language-service",
3
- "version": "0.0.2-alpha.4",
3
+ "version": "0.0.2-alpha.6",
4
4
  "type": "module",
5
5
  "main": "build/index.cjs",
6
6
  "module": "build/index.mjs",
7
7
  "types": "build/index.d.mts",
8
8
  "license": "MPL-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/xiaoxustudio/webgal-language-tools.git",
12
+ "directory": "packages/language-service"
13
+ },
9
14
  "publishConfig": {
10
15
  "access": "public",
11
16
  "registry": "https://registry.npmjs.org/"
@@ -39,6 +44,11 @@
39
44
  "types": "./build/themes.d.mts",
40
45
  "import": "./build/themes.mjs",
41
46
  "require": "./build/themes.cjs"
47
+ },
48
+ "./utils": {
49
+ "types": "./build/utils/index.d.mts",
50
+ "import": "./build/utils/index.mjs",
51
+ "require": "./build/utils/index.cjs"
42
52
  }
43
53
  },
44
54
  "scripts": {
@@ -46,25 +56,27 @@
46
56
  "format": " prettier --write \"src/**/*.ts\"",
47
57
  "lint": "eslint src --ext ts --fix",
48
58
  "typecheck": "tsc --noEmit",
49
- "watch": "tsdown --watch"
59
+ "watch": "tsdown --watch",
60
+ "gen": "tsx scripts/gen.cts"
50
61
  },
51
62
  "devDependencies": {
52
63
  "@types/node": "^18.0.0",
53
- "tsdown": "^0.20.3"
64
+ "tsdown": "^0.20.3",
65
+ "tsx": "^4.21.0"
54
66
  },
55
67
  "dependencies": {
56
- "@codingame/monaco-vscode-api": "^26.1.1",
57
- "@codingame/monaco-vscode-languages-service-override": "^26.1.1",
58
- "@codingame/monaco-vscode-textmate-service-override": "^26.1.1",
59
- "@codingame/monaco-vscode-theme-service-override": "^26.1.1",
68
+ "@codingame/monaco-vscode-api": "catalog:",
69
+ "@codingame/monaco-vscode-languages-service-override": "catalog:",
70
+ "@codingame/monaco-vscode-textmate-service-override": "catalog:",
71
+ "@codingame/monaco-vscode-theme-service-override": "catalog:",
60
72
  "@volar/language-core": "^2.4.28",
61
73
  "@volar/language-service": "^2.4.28",
62
- "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.1.1",
74
+ "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@26.1.1",
63
75
  "monaco-languageclient": "^10.7.0",
64
- "vscode": "npm:@codingame/monaco-vscode-extension-api@^26.1.1",
76
+ "vscode": "npm:@codingame/monaco-vscode-extension-api@26.1.1",
65
77
  "vscode-languageclient": "^9.0.1",
66
78
  "vscode-uri": "^3.1.0",
67
79
  "vscode-ws-jsonrpc": "^3.5.0"
68
80
  },
69
- "gitHead": "8ae85838b6fd53666ccdedaa6a1afcf5d51451ce"
81
+ "gitHead": "0420da3c91977030f8fe8efe3d4a6ca750d59e6f"
70
82
  }
@@ -1,24 +0,0 @@
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 };
@@ -1,111 +0,0 @@
1
- import { FileSystem } from "@volar/language-service";
2
- import { URI } from "vscode-uri";
3
-
4
- //#region src/vfs/types.d.ts
5
- type DirectoryEntry = {
6
- name: string;
7
- isDirectory: boolean;
8
- };
9
- type VirtualFileEntry = {
10
- type: "file";
11
- content: string;
12
- };
13
- type VirtualDirectoryEntry = {
14
- type: "dir";
15
- children: Record<string, VirtualEntry>;
16
- };
17
- type VirtualEntry = VirtualFileEntry | VirtualDirectoryEntry;
18
- type MaybePromise<T> = T | Promise<T>;
19
- type VirtualFileSystemChange = {
20
- type: "writeFile";
21
- path: string;
22
- content: string;
23
- } | {
24
- type: "deletePath";
25
- path: string;
26
- } | {
27
- type: "mkdir";
28
- path: string;
29
- } | {
30
- type: "rename";
31
- from: string;
32
- to: string;
33
- } | {
34
- type: "setTree";
35
- tree: VirtualEntry;
36
- };
37
- type VirtualFileSystemChangeListener = (changes: VirtualFileSystemChange[]) => void;
38
- type VirtualFileSystem = {
39
- root: string;
40
- currentDirectory: () => string | null;
41
- join: (...parts: string[]) => string;
42
- stat: (path: string) => Promise<{
43
- isFile: boolean;
44
- isDirectory: boolean;
45
- } | null>;
46
- readDirectory: (path: string) => Promise<DirectoryEntry[] | null>;
47
- readFile: (path: string) => Promise<string | null>;
48
- findFile: (startPath: string, targetName: string) => Promise<string | null>;
49
- getResourceDirectory: (urls: string[]) => Promise<DirectoryEntry[] | null>;
50
- getAllTextWithScene: () => Promise<Record<string, {
51
- path: string;
52
- name: string;
53
- text: string;
54
- fullPath: string;
55
- }> | null>;
56
- getTree: () => VirtualEntry;
57
- setTree: (tree: VirtualEntry) => void;
58
- writeFile: (path: string, content: string) => Promise<void>;
59
- deletePath: (path: string) => Promise<void>;
60
- mkdir: (path: string) => Promise<void>;
61
- rename: (from: string, to: string) => Promise<void>;
62
- applyChanges: (changes: VirtualFileSystemChange[]) => Promise<void>;
63
- onDidChange: (listener: VirtualFileSystemChangeListener) => () => void;
64
- };
65
- type WebgalClientHandlers = {
66
- "workspace/documentLink/refresh": () => MaybePromise<unknown>;
67
- "client/showTip": (message: string) => MaybePromise<unknown>;
68
- "client/currentDirectory": () => MaybePromise<string | null>;
69
- "client/FJoin": (args: string | string[]) => MaybePromise<string | null>;
70
- "client/FStat": (path: string) => MaybePromise<unknown>;
71
- "client/findFile": (args: [string, string]) => MaybePromise<string | null>;
72
- "client/goPropertyDoc": (pathSegments: string[]) => MaybePromise<unknown>;
73
- "client/readDirectory": (uriString: string) => MaybePromise<unknown>;
74
- "client/getAllTextWithScene": () => MaybePromise<unknown>;
75
- "client/getResourceDirectory": (urls: string[]) => MaybePromise<unknown>;
76
- "client/vfs/getTree": () => MaybePromise<VirtualEntry>;
77
- "client/vfs/setTree": (tree: VirtualEntry) => MaybePromise<unknown>;
78
- "client/vfs/readFile": (path: string) => MaybePromise<string | null>;
79
- "client/vfs/writeFile": (args: {
80
- path: string;
81
- content: string;
82
- }) => MaybePromise<unknown>;
83
- "client/vfs/deletePath": (path: string) => MaybePromise<unknown>;
84
- "client/vfs/mkdir": (path: string) => MaybePromise<unknown>;
85
- "client/vfs/rename": (args: {
86
- from: string;
87
- to: string;
88
- }) => MaybePromise<unknown>;
89
- "client/vfs/applyChanges": (changes: VirtualFileSystemChange[]) => MaybePromise<unknown>;
90
- };
91
- type LanguageClientLike = {
92
- onRequest: (method: string, handler: (...args: any[]) => unknown) => void;
93
- };
94
- type CreateWebgalClientHandlersOptions = {
95
- vfs: VirtualFileSystem;
96
- showTip?: (message: string) => unknown;
97
- goPropertyDoc?: (pathSegments: string[]) => unknown;
98
- overrides?: Partial<WebgalClientHandlers>;
99
- };
100
- interface VolarWritableFileSystem extends FileSystem {
101
- writeFile(uri: URI, content: string): Promise<void>;
102
- mkdir(uri: URI): Promise<void>;
103
- delete(uri: URI): Promise<void>;
104
- rename(oldUri: URI, newUri: URI): Promise<void>;
105
- getTree(): VirtualEntry;
106
- setTree(tree: VirtualEntry): void;
107
- onDidChange(listener: VirtualFileSystemChangeListener): () => void;
108
- root: string;
109
- }
110
- //#endregion
111
- export { VirtualDirectoryEntry as a, VirtualFileSystem as c, VolarWritableFileSystem as d, WebgalClientHandlers as f, MaybePromise as i, VirtualFileSystemChange as l, DirectoryEntry as n, VirtualEntry as o, LanguageClientLike as r, VirtualFileEntry as s, CreateWebgalClientHandlersOptions as t, VirtualFileSystemChangeListener as u };