rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Fix: Handle Self replacement contextually in inline assists

Open phyBrackets opened this issue 7 months ago • 1 comments

Only replace Self when inlining across different impl contexts, and use bare type names for expression contexts to avoid turbofish issues.

Fixes rust-lang/rust-analyzer#19827

phyBrackets avatar Jun 20 '25 08:06 phyBrackets

Thanks @Veykril for the feedback, I think it does make sense that we should leverage and extend the existing PathTransform mechanism that's already used for generic argument rewriting. I have updated the patch based on your review.

phyBrackets avatar Jun 20 '25 10:06 phyBrackets