Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Sep 6, 2025

Example

fn foo() {
    let _ = 2 el$0
}

->

fn foo() {
    let _ = 2 else {
        $0
    };
}

And fix the no completion semicolon for else in incomplete LetStmt of #20518

fn foo() {
    let _ = if true {} el$0
}

Before this PR:

fn foo() {
    let _ = if true {} else {
        $0
    }
}

After this PR:

fn foo() {
    let _ = if true {} else {
        $0
    };
}

Example
---
```rust
fn foo() {
    let _ = 2 el$0
}
```
->
```rust
fn foo() {
    let _ = 2 else {
        $0
    };
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 6, 2025
@lnicola lnicola changed the title Add allow else keyword completion in LetStmt fix: add else keyword completion after let statements Sep 8, 2025
@lnicola lnicola added this pull request to the merge queue Sep 8, 2025
Merged via the queue into rust-lang:master with commit a91fb2b Sep 8, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2025
@A4-Tacks A4-Tacks deleted the let-else-completion branch September 9, 2025 07:39
@A4-Tacks
Copy link
Member Author

Closed as completed for #20620

@A4-Tacks
Copy link
Member Author

Sorry, I mistook this for an issue

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.

3 participants