Revert the lib files coming through as monaco models

pull/2748/head
Orta 5 years ago
parent 86f6d762df
commit ca76528ce1

@ -69,6 +69,8 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.language
if (model) { if (model) {
// a true editor model // a true editor model
text = model.getValue(); text = model.getValue();
} else if (fileName in libFileMap) {
text = libFileMap[fileName];
} else if (fileName in this._extraLibs) { } else if (fileName in this._extraLibs) {
// extra lib // extra lib

@ -61,19 +61,11 @@ export class WorkerManager {
private _getClient(): Promise<TypeScriptWorker> { private _getClient(): Promise<TypeScriptWorker> {
if (!this._client) { 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], "javascript", monaco.Uri.file(key))
}
this._worker = monaco.editor.createWebWorker<TypeScriptWorker>({ this._worker = monaco.editor.createWebWorker<TypeScriptWorker>({
// module that exports the create() method and returns a `TypeScriptWorker` instance // module that exports the create() method and returns a `TypeScriptWorker` instance
moduleId: 'vs/language/typescript/tsWorker', moduleId: 'vs/language/typescript/tsWorker',
label: this._modeId, label: this._modeId,
keepIdleModels: true, keepIdleModels: true,
// passed in to the create() method // passed in to the create() method

Loading…
Cancel
Save