rust-analyzer/crates/ide_assists/src
bors[bot] 7409880a07
Merge #11061
11061: Support "move if to guard" for if else chains r=weirane a=weirane

The idea is to first parse the if else chain into a vector of `(Condition, BlockExpr)`s until we reach an iflet branch, an else branch, or the end (the tail). Then add the match arms with guard for the vector, and add the tail with no if guard.

Because the whole original match arm is replaced and the generated code doesn't have redundent commas, I removed redundent commas in some test cases.

Closes #11033.

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2022-01-03 17:59:00 +00:00
..
handlers Merge #11061 2022-01-03 17:59:00 +00:00
tests Update generated tests 2022-01-03 09:48:50 -08:00
utils internal: move all the lexing to the parser crate 2021-12-18 17:20:38 +03:00
assist_config.rs 7526: Rename crate assists to ide_assists. 2021-02-23 00:59:16 +05:30
assist_context.rs Make AssistContext::frange private 2021-10-13 14:39:37 +02:00
lib.rs Merge #10998 2021-12-13 18:49:06 +00:00
tests.rs minor: fixup generate assist priorities 2021-12-13 16:42:21 +01:00
utils.rs Merge #11062 2021-12-20 09:14:38 +00:00