From 4b95ebf2d2f5d1d90c59d5adb2f08567510e9181 Mon Sep 17 00:00:00 2001 From: Cold Fry Date: Wed, 8 Apr 2026 19:55:50 +0900 Subject: [PATCH] scope semantic check to changed files in incremental builds --- internal/transpiler/transpiler.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/transpiler/transpiler.go b/internal/transpiler/transpiler.go index ae6ab87..b854ecb 100644 --- a/internal/transpiler/transpiler.go +++ b/internal/transpiler/transpiler.go @@ -387,7 +387,16 @@ func TranspileProgramWithOptions(program *compiler.Program, sourceRoot string, l // Trigger semantic analysis so the checker populates alias reference data // (needed for import elision via IsReferencedAliasDeclaration). - compiler.Program_GetSemanticDiagnostics(program, context.Background(), nil) + if onlyFiles != nil { + // Incremental: only check files we're actually transpiling. + for _, sf := range program.SourceFiles() { + if onlyFiles[sf.FileName()] { + compiler.Program_GetSemanticDiagnostics(program, context.Background(), sf) + } + } + } else { + compiler.Program_GetSemanticDiagnostics(program, context.Background(), nil) + } crossFileEnums := collectCrossFileEnums(program)