| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
The focused fix correctly uses the existing compiler-diagnostic fallback and includes regression coverage.
Review effort: Balanced
Findings: None
Prevents API crashes when synthetic programs without config files report project-reference diagnostics.
Changes:
| File | Description |
|---|---|
| tsc/internal/tsoptions/tsconfigparsing.go | Falls back when reference syntax is unavailable. |
| tsc/internal/api/session_createprogram_test.go | Verifies non-composite reference diagnostics. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #64629
A program created through createPrograms has no configuration file, so its ParsedCommandLine.ConfigFile is nil. Any project reference diagnostic on such a program crashes the API server with a nil pointer dereference in CreateDiagnosticAtReferenceSyntax.
Impact: a tool that builds its own program for a repository that references a non-composite project kills the whole API server process, losing every open snapshot, and the tool sees only an EOF. That is an ordinary monorepo setup, where tsc -p reports TS6306 and keeps going, so an analyzer on the API stops on that repository instead of analyzing it.
CreateDiagnosticAtReferenceSyntax now returns nil when ConfigFile is nil, and its caller in verifyProjectReferences already falls back to a compiler diagnostic in that case.
TestCreateProgramReportsNonCompositeProjectReference creates such a program with a reference to a non-composite project and expects TS6306 as its only program diagnostic, and it panics without the fix.
I met this while building deadset-ts, the TypeScript analyzer of deadset, on the TypeScript 7 API. That work hit a small set of related defects, which is why a few reports come from me.
An AI coding agent wrote this patch. I have read, built and tested it and will handle the review.