[ty] Fix panic 'missing root' when handling completion request#20917
Merged
MichaReiser merged 1 commit intomainfrom Oct 16, 2025
Merged
[ty] Fix panic 'missing root' when handling completion request#20917MichaReiser merged 1 commit intomainfrom
MichaReiser merged 1 commit intomainfrom
Conversation
Contributor
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
Contributor
|
Contributor
|
Contributor
|
Just a note: I checked out this branch and tried it out, and it indeed fixes the problem I kept encountering in the linked issue. |
AlexWaygood
approved these changes
Oct 16, 2025
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
With the heavy caveat that I don't know much about the list_modules_in function, this makes sense to me
dcreager
added a commit
that referenced
this pull request
Oct 16, 2025
…rable * origin/main: [ty] Support dataclass-transform `field_specifiers` (#20888) Bump 0.14.1 (#20925) Standardize syntax error construction (#20903) [`pydoclint`] Implement `docstring-extraneous-parameter` (`DOC102`) (#20376) [ty] Fix panic 'missing root' when handling completion request (#20917) [ty] Run file watching tests serial when using nextest (#20918) [ty] Add version hint for failed stdlib attribute accesses (#20909) More CI improvements (#20920) [ty] Check typeshed VERSIONS for parent modules when reporting failed stdlib imports (#20908)
dcreager
added a commit
that referenced
this pull request
Oct 17, 2025
* main: [ty] Prefer declared type for invariant collection literals (#20927) [ty] Don't track inferability via different `Type` variants (#20677) [ty] Use declared variable types as bidirectional type context (#20796) [ty] Avoid unnecessarily widening generic specializations (#20875) [ty] Support dataclass-transform `field_specifiers` (#20888) Bump 0.14.1 (#20925) Standardize syntax error construction (#20903) [`pydoclint`] Implement `docstring-extraneous-parameter` (`DOC102`) (#20376) [ty] Fix panic 'missing root' when handling completion request (#20917) [ty] Run file watching tests serial when using nextest (#20918) [ty] Add version hint for failed stdlib attribute accesses (#20909) More CI improvements (#20920) [ty] Check typeshed VERSIONS for parent modules when reporting failed stdlib imports (#20908)
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
Fixes a panic in
list_modules_in(which is called by the completions request) when the file root for editable installs or a custom typeshed path was missing.Funnily enough, there were existing tests covering this already. Unfortunately, they also used their custom logic to register the file roots, so that the test passed, but the same request failed in production.
I used this PR as an opportunity to improve our file-root related logging and the information we include if a file root is missing.
Fixes astral-sh/ty#1363
Test Plan
Updated existing tests, added new test