mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-19 08:34:09 +00:00
306defaef4
fix: self type replacement in inline-function Fix #16113, fix #16091 The problem described in this issue actually involves three bugs. Firstly, when using `ted` to modify the syntax tree, the offset of nodes on the tree changes, which causes the syntax range information from `hir` to become invalid. Therefore, we need to edit the AST after the last usage for `usages_for_locals`. The second issue is that when inserting nodes, it's necessary to use `clone_subtree` for duplication because the `ted::replace` operation essentially moves a node. The third issue is that we should use `ancestors_with_macros` instead of `ancestors` to handle impl definition in macros. I have fixed the three bugs mentioned above and added unit tests. |
||
---|---|---|
.. | ||
handlers | ||
tests | ||
utils | ||
assist_config.rs | ||
assist_context.rs | ||
lib.rs | ||
tests.rs | ||
utils.rs |