-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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.