Skip to content
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

Inline hints on closing brace of labeled blocks and loops #17582

Closed
alion02 opened this issue Jul 12, 2024 · 1 comment · Fixed by #17635
Closed

Inline hints on closing brace of labeled blocks and loops #17582

alion02 opened this issue Jul 12, 2024 · 1 comment · Fixed by #17635
Assignees
Labels
A-inlay-hints inlay/inline hints C-feature Category: feature request

Comments

@alion02
Copy link

alion02 commented Jul 12, 2024

Currently dealing with code like this:

'end: {
    'do_a: {
        'do_b: {
            match value {
                0 => { stuff(); break 'do_a; }
                1 => { things(); break 'do_a; }
                2 => { foo(); break 'do_b; }
                3 => { bar(); break 'do_b; }
                _ => { zeta(); break 'end; }
            }
        }
        // code
        break 'end;
    }
    // more code
}
// etc

It would be nice if rust-analyzer could render the labels after each labeled block, like so:

'end: {
    'do_a: {
        'do_b: {
            match value {
                0 => { stuff(); break 'do_a; }
                1 => { things(); break 'do_a; }
                2 => { foo(); break 'do_b; }
                3 => { bar(); break 'do_b; }
                _ => { zeta(); break 'end; }
            }
        } ['do_b]
        // code
        break 'end;
    } ['do_a]
    // more code
} ['end]
// etc
@alion02 alion02 added the C-feature Category: feature request label Jul 12, 2024
@alion02
Copy link
Author

alion02 commented Jul 12, 2024

Probably related to #15580

@lnicola lnicola added the A-inlay-hints inlay/inline hints label Jul 12, 2024
@Young-Flash Young-Flash self-assigned this Jul 13, 2024
@bors bors closed this as completed in 6f84bdd Jul 20, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue Jul 28, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inlay-hints inlay/inline hints C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants