@volar/monaco 1.3.0-alpha.1 → 1.3.0-alpha.2
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 +12 -5
- package/out/dts.d.ts +0 -0
- package/out/dts.js +1 -0
- package/out/editor.d.ts +2 -2
- package/out/editor.js +2 -8
- package/out/worker.d.ts +13 -4
- package/out/worker.js +94 -40
- package/package.json +3 -3
- package/out/utils/autoFetchTypes.d.ts +0 -6
- package/out/utils/autoFetchTypes.js +0 -82
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ self.onmessage = () => {
|
|
|
39
39
|
#### TypeScript Support
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
|
-
import { createLanguageService } from '@volar/monaco/worker';
|
|
42
|
+
import { createLanguageService, createDtsHost } from '@volar/monaco/worker';
|
|
43
43
|
import * as ts from 'typescript';
|
|
44
44
|
|
|
45
45
|
createLanguageService({
|
|
@@ -49,9 +49,9 @@ createLanguageService({
|
|
|
49
49
|
compilerOptions: {
|
|
50
50
|
// ...tsconfig options
|
|
51
51
|
},
|
|
52
|
-
// Enable auto fetch node_modules types
|
|
53
|
-
autoFetchTypes: true,
|
|
54
52
|
},
|
|
53
|
+
// Enable auto fetch node_modules types
|
|
54
|
+
dtsHost: createDtsHost('https://unpkg.com/'),
|
|
55
55
|
});
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -75,7 +75,7 @@ import myWorker from './my-lang.worker?worker';
|
|
|
75
75
|
|
|
76
76
|
```ts
|
|
77
77
|
import type { LanguageService } from '@volar/language-service';
|
|
78
|
-
import { editor, languages } from 'monaco-editor-core';
|
|
78
|
+
import { editor, languages, Uri } from 'monaco-editor-core';
|
|
79
79
|
import * as VolarMonaco from '@volar/monaco';
|
|
80
80
|
|
|
81
81
|
languages.register({ id: 'my-lang', extensions: ['.my-lang'] });
|
|
@@ -85,7 +85,14 @@ languages.onLanguage('my-lang', () => {
|
|
|
85
85
|
moduleId: 'vs/language/my-lang/myLangWorker',
|
|
86
86
|
label: 'my-lang',
|
|
87
87
|
});
|
|
88
|
-
VolarMonaco.editor.activateMarkers(
|
|
88
|
+
VolarMonaco.editor.activateMarkers(
|
|
89
|
+
worker,
|
|
90
|
+
['my-lang'],
|
|
91
|
+
'my-lang-markers-owner',
|
|
92
|
+
// root files
|
|
93
|
+
() => [Uri.file('/Foo.my-lang'), Uri.file('/Bar.my-lang')],
|
|
94
|
+
editor
|
|
95
|
+
);
|
|
89
96
|
VolarMonaco.languages.registerProvides(worker, ['my-lang'], languages)
|
|
90
97
|
});
|
|
91
98
|
```
|
package/out/dts.d.ts
ADDED
|
File without changes
|
package/out/dts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=dts.js.map
|
package/out/editor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LanguageService } from '@volar/language-service';
|
|
2
|
-
import type { editor as _editor, IDisposable } from 'monaco-editor-core';
|
|
2
|
+
import type { editor as _editor, IDisposable, Uri } from 'monaco-editor-core';
|
|
3
3
|
export declare namespace editor {
|
|
4
|
-
function activateMarkers(worker: _editor.MonacoWebWorker<LanguageService>, languages: string[], markersOwn: string, editor: typeof import('monaco-editor-core').editor): IDisposable;
|
|
4
|
+
function activateMarkers(worker: _editor.MonacoWebWorker<LanguageService>, languages: string[], markersOwn: string, getSyncUris: () => Uri[], editor: typeof import('monaco-editor-core').editor): IDisposable;
|
|
5
5
|
}
|
package/out/editor.js
CHANGED
|
@@ -13,7 +13,7 @@ const markers_1 = require("./utils/markers");
|
|
|
13
13
|
const protocol2monaco = require("./utils/protocol2monaco");
|
|
14
14
|
var editor;
|
|
15
15
|
(function (editor_1) {
|
|
16
|
-
function activateMarkers(worker, languages, markersOwn, editor) {
|
|
16
|
+
function activateMarkers(worker, languages, markersOwn, getSyncUris, editor) {
|
|
17
17
|
const disposables = [];
|
|
18
18
|
const listener = new Map();
|
|
19
19
|
disposables.push(editor.onDidCreateModel((model) => hostingMarkers(model)), editor.onWillDisposeModel(stopHostingMarkers), editor.onDidChangeModelLanguage((event) => {
|
|
@@ -73,7 +73,7 @@ var editor;
|
|
|
73
73
|
if (!model.isAttachedToEditor()) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
const languageService = yield
|
|
76
|
+
const languageService = yield worker.withSyncedResources(getSyncUris());
|
|
77
77
|
const diagnostics = yield languageService.doValidation(model.uri.toString());
|
|
78
78
|
const result = diagnostics.map(error => {
|
|
79
79
|
const marker = protocol2monaco.asMarkerData(error);
|
|
@@ -83,12 +83,6 @@ var editor;
|
|
|
83
83
|
editor.setModelMarkers(model, markersOwn, result);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
function getLanguageService(...uris) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
yield worker.withSyncedResources(uris);
|
|
89
|
-
return worker.getProxy();
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
86
|
}
|
|
93
87
|
editor_1.activateMarkers = activateMarkers;
|
|
94
88
|
})(editor = exports.editor || (exports.editor = {}));
|
package/out/worker.d.ts
CHANGED
|
@@ -3,13 +3,22 @@ import type * as monaco from 'monaco-editor-core';
|
|
|
3
3
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
4
4
|
export declare function createLanguageService(options: {
|
|
5
5
|
workerContext: monaco.worker.IWorkerContext<any>;
|
|
6
|
+
dtsHost?: ReturnType<typeof createDtsHost>;
|
|
6
7
|
config: Config;
|
|
7
8
|
typescript?: {
|
|
8
9
|
module: typeof import('typescript/lib/tsserverlibrary');
|
|
9
10
|
compilerOptions: ts.CompilerOptions;
|
|
10
|
-
autoFetchTypes?: boolean | {
|
|
11
|
-
onFetchTypesFiles?(files: Record<string, string>): void;
|
|
12
|
-
cdn?: string;
|
|
13
|
-
};
|
|
14
11
|
};
|
|
15
12
|
}): {};
|
|
13
|
+
export declare function createDtsHost(cdn: string, onFetch?: (fileName: string, text: string) => void): CdnDtsHost;
|
|
14
|
+
declare class CdnDtsHost {
|
|
15
|
+
private cdn;
|
|
16
|
+
private onFetch?;
|
|
17
|
+
files: Map<string, string | Promise<string | undefined> | undefined>;
|
|
18
|
+
lastUpdateFilesSize: number;
|
|
19
|
+
constructor(cdn: string, onFetch?: ((fileName: string, text: string) => void) | undefined);
|
|
20
|
+
getVersion(): Promise<number>;
|
|
21
|
+
readFile(fileName: string): string | Promise<string | undefined>;
|
|
22
|
+
fetch(fileName: string, url: string): Promise<string | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/out/worker.js
CHANGED
|
@@ -8,20 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createLanguageService = void 0;
|
|
11
|
+
exports.createDtsHost = exports.createLanguageService = void 0;
|
|
12
12
|
const language_service_1 = require("@volar/language-service");
|
|
13
13
|
const vscode_uri_1 = require("vscode-uri");
|
|
14
|
-
const
|
|
14
|
+
const axios_1 = require("axios");
|
|
15
15
|
function createLanguageService(options) {
|
|
16
|
-
var _a, _b, _c
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
const dtsClient = options.dtsHost ? createDtsClient(options.dtsHost) : undefined;
|
|
17
18
|
const ts = options.typescript ? options.typescript.module : undefined;
|
|
18
19
|
const config = (_a = options.config) !== null && _a !== void 0 ? _a : {};
|
|
19
20
|
const compilerOptions = (_c = (_b = options.typescript) === null || _b === void 0 ? void 0 : _b.compilerOptions) !== null && _c !== void 0 ? _c : {};
|
|
20
|
-
const autoFetchTypesCdn = typeof ((_d = options.typescript) === null || _d === void 0 ? void 0 : _d.autoFetchTypes) === 'object'
|
|
21
|
-
&& options.typescript.autoFetchTypes.cdn
|
|
22
|
-
? options.typescript.autoFetchTypes.cdn
|
|
23
|
-
: 'https://unpkg.com/';
|
|
24
|
-
const autoTypeFetchHost = ((_e = options.typescript) === null || _e === void 0 ? void 0 : _e.autoFetchTypes) ? (0, autoFetchTypes_1.createAutoTypesFetchingHost)(autoFetchTypesCdn) : undefined;
|
|
25
21
|
let host = createLanguageServiceHost();
|
|
26
22
|
let languageService = (0, language_service_1.createLanguageService)({
|
|
27
23
|
host,
|
|
@@ -30,8 +26,7 @@ function createLanguageService(options) {
|
|
|
30
26
|
fileNameToUri: (fileName) => vscode_uri_1.URI.file(fileName).toString(),
|
|
31
27
|
rootUri: vscode_uri_1.URI.file('/'),
|
|
32
28
|
});
|
|
33
|
-
let
|
|
34
|
-
const syncedFiles = new Set();
|
|
29
|
+
let dtsVersion = 0;
|
|
35
30
|
class InnocentRabbit {
|
|
36
31
|
}
|
|
37
32
|
;
|
|
@@ -43,19 +38,16 @@ function createLanguageService(options) {
|
|
|
43
38
|
continue;
|
|
44
39
|
}
|
|
45
40
|
InnocentRabbit.prototype[api] = (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
|
|
47
|
-
if (!autoTypeFetchHost) {
|
|
41
|
+
if (!dtsClient) {
|
|
48
42
|
return languageService[api](...args);
|
|
49
43
|
}
|
|
50
|
-
let
|
|
51
|
-
let webFilesNumOfThisCall = autoTypeFetchHost.files.size;
|
|
44
|
+
let oldVersion = yield dtsClient.getVersion();
|
|
52
45
|
let result = yield languageService[api](...args);
|
|
53
|
-
yield
|
|
54
|
-
while (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
webFilesNumOfLanguageService = autoTypeFetchHost.files.size;
|
|
46
|
+
let newVersion = yield dtsClient.getVersion();
|
|
47
|
+
while (newVersion !== oldVersion) {
|
|
48
|
+
oldVersion = newVersion;
|
|
49
|
+
if (newVersion !== dtsVersion) {
|
|
50
|
+
dtsVersion = newVersion;
|
|
59
51
|
languageService.dispose();
|
|
60
52
|
languageService = (0, language_service_1.createLanguageService)({
|
|
61
53
|
host,
|
|
@@ -66,18 +58,7 @@ function createLanguageService(options) {
|
|
|
66
58
|
});
|
|
67
59
|
}
|
|
68
60
|
result = yield languageService[api](...args);
|
|
69
|
-
yield
|
|
70
|
-
}
|
|
71
|
-
if (shouldSync && typeof ((_g = options.typescript) === null || _g === void 0 ? void 0 : _g.autoFetchTypes) === 'object' && options.typescript.autoFetchTypes.onFetchTypesFiles) {
|
|
72
|
-
const files = autoTypeFetchHost.files;
|
|
73
|
-
const syncFiles = {};
|
|
74
|
-
for (const [fileName, text] of files) {
|
|
75
|
-
if (!syncedFiles.has(fileName) && text !== undefined) {
|
|
76
|
-
syncFiles[fileName] = text;
|
|
77
|
-
syncedFiles.add(fileName);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
options.typescript.autoFetchTypes.onFetchTypesFiles(syncFiles);
|
|
61
|
+
newVersion = yield dtsClient.getVersion();
|
|
81
62
|
}
|
|
82
63
|
return result;
|
|
83
64
|
});
|
|
@@ -112,8 +93,8 @@ function createLanguageService(options) {
|
|
|
112
93
|
if (model) {
|
|
113
94
|
return model.version.toString();
|
|
114
95
|
}
|
|
115
|
-
if (
|
|
116
|
-
const dts =
|
|
96
|
+
if (dtsClient) {
|
|
97
|
+
const dts = dtsClient.readFile(fileName);
|
|
117
98
|
if (dts) {
|
|
118
99
|
return dts.length.toString();
|
|
119
100
|
}
|
|
@@ -139,8 +120,8 @@ function createLanguageService(options) {
|
|
|
139
120
|
if (webFileSnapshot.has(fileName)) {
|
|
140
121
|
return webFileSnapshot.get(fileName);
|
|
141
122
|
}
|
|
142
|
-
if (
|
|
143
|
-
const webFileText =
|
|
123
|
+
if (dtsClient) {
|
|
124
|
+
const webFileText = dtsClient.readFile(fileName);
|
|
144
125
|
if (webFileText !== undefined) {
|
|
145
126
|
webFileSnapshot.set(fileName, {
|
|
146
127
|
getText: (start, end) => webFileText.substring(start, end),
|
|
@@ -168,8 +149,8 @@ function createLanguageService(options) {
|
|
|
168
149
|
if (model) {
|
|
169
150
|
return model.getValue();
|
|
170
151
|
}
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
152
|
+
if (dtsClient) {
|
|
153
|
+
return dtsClient.readFile(fileName);
|
|
173
154
|
}
|
|
174
155
|
},
|
|
175
156
|
fileExists(fileName) {
|
|
@@ -177,8 +158,8 @@ function createLanguageService(options) {
|
|
|
177
158
|
if (model) {
|
|
178
159
|
return true;
|
|
179
160
|
}
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
161
|
+
if (dtsClient) {
|
|
162
|
+
return dtsClient.readFile(fileName) !== undefined;
|
|
182
163
|
}
|
|
183
164
|
return false;
|
|
184
165
|
},
|
|
@@ -188,4 +169,77 @@ function createLanguageService(options) {
|
|
|
188
169
|
}
|
|
189
170
|
}
|
|
190
171
|
exports.createLanguageService = createLanguageService;
|
|
172
|
+
function createDtsHost(cdn, onFetch) {
|
|
173
|
+
return new CdnDtsHost(cdn, onFetch);
|
|
174
|
+
}
|
|
175
|
+
exports.createDtsHost = createDtsHost;
|
|
176
|
+
class CdnDtsHost {
|
|
177
|
+
constructor(cdn, onFetch) {
|
|
178
|
+
this.cdn = cdn;
|
|
179
|
+
this.onFetch = onFetch;
|
|
180
|
+
this.files = new Map();
|
|
181
|
+
this.lastUpdateFilesSize = 0;
|
|
182
|
+
}
|
|
183
|
+
getVersion() {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
while (this.files.size !== this.lastUpdateFilesSize) {
|
|
186
|
+
this.lastUpdateFilesSize = this.files.size;
|
|
187
|
+
yield Promise.all(this.files.values());
|
|
188
|
+
}
|
|
189
|
+
return this.files.size;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
readFile(fileName) {
|
|
193
|
+
if (!this.files.has(fileName)) {
|
|
194
|
+
this.files.set(fileName, undefined);
|
|
195
|
+
if (fileName.startsWith('/node_modules/')
|
|
196
|
+
// ignore .js because it's no help for intellisense
|
|
197
|
+
&& (fileName.endsWith('.d.ts') || fileName.endsWith('/package.json'))) {
|
|
198
|
+
const url = this.cdn + fileName.slice('/node_modules/'.length);
|
|
199
|
+
this.files.set(fileName, this.fetch(fileName, url));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return this.files.get(fileName);
|
|
203
|
+
}
|
|
204
|
+
fetch(fileName, url) {
|
|
205
|
+
var _a, _b;
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
try {
|
|
208
|
+
const text = (_a = (yield axios_1.default.get(url, {
|
|
209
|
+
transformResponse: (res) => {
|
|
210
|
+
// avoid parse to json object
|
|
211
|
+
return res;
|
|
212
|
+
},
|
|
213
|
+
})).data) !== null && _a !== void 0 ? _a : undefined;
|
|
214
|
+
(_b = this.onFetch) === null || _b === void 0 ? void 0 : _b.call(this, fileName, text);
|
|
215
|
+
return text;
|
|
216
|
+
}
|
|
217
|
+
catch (_c) {
|
|
218
|
+
// ignore
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function createDtsClient(server) {
|
|
224
|
+
const fetchTasks = [];
|
|
225
|
+
const files = new Map();
|
|
226
|
+
return {
|
|
227
|
+
readFile,
|
|
228
|
+
getVersion: () => server.getVersion(),
|
|
229
|
+
readFileAsync,
|
|
230
|
+
};
|
|
231
|
+
function readFile(fileName) {
|
|
232
|
+
if (!files.has(fileName)) {
|
|
233
|
+
files.set(fileName, undefined);
|
|
234
|
+
fetchTasks.push([fileName, readFileAsync(fileName)]);
|
|
235
|
+
}
|
|
236
|
+
return files.get(fileName);
|
|
237
|
+
}
|
|
238
|
+
function readFileAsync(fileName) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
const text = yield server.readFile(fileName);
|
|
241
|
+
files.set(fileName, text);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
191
245
|
//# sourceMappingURL=worker.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/monaco",
|
|
3
|
-
"version": "1.3.0-alpha.
|
|
3
|
+
"version": "1.3.0-alpha.2",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"directory": "packages/monaco"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@volar/language-service": "1.3.0-alpha.
|
|
18
|
+
"@volar/language-service": "1.3.0-alpha.2",
|
|
19
19
|
"axios": "^1.3.4",
|
|
20
20
|
"monaco-editor-core": "^0.36.0",
|
|
21
21
|
"vscode-languageserver-protocol": "^3.17.3",
|
|
22
22
|
"vscode-uri": "^3.0.7"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "84111017f289c36dfe4541159cad8a7e13c2be41"
|
|
25
25
|
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createAutoTypesFetchingHost = void 0;
|
|
12
|
-
const axios_1 = require("axios");
|
|
13
|
-
function createAutoTypesFetchingHost(cdn) {
|
|
14
|
-
const fetchTasks = [];
|
|
15
|
-
const files = new Map();
|
|
16
|
-
let fetching;
|
|
17
|
-
return {
|
|
18
|
-
fileExists,
|
|
19
|
-
readFile,
|
|
20
|
-
files,
|
|
21
|
-
wait: () => __awaiter(this, void 0, void 0, function* () { return yield fetching; }),
|
|
22
|
-
};
|
|
23
|
-
function fileExists(fileName) {
|
|
24
|
-
return readFile(fileName) !== undefined;
|
|
25
|
-
}
|
|
26
|
-
function readFile(fileName) {
|
|
27
|
-
if (!files.has(fileName)) {
|
|
28
|
-
files.set(fileName, undefined);
|
|
29
|
-
fetch(fileName);
|
|
30
|
-
}
|
|
31
|
-
return files.get(fileName);
|
|
32
|
-
}
|
|
33
|
-
function readFileAsync(fileName) {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (fileName.startsWith('/node_modules/')) {
|
|
36
|
-
const url = cdn + fileName.slice('/node_modules/'.length);
|
|
37
|
-
const text = yield readWebFile(url);
|
|
38
|
-
files.set(fileName, text);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function readWebFile(uri) {
|
|
43
|
-
var _a;
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
// ignore .js because it's no help for intellisense
|
|
46
|
-
if (uri.endsWith('.d.ts') || uri.endsWith('/package.json')) {
|
|
47
|
-
try {
|
|
48
|
-
return (_a = (yield axios_1.default.get(uri, {
|
|
49
|
-
transformResponse: (res) => {
|
|
50
|
-
// avoid parse to json object
|
|
51
|
-
return res;
|
|
52
|
-
},
|
|
53
|
-
})).data) !== null && _a !== void 0 ? _a : undefined;
|
|
54
|
-
}
|
|
55
|
-
catch (_b) {
|
|
56
|
-
// ignore
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function fetch(fileName) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
fetchTasks.push([fileName, readFileAsync(fileName)]);
|
|
64
|
-
if (!fetching) {
|
|
65
|
-
fetching = fetchWorker();
|
|
66
|
-
yield fetching;
|
|
67
|
-
fetching = undefined;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function fetchWorker() {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
while (fetchTasks.length) {
|
|
74
|
-
const tasks = fetchTasks.map(([_, task]) => task);
|
|
75
|
-
fetchTasks.length = 0;
|
|
76
|
-
yield Promise.all(tasks);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.createAutoTypesFetchingHost = createAutoTypesFetchingHost;
|
|
82
|
-
//# sourceMappingURL=autoFetchTypes.js.map
|