@volar/monaco 2.4.0-alpha.5 → 2.4.0-alpha.7
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/README.md +3 -3
- package/package.json +4 -4
- package/worker.d.ts +6 -6
- package/worker.js +4 -4
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ self.onmessage = () => {
|
|
|
35
35
|
languagePlugins: [
|
|
36
36
|
// ...
|
|
37
37
|
],
|
|
38
|
-
|
|
38
|
+
languageServicePlugins: [
|
|
39
39
|
// ...
|
|
40
40
|
],
|
|
41
41
|
});
|
|
@@ -76,7 +76,7 @@ self.onmessage = () => {
|
|
|
76
76
|
languagePlugins: [
|
|
77
77
|
// ...
|
|
78
78
|
],
|
|
79
|
-
|
|
79
|
+
languageServicePlugins: [
|
|
80
80
|
// ...
|
|
81
81
|
+ createTypeScriptService(ts),
|
|
82
82
|
],
|
|
@@ -118,7 +118,7 @@ self.onmessage = () => {
|
|
|
118
118
|
languagePlugins: [
|
|
119
119
|
// ...
|
|
120
120
|
],
|
|
121
|
-
|
|
121
|
+
languageServicePlugins: [
|
|
122
122
|
// ...
|
|
123
123
|
createTypeScriptService(ts),
|
|
124
124
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/monaco",
|
|
3
|
-
"version": "2.4.0-alpha.
|
|
3
|
+
"version": "2.4.0-alpha.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"directory": "packages/monaco"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-service": "2.4.0-alpha.
|
|
17
|
-
"@volar/typescript": "2.4.0-alpha.
|
|
16
|
+
"@volar/language-service": "2.4.0-alpha.7",
|
|
17
|
+
"@volar/typescript": "2.4.0-alpha.7",
|
|
18
18
|
"monaco-languageserver-types": "^0.3.4",
|
|
19
19
|
"monaco-types": "^0.1.0",
|
|
20
20
|
"vscode-uri": "^3.0.8"
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"monaco-editor-core": "latest"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "890a891306835b992269ef1225f71a42f53d83e8"
|
|
26
26
|
}
|
package/worker.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import type * as ts from 'typescript';
|
|
|
4
4
|
import { URI } from 'vscode-uri';
|
|
5
5
|
export * from '@volar/language-service';
|
|
6
6
|
export * from './lib/ata.js';
|
|
7
|
-
export declare function createSimpleWorkerService<T = {}>({ env, workerContext, languagePlugins,
|
|
7
|
+
export declare function createSimpleWorkerService<T = {}>({ env, workerContext, languagePlugins, languageServicePlugins, extraApis, setup, }: {
|
|
8
8
|
env: LanguageServiceEnvironment;
|
|
9
9
|
workerContext: monaco.worker.IWorkerContext<any>;
|
|
10
|
-
languagePlugins
|
|
11
|
-
|
|
10
|
+
languagePlugins: LanguagePlugin<URI>[];
|
|
11
|
+
languageServicePlugins: LanguageServicePlugin[];
|
|
12
12
|
extraApis?: T;
|
|
13
13
|
setup?(options: {
|
|
14
14
|
language: Language<URI>;
|
|
@@ -78,7 +78,7 @@ export declare function createSimpleWorkerService<T = {}>({ env, workerContext,
|
|
|
78
78
|
resolveInlayHint: (item: import("@volar/language-service").InlayHint, token?: import("@volar/language-service").CancellationToken) => Promise<import("@volar/language-service").InlayHint>;
|
|
79
79
|
resolveWorkspaceSymbol: (symbol: import("@volar/language-service").WorkspaceSymbol, token?: import("@volar/language-service").CancellationToken) => Promise<import("@volar/language-service").WorkspaceSymbol>;
|
|
80
80
|
} & T;
|
|
81
|
-
export declare function createTypeScriptWorkerService<T = {}>({ typescript: ts, compilerOptions, env, uriConverter, workerContext, languagePlugins,
|
|
81
|
+
export declare function createTypeScriptWorkerService<T = {}>({ typescript: ts, compilerOptions, env, uriConverter, workerContext, languagePlugins, languageServicePlugins, extraApis, setup, }: {
|
|
82
82
|
typescript: typeof import('typescript');
|
|
83
83
|
compilerOptions: ts.CompilerOptions;
|
|
84
84
|
env: LanguageServiceEnvironment;
|
|
@@ -87,8 +87,8 @@ export declare function createTypeScriptWorkerService<T = {}>({ typescript: ts,
|
|
|
87
87
|
asFileName(uri: URI): string;
|
|
88
88
|
};
|
|
89
89
|
workerContext: monaco.worker.IWorkerContext<any>;
|
|
90
|
-
languagePlugins
|
|
91
|
-
|
|
90
|
+
languagePlugins: LanguagePlugin<URI>[];
|
|
91
|
+
languageServicePlugins: LanguageServicePlugin[];
|
|
92
92
|
extraApis?: T;
|
|
93
93
|
setup?(options: {
|
|
94
94
|
language: Language<URI>;
|
package/worker.js
CHANGED
|
@@ -4,7 +4,7 @@ import { URI } from 'vscode-uri';
|
|
|
4
4
|
export * from '@volar/language-service';
|
|
5
5
|
export * from './lib/ata.js';
|
|
6
6
|
const fsFileSnapshots = createUriMap();
|
|
7
|
-
export function createSimpleWorkerService({ env, workerContext, languagePlugins
|
|
7
|
+
export function createSimpleWorkerService({ env, workerContext, languagePlugins, languageServicePlugins, extraApis = {}, setup, }) {
|
|
8
8
|
const snapshots = new Map();
|
|
9
9
|
const language = createLanguage(languagePlugins, createUriMap(false), uri => {
|
|
10
10
|
const model = workerContext.getMirrorModels().find(model => model.uri.toString() === uri.toString());
|
|
@@ -28,9 +28,9 @@ export function createSimpleWorkerService({ env, workerContext, languagePlugins
|
|
|
28
28
|
});
|
|
29
29
|
const project = {};
|
|
30
30
|
setup?.({ language, project });
|
|
31
|
-
return createWorkerService(language,
|
|
31
|
+
return createWorkerService(language, languageServicePlugins, env, project, extraApis);
|
|
32
32
|
}
|
|
33
|
-
export function createTypeScriptWorkerService({ typescript: ts, compilerOptions, env, uriConverter, workerContext, languagePlugins
|
|
33
|
+
export function createTypeScriptWorkerService({ typescript: ts, compilerOptions, env, uriConverter, workerContext, languagePlugins, languageServicePlugins, extraApis = {}, setup, }) {
|
|
34
34
|
let projectVersion = 0;
|
|
35
35
|
const modelSnapshot = new WeakMap();
|
|
36
36
|
const modelVersions = new Map();
|
|
@@ -107,7 +107,7 @@ export function createTypeScriptWorkerService({ typescript: ts, compilerOptions,
|
|
|
107
107
|
},
|
|
108
108
|
};
|
|
109
109
|
setup?.({ language, project });
|
|
110
|
-
return createWorkerService(language,
|
|
110
|
+
return createWorkerService(language, languageServicePlugins, env, project, extraApis);
|
|
111
111
|
function getModelSnapshot(uri) {
|
|
112
112
|
const model = workerContext.getMirrorModels().find(model => model.uri.toString() === uri.toString());
|
|
113
113
|
if (model) {
|