Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Aug 5, 2025

Example

let x = $0;

Old completions:

let x = if $1 {
    $0
};

This PR current completions:

let x = if $1 {
    $2
} else {
    $0
};

Example
===
```rust
let x = $0;
```

Old completions:

```rust
let x = if $1 {
    $0
};
```

This PR current completions:

```rust
let x = if $1 {
    $2
} else {
    $0
};
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 5, 2025
@ChayimFriedman2
Copy link
Contributor

I'm torn whether we should name them "if else" to reflect their emitted code, or "if" for consistency with the normal case. @rust-lang/rust-analyzer thoughts?

@Veykril
Copy link
Member

Veykril commented Aug 13, 2025

Keeping if as the name seems fine to me

Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Aug 13, 2025
Merged via the queue into rust-lang:master with commit b06ce60 Aug 13, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 13, 2025
@lnicola lnicola changed the title Add if..else completions in LetStmt and ArgList fix: Add if..else completions in LetStmt and ArgList Aug 13, 2025
@A4-Tacks A4-Tacks deleted the if-else-comp-in-args-or-let branch August 14, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants