rust-analyzer/crates/ide-assists/src
bors f4fec4ff65 Auto merge of #16378 - roife:fix/issue-15470, r=Veykril
fix: better handling of SelfParam in assist 'inline_call'

fix #15470.

The current `inline_call` directly translates `&self` into `let ref this = ...;` and `&mut self` into `let ref mut this = ...;`. However, it does not handle some complex scenarios.

This PR addresses the following transformations (assuming the receiving object is `obj`):

- `self`: `let this = obj`
- `mut self`: `let mut this = obj`
- `&self`: `let this = &obj`
- `&mut self`
  + If `obj` is `let mut obj = ...`, use a mutable reference: `let this = &mut obj`
  + If `obj` is `let obj = &mut ...;`, perform a reborrow: `let this = &mut *obj`
2024-01-17 08:43:13 +00:00
..
handlers Auto merge of #16378 - roife:fix/issue-15470, r=Veykril 2024-01-17 08:43:13 +00:00
tests Auto merge of #16209 - l1nxy:add-merge-nested-if, r=Veykril 2024-01-10 09:18:05 +00:00
utils Use HashSet to enhance performance in for_unique_generic_name in suggest_name 2024-01-02 21:33:06 +08: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 complete merge_nested_if with bugs. 2023-12-29 18:32:37 +08: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