-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] followup: add-import action for reveal_type too
#21668
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 ✅ |
|
|
This specific one probably could be added as a Also, it's possible we shouldn't suggest this autofix when the Python version is <3.11. It was only added to the |
|
Oh that's an interesting wrinkle, we absolutely constantly suggest importing stuff from |
|
can you use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to exclude typing_extensions from our auto-import machinery for now, here. But I'd also be okay leaving as is, given that these are all still manual actions
ruff/crates/ty_ide/src/completion.rs
Lines 523 to 526 in 054e32e
| if symbol.module.file(db) == Some(file) || symbol.module.is_known(db, KnownModule::Builtins) | |
| { | |
| continue; | |
| } |
I think I'd prefer making this a Fix on the reveal_type diagnostic as it then also becomes available on the CLI
| let lint_name = lint_id.name(); | ||
| if lint_name == UNRESOLVED_REFERENCE.name() || lint_name == UNDEFINED_REVEAL.name() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let lint_name = lint_id.name(); | |
| if lint_name == UNRESOLVED_REFERENCE.name() || lint_name == UNDEFINED_REVEAL.name() { | |
| if lint_id == LintId::of(&UNRESOLVED_REFERENCE) || lint_id == LintId::of(&UNDEFINED_REVEAL){ |
|
Thinking about it more, just because it's Almost Definitely |
I think it's fine as an unsafe fix |
No description provided.