|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
|
|
|
|
|
import { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
|
|
|
|
import { TypeScriptWorker } from './tsWorker';
|
|
|
|
|
import { libFileMap } from './lib/lib'
|
|
|
|
|
|
|
|
|
|
import IDisposable = monaco.IDisposable;
|
|
|
|
|
import Uri = monaco.Uri;
|
|
|
|
@ -60,6 +61,12 @@ export class WorkerManager {
|
|
|
|
|
|
|
|
|
|
private _getClient(): Promise<TypeScriptWorker> {
|
|
|
|
|
if (!this._client) {
|
|
|
|
|
// Adds all of the .d.ts lib files into Monaco as editor models,
|
|
|
|
|
// this allows themm to show up in peek (and allow editing if desired).
|
|
|
|
|
for (const key in libFileMap) {
|
|
|
|
|
monaco.editor.createModel(libFileMap[key], "ts", monaco.Uri.file(key))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this._worker = monaco.editor.createWebWorker<TypeScriptWorker>({
|
|
|
|
|
|
|
|
|
|
// module that exports the create() method and returns a `TypeScriptWorker` instance
|
|
|
|
@ -72,7 +79,7 @@ export class WorkerManager {
|
|
|
|
|
// passed in to the create() method
|
|
|
|
|
createData: {
|
|
|
|
|
compilerOptions: this._defaults.getCompilerOptions(),
|
|
|
|
|
extraLibs: this._defaults.getExtraLibs()
|
|
|
|
|
extraLibs: this._defaults.getExtraLibs(),
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|