[ty] Don't show diagnostics for excluded files#22455
Merged
MichaReiser merged 1 commit intomainfrom Jan 8, 2026
Merged
Conversation
MichaReiser
commented
Jan 8, 2026
| } | ||
| GlobFilterCheckMode::Adhoc => { | ||
| for ancestor in path.ancestors() { | ||
| match self.ignore.matched(ancestor, directory) { |
Member
Author
There was a problem hiding this comment.
We incorrectly passed the value directory here; it should always be true when testing the ancestor paths.
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
Gankra
reviewed
Jan 8, 2026
Comment on lines
+916
to
+920
| // Only mark this file as open if it's part of the project. | ||
| // This ensures that we don't show diagnostics for files outside the project. | ||
| if project.is_file_included(db, system_path) { | ||
| project.open_file(db, file); | ||
| } |
Contributor
There was a problem hiding this comment.
(This part feels genuinely kinda suspicious but I'm taking your word for it that this won't do something Really Bad)
Member
Author
There was a problem hiding this comment.
Haha yeah. We mainly use open_files in Project to determine which files we need to type-check. I think the only other use case is that we use it to determine which ASTs we shouldn't GC when checking is done. But, given that we don't check those files, this isn't a code path that we hit.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Respect the
excludepatterns in the LSP so that we don't show diagnostics in excluded files.Test Plan
Added e2e test