Skip to content

Rainbow brackets on type generics #14985

@Seltyk

Description

@Seltyk

VS Code's built-in TypeScript syntax highlighting supports rainbow brackets for type generics, as evidenced by this repro.

type Test = Array<Array<Array<string>>>;

Admittedly, only the left angle brackets are rainbowified on my system, though I have seen correct coloring in real code.

rust-analyzer, does not rainbowify angle brackets, as evidenced by this repro

type Test = Option<(String, Vec<(bool, String)>)>

Clearly, it is possible to have rainbow type generics, and I would like to see that in future. It would make reading complex types (such as session types for network communication protocols) easier.
Of course, this Test type is a bit silly, and cargo clippy does warn about complex types, suggesting layered aliasing to make them easier to read and understand. However, the added readability of rainbow brackets should not be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vscodevscode plugin issuesS-blockedStatus: marked as blocked ❌ on something else such as an RFC or other implementation work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions