Skip to content

[ty] Fix stale semantic tokens after opening the same document with new content#22414

Merged
MichaReiser merged 1 commit intomainfrom
micha/fix-stale-semantic-tokens
Jan 6, 2026
Merged

[ty] Fix stale semantic tokens after opening the same document with new content#22414
MichaReiser merged 1 commit intomainfrom
micha/fix-stale-semantic-tokens

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jan 6, 2026

Summary

Fixes astral-sh/ty#2346
Fixes astral-sh/ty#2353

We never synced the File::revision after closing a file, but we should to ensure File::revision reverts back to using the file's last modified timestamp.

Test Plan

Added E2E test

@MichaReiser MichaReiser added bug Something isn't working server Related to the LSP server ty Multi-file analysis & type inference labels Jan 6, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 6, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

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

Thanks!

I tested out that this also fixes astral-sh/ty#2353.

@MichaReiser MichaReiser merged commit acbc83d into main Jan 6, 2026
47 checks passed
@MichaReiser MichaReiser deleted the micha/fix-stale-semantic-tokens branch January 6, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale diagnostics when content is updated outside the editor Stale Semantic Tokens After didClose/didOpen

2 participants