mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 10:25:42 +01:00
Merge pull request #68 from microsoft/lib_shortcuts
Allows setting lib with shortnames
This commit is contained in:
commit
8a4357c301
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue