Merge pull request #68 from microsoft/lib_shortcuts

Allows setting lib with shortnames
This commit is contained in:
Alexandru Dima 2020-09-09 11:12:41 +02:00 committed by GitHub
commit 8a4357c301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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