Add API to .d.ts

This commit is contained in:
Alex Dima 2020-02-17 16:56:39 +01:00
parent a5b927fca1
commit aee134f9c1
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
2 changed files with 11 additions and 2 deletions

View file

@ -69,7 +69,11 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.language
return '';
}
getScriptText(fileName: string): string | undefined {
getScriptText(fileName: string): Promise<string | undefined> {
return Promise.resolve(this._getScriptText(fileName));
}
_getScriptText(fileName: string): string | undefined {
let text: string;
let model = this._getModel(fileName);
if (model) {
@ -92,7 +96,7 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.language
}
getScriptSnapshot(fileName: string): ts.IScriptSnapshot | undefined {
const text = this.getScriptText(fileName);
const text = this._getScriptText(fileName);
if (!text) {
return;
}