Allows setting lib with shortnames

pull/2748/head
Orta 5 years ago
parent 4f7c1f574f
commit 70d1cb1704

@ -71,11 +71,14 @@ export class TypeScriptWorker
_getScriptText(fileName: string): string | undefined { _getScriptText(fileName: string): string | undefined {
let text: string; let text: string;
let model = this._getModel(fileName); let model = this._getModel(fileName);
const libizedFileName = 'lib.' + fileName + '.d.ts';
if (model) { if (model) {
// a true editor model // a true editor model
text = model.getValue(); text = model.getValue();
} else if (fileName in libFileMap) { } else if (fileName in libFileMap) {
text = libFileMap[fileName]; text = libFileMap[fileName];
} else if (libizedFileName in libFileMap) {
text = libFileMap[libizedFileName];
} else if (fileName in this._extraLibs) { } else if (fileName in this._extraLibs) {
// extra lib // extra lib
text = this._extraLibs[fileName].content; text = this._extraLibs[fileName].content;

Loading…
Cancel
Save