Skip to content

Clear stale incremental diagnostics after JSON module changes - #64026

Open
Jake Bailey (jakebailey) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-incremental-json-diagnostics
Open

Clear stale incremental diagnostics after JSON module changes#64026
Jake Bailey (jakebailey) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-incremental-json-diagnostics

Conversation

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Incremental builds retained diagnostics from an earlier JSON module shape after the JSON file was fixed.

  • Root cause: JSON modules used an empty declaration emit as their shape signature, so subsequent content changes appeared shape-equivalent.
  • Change: Use the JSON file’s content version as its shape signature, invalidating dependent diagnostics on every content change.
  • Coverage: Add a regression covering valid JSON, removal of a required property, and restoration of that property.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incremental diagnostics not clearing after JSON file fix Clear stale incremental diagnostics after JSON module changes Aug 26, 2026
@jakebailey
Jake Bailey (jakebailey) requested a balanced review from Copilot August 26, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates incremental compilation so JSON content changes invalidate dependent diagnostics.

Changes:

  • Uses JSON file versions as shape signatures.
  • Adds a regression test covering property removal and restoration.
  • Adds the expected incremental-build baseline.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tsc/internal/execute/incremental/affectedfileshandler.go Handles JSON shape signatures correctly.
tsc/internal/execute/tsctests/tsc_test.go Adds the regression scenario.
tsc/testdata/baselines/reference/tsc/incremental/json-module-diagnostics-are-cleared-after-fixing-the-json-file.js Records expected diagnostics and invalidation behavior.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@jakebailey
Jake Bailey (jakebailey) marked this pull request as ready for review August 26, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--incremental: diagnostics caused by a JSON module are never cleared after the JSON file is fixed (7.0.2)

4 participants