mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
Report JSX-lowered files to the checker server as changed
The program the lowering compiles serves each file that has JSX at its own path, with the JSX rewritten to calls (host.addVirtualFile). The host reported such a path to the checker server as created whenever it was not virtual yet. The files exist on disk and the server had already read them for the program that checks them as written, so tsgo kept their original text, and lowering met the JSX syntax: SC1090 "syntax 'JsxFragment' is not supported yet" in 6822, 6824 and 6825 under SCRIPTC_CHECKER=tsgo, while tsc-ts reread the files. A virtual file that replaces a file on disk is now reported as changed, and both checkers give the same LLVM IR and diagnostics for the JSX corpus programs.
This commit is contained in:
@@ -192,7 +192,10 @@ export class Ts7Host {
|
||||
const key = tsgoPath(path);
|
||||
if (this.virtualFiles.get(key) === content) return;
|
||||
if (!this.virtualChanges.has(key))
|
||||
this.virtualChanges.set(key, this.virtualFiles.has(key) ? "changed" : "created");
|
||||
this.virtualChanges.set(
|
||||
key,
|
||||
this.virtualFiles.has(key) || trackedFileExists(path) ? "changed" : "created",
|
||||
);
|
||||
this.virtualFiles.set(key, content);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user