rust-analyzer/crates/syntax/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
..
ast Auto merge of #16378 - roife:fix/issue-15470, r=Veykril 2024-01-17 08:43:13 +00:00
parsing Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
tests Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra 2023-11-08 08:15:03 +02:00
validation Add semicolons for consistency 2021-10-03 23:39:43 +11:00
algo.rs ⬆️ rust-analyzer 2023-01-09 10:36:22 -08:00
ast.rs Add inlay hint for exclusive ranges 2024-01-07 09:33:56 +00:00
fuzz.rs ⬆️ rust-analyzer 2023-01-09 10:36:22 -08:00
hacks.rs ⬆️ rust-analyzer 2023-01-09 10:36:22 -08:00
lib.rs Split out rustc_lexer from rustc_dependencies 2024-01-08 15:24:46 +01:00
parsing.rs dead code 2021-12-28 19:13:30 +03:00
ptr.rs fix: Smaller spans for unresolved field and method diagnostics 2023-12-08 18:46:36 +01:00
syntax_error.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
syntax_node.rs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
ted.rs ⬆️ rust-analyzer 2023-01-09 10:36:22 -08:00
tests.rs Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
token_text.rs Implicit format args support 2023-12-05 17:07:00 +01:00
utils.rs Simplify and improve perf of import_assets::import_for_item 2023-12-12 11:35:34 +01:00
validation.rs Split out rustc_lexer from rustc_dependencies 2024-01-08 15:24:46 +01:00