Omer Tuchfeld 9200d27a26 Stop inserting semicolon when extracting match arm
# Overview

Extracting a match arm value that has type unit into a function, when a
comma already follows the match arm value, results in an invalid (syntax
error) semicolon added between the newly generated function's generated
call and the comma.

# Example

Running this extraction

```rust
fn main() {
    match () {
        _ => $0()$0,
    };
}
```

would lead to

```rust
fn main() {
    match () {
        _ => fun_name();,
    };
}

fn fun_name() {
}
```

# Issue / Fix details

This happens because when there is no comma, rust-analyzer would simply
add the comma and wouldn't even try to evaluate whether it needs to add
a semicolon. But when the comma is there, it proceeds to evaluate
whether it needs to add a semicolon and it looks like the evaluation
logic erroneously ignores the possibility that we're in a match arm.
IIUC it never makes sense to add a semicolon when we're extracting from
a match arm value, so I've adjusted the logic to always decide against
adding a semicolon when we're in a match arm
2023-07-08 15:41:24 +02:00
..
2023-07-06 17:33:17 +03:30
2023-07-06 17:33:17 +03:30
2023-06-22 11:44:10 +02:00
2023-07-06 17:33:17 +03:30
2023-07-06 17:33:17 +03:30
2023-07-06 17:33:17 +03:30
2023-06-22 11:44:10 +02:00
2023-06-29 23:27:28 +09:00
2023-06-22 11:44:10 +02:00
2023-06-22 11:44:10 +02:00
2023-07-06 17:33:17 +03:30
2023-07-03 20:34:09 +02:00
2023-06-22 11:44:10 +02:00
2023-05-06 00:49:23 -07:00
2023-06-29 23:27:28 +09:00
2023-06-24 17:35:20 -07:00