Skip to content

Refresh diagnostics when a content-mapped or declaration file changes on disk - #64944

Open
Lubos (mrlubos) wants to merge 1 commit into
microsoft:mainfrom
mrlubos:fix/content-mapper-watch-refresh
Open

Lubos (mrlubos) wants to merge 1 commit into
microsoft:mainfrom
mrlubos:fix/content-mapper-watch-refresh

Conversation

@mrlubos

@mrlubos Lubos (mrlubos) commented Oct 23, 2026 •

Copy link
Copy Markdown

#64159 changed DidChangeWatchedFiles to read the extension through path.Extension(), which knows only TypeScript's own extensions. A content-mapped file such as shape.data got "" and was treated as a possible directory, so the content mapper extension check was never reached. A .d.ts file got ".d.ts", which isRelevantExtension does not list. Neither change scheduled a diagnostics refresh.

Fixes #64943

Copilot AI balanced review requested due to automatic review settings October 23, 2026 20:51
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 23, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 23, 2026

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.

🟢 Approval recommended

The focused fix addresses both extension-filtering failures, preserves directory handling, and includes targeted regression coverage.

No open issues 🎉

What changed in this PR

Fixes #64943 by ensuring disk changes to content-mapped and declaration files trigger diagnostics refreshes in the language server.

Changes:

  • Checks content-mapper extensions before TypeScript-specific extension detection.
  • Treats recognized declaration extensions as relevant to diagnostics.
  • Adds regression tests for both refresh scenarios.
File Description
tsc/​internal/​project/​session.go Corrects watched-file filtering for mapped and declaration files.
tsc/​internal/​project/​session_test.go Tests diagnostics refresh after a declaration file changes on disk.
tsc/​internal/​project/​contentmapper_test.go Tests diagnostics refresh after a content-mapped file changes on disk.

Review effort: Balanced

… on disk

microsoft#64159 changed DidChangeWatchedFiles to read the extension through path.Extension(), which knows only TypeScript's own extensions. A content-mapped file such as shape.data got "" and was treated as a possible directory, so the content mapper extension check was never reached. A .d.ts file got ".d.ts", which isRelevantExtension does not list. Neither change scheduled a diagnostics refresh.

Fixes microsoft#64943
@mrlubos
Lubos (mrlubos) force-pushed the fix/content-mapper-watch-refresh branch from 62451b9 to f8edd05 Compare October 23, 2026 20:59
@mrlubos

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Hey API"

This branch has not been deployed

No deployments
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: Not started

Development

Successfully merging this pull request may close these issues.

File changed on disk with a content-mapped or .d.ts extension never triggers workspace/diagnostic/refresh

2 participants