monaco-languageclient 9.2.0 → 9.2.1
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/CHANGELOG.md +4 -0
- package/lib/workerFactory.d.ts +8 -0
- package/lib/workerFactory.d.ts.map +1 -0
- package/lib/workerFactory.js +18 -0
- package/lib/workerFactory.js.map +1 -0
- package/package.json +8 -1
- package/src/workerFactory.ts +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this npm module are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [9.2.1] - 2025-01-31
|
|
6
|
+
|
|
7
|
+
- Moved workerFactory from `monaco-editor-wrapper` to `monaco-languageclient`.
|
|
8
|
+
|
|
5
9
|
## [9.2.0] - 2025-01-31
|
|
6
10
|
|
|
7
11
|
- Update to monaco-vscode-api v13 [#836](https://github.com/TypeFox/monaco-languageclient/pull/829)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Logger } from 'monaco-languageclient/tools';
|
|
2
|
+
export type WorkerLoader = (() => Worker) | undefined;
|
|
3
|
+
export interface WorkerFactoryConfig {
|
|
4
|
+
workerLoaders: Record<string, WorkerLoader>;
|
|
5
|
+
logger?: Logger;
|
|
6
|
+
}
|
|
7
|
+
export declare const useWorkerFactory: (config: WorkerFactoryConfig) => void;
|
|
8
|
+
//# sourceMappingURL=workerFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerFactory.d.ts","sourceRoot":"","sources":["../src/workerFactory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,WAAY,mBAAmB,SAa3D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
import { initEnhancedMonacoEnvironment } from 'monaco-languageclient/vscode/services';
|
|
6
|
+
export const useWorkerFactory = (config) => {
|
|
7
|
+
const envEnhanced = initEnhancedMonacoEnvironment();
|
|
8
|
+
const getWorker = (moduleId, label) => {
|
|
9
|
+
config.logger?.info(`getWorker: moduleId: ${moduleId} label: ${label}`);
|
|
10
|
+
const workerFunc = config.workerLoaders[label];
|
|
11
|
+
if (workerFunc === undefined) {
|
|
12
|
+
throw new Error(`Unimplemented worker ${label} (${moduleId})`);
|
|
13
|
+
}
|
|
14
|
+
return workerFunc();
|
|
15
|
+
};
|
|
16
|
+
envEnhanced.getWorker = getWorker;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=workerFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerFactory.js","sourceRoot":"","sources":["../src/workerFactory.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAUtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE;IAC5D,MAAM,WAAW,GAAG,6BAA6B,EAAE,CAAC;IAEpD,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,EAAE;QAClD,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,wBAAwB,QAAQ,WAAW,KAAK,EAAE,CAAC,CAAC;QAExE,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,KAAK,QAAQ,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACxB,CAAC,CAAC;IACF,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;AACtC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-languageclient",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Monaco Language client implementation",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TypeFox GmbH",
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"./fs": {
|
|
36
36
|
"types": "./lib/fs/index.d.ts",
|
|
37
37
|
"default": "./lib/fs/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./workerFactory": {
|
|
40
|
+
"types": "./lib/workerFactory.d.ts",
|
|
41
|
+
"default": "./lib/workerFactory.js"
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
"typesVersions": {
|
|
@@ -50,6 +54,9 @@
|
|
|
50
54
|
],
|
|
51
55
|
"fs": [
|
|
52
56
|
"lib/fs/index"
|
|
57
|
+
],
|
|
58
|
+
"workerFactory": [
|
|
59
|
+
"lib/workerFactory"
|
|
53
60
|
]
|
|
54
61
|
}
|
|
55
62
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
import { initEnhancedMonacoEnvironment } from 'monaco-languageclient/vscode/services';
|
|
7
|
+
import { Logger } from 'monaco-languageclient/tools';
|
|
8
|
+
|
|
9
|
+
export type WorkerLoader = (() => Worker) | undefined;
|
|
10
|
+
|
|
11
|
+
export interface WorkerFactoryConfig {
|
|
12
|
+
workerLoaders: Record<string, WorkerLoader>;
|
|
13
|
+
logger?: Logger;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useWorkerFactory = (config: WorkerFactoryConfig) => {
|
|
17
|
+
const envEnhanced = initEnhancedMonacoEnvironment();
|
|
18
|
+
|
|
19
|
+
const getWorker = (moduleId: string, label: string) => {
|
|
20
|
+
config.logger?.info(`getWorker: moduleId: ${moduleId} label: ${label}`);
|
|
21
|
+
|
|
22
|
+
const workerFunc = config.workerLoaders[label];
|
|
23
|
+
if (workerFunc === undefined) {
|
|
24
|
+
throw new Error(`Unimplemented worker ${label} (${moduleId})`);
|
|
25
|
+
}
|
|
26
|
+
return workerFunc();
|
|
27
|
+
};
|
|
28
|
+
envEnhanced.getWorker = getWorker;
|
|
29
|
+
};
|