rust-analyzer/crates/ide-assists/src
bors 306defaef4 Auto merge of #16114 - roife:fix-inline-with-self-type, r=Veykril
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.
2024-01-02 10:53:35 +00:00
..
handlers Auto merge of #16114 - roife:fix-inline-with-self-type, r=Veykril 2024-01-02 10:53:35 +00:00
tests make generate_mut_trait_impl assist trigged for std trait only 2023-11-05 12:27:10 +08:00
utils internal: Move out WithFixture into dev-dep only crate 2023-12-18 15:24:08 +01:00
assist_config.rs Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
assist_context.rs Import serde derives on converting json to struct 2022-08-06 20:12:21 +04:30
lib.rs Don't explicitly warn against semicolon_in_expressions_from_macros 2023-12-05 11:35:09 +01:00
tests.rs Auto merge of #16082 - DropDemBits:structured-snippet-migrate-5, r=Veykril 2024-01-02 10:42:16 +00:00
utils.rs fix: use original range to deal with macros in promote_local_to_const 2024-01-02 10:33:48 +01:00