-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Go to definition (but skip generic intermediaries) #15315
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
Comments
Ye this would be really nice to have, the main question is the UX. It feels like we'd want something akin to a call hierarchy but for implementations that we can walk (iirc this isn't currently possible with chalk, but it might with the next trait solver if my memory serves right) |
Related: "Monomorphized" go to definition where we remember the type arguments; I mentioned this in #7890 but I think we still don't have a separate issue for it. I don't think this is limited by Chalk; we know the type arguments and just have to substitute them in. |
Ah, that was it. I thought we had an issue for that and went looking but didn't find anything either. Ye that seems doable then, the only problem to solve is how to keep the temporary knowledge about the type arguments for this. |
Take the following code as an example:
If you go to definition on
.into()
you probably want to get to the implementation of theFrom
trait but rust-analyzer will just take you to the following blanket implementation of the standard library:which is technically correct ... but not very helpful when you're trying to get to the definition of the actual conversion code. Especially in large code bases it can be hard to manually find where a trait is implemented.
So it would be great if rust-analyzer could offer an alternative "Go to definition (but skip generic intermediaries)" option.
(This would of course not just apply to
Into
but toTryInto
andstr::parse
as well.)The text was updated successfully, but these errors were encountered: