浏览代码

Merge pull request #3023 from andrewbranch/update-03152022

Add new required methods to LanguageServiceHost
Henning Dieterichs 3 年之前
父节点
当前提交
ca2692a0dc
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/language/typescript/tsWorker.ts

+ 8 - 0
src/language/typescript/tsWorker.ts

@@ -181,6 +181,14 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
 		return fileName === this.getDefaultLibFileName(this._compilerOptions);
 	}
 
+	readFile(path: string): string | undefined {
+		return this._getScriptText(path);
+	}
+
+	fileExists(path: string): boolean {
+		return this._getScriptText(path) !== undefined;
+	}
+
 	async getLibFiles(): Promise<Record<string, string>> {
 		return libFileMap;
 	}