Skip to content

Commit

Permalink
Allows setting lib with shortnames
Browse files Browse the repository at this point in the history
  • Loading branch information
orta authored and Pierre Guillaume Herveou committed Sep 21, 2020
1 parent ba0ff0d commit a273b29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a273b29

Please sign in to comment.