From d6d2a0beb60ef1cb6cf75a31a8343dafb472bf62 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Fri, 24 Mar 2023 16:31:51 +0900 Subject: [PATCH] chore: add comment --- src/ts.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ts.ts b/src/ts.ts index 21a642d..0e37a6c 100644 --- a/src/ts.ts +++ b/src/ts.ts @@ -152,6 +152,7 @@ export class TSService { this.currTarget.filePath === normalizeFileName(fileName) && isExtra(fileName, extraFileExtensions) ) { + // Parse the target file as TSX. return (this.currTarget.sourceFile ??= ts.createSourceFile( this.currTarget.filePath, this.currTarget.code, @@ -170,6 +171,7 @@ export class TSService { }; /* eslint-enable @typescript-eslint/unbound-method -- ignore */ host.getSourceFile = (fileName, languageVersionOrOptions, ...args) => { + // Always call the original function, because it calls the file watcher. const originalSourceFile = original.getSourceFile.call( host, fileName, @@ -187,6 +189,7 @@ export class TSService { languageVersionOrOptions, ...args ) => { + // Always call the original function, because it calls the file watcher. const originalSourceFile = original.getSourceFileByPath.call( host, fileName,