Skip to content

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

Closed
@alion02

Description

@alion02

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions