[ty] Fix handling of non-Python text documents by BurntSushi · Pull Request #23704 · astral-sh/ruff (original) (raw)

BurntSushi

@ntBre ntBre added the ty

Multi-file analysis & type inference

label

Mar 4, 2026

MichaReiser

@BurntSushi

In #22449, I added a check to our "did open" handler to effectively ignore notifications for text documents that we were sure weren't Python. This was meant to fix a case where we could return diagnostics for non-Python files, which was undesirable.

However, it seems like that might have been too big of a hammer. It seems like we might still want to track non-Python text files in our index but not our project. Otherwise subsequent requests regarding that non-Python file result in log messages saying that ty doesn't know about the file. i.e., a state synchronization issue.

Addresses #23121 (comment)

MichaReiser

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})