Skip to content

fix: Add if..else completions in LetStmt and ArgList #20390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

A4-Tacks
Copy link
Contributor

@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
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