mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +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 {
|
_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…
Add table
Add a link
Reference in a new issue