Skip to content

Clear stale incremental diagnostics after JSON module changes - #64026

Merged
Jake Bailey (jakebailey) merged 3 commits into
mainfrom
copilot/fix-incremental-json-diagnostics
Sep 1, 2026
Merged

Clear stale incremental diagnostics after JSON module changes#64026
Jake Bailey (jakebailey) merged 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
@jakebailey

Copy link
Copy Markdown
Member

I added the comment so need a re-review.

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 1, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Sep 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 1, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 13e158b Sep 1, 2026
43 of 45 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the copilot/fix-incremental-json-diagnostics branch September 1, 2026 19:20
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

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