-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Show types of non-trivial string annotations in hovers #21758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
Currently locally I'm seeing panics on
I'm not really sure how my change could affect that assertion. Maybe because the string annotations sub-exprs have non-None NodeIndexes now..? |
|
|
|
Huh, that memory usage bump is a lot smaller than I expected. |
|
I wonder if implementing the optimization of storing this info in |
Summary
The basic implementation here is instead of only being able to lookup types by
&Exprwe can now look them up by(&Expr, &Expr)as well, where the second expression is a sub-expression in the sub-AST of a string annotation. This is a bit of a naive implementation that will probably cause an enormous amount of additional memory usage. A less naive implementation should probably shove this inextras.This also requires some adjustment to ensure the sub-expression has properly indexed AST nodes.
Test Plan
Existing tests cover the behaviour (snapshots updated).