dart-lang / dart-syntax-highlight

Tools and documentation for how Dart code is formatted
BSD 3-Clause "New" or "Revised" License
22 stars 11 forks source link

Fix colouring of "void" when used in type args #22

Closed DanTup closed 3 years ago

DanTup commented 3 years ago

The change in #21 lost colouring on void in type args (since it needs special handling for types that start with lowercase letters) because it wasn't previously included (and was coloured by regex that wasn't specific to the type args):

// Before this change Screenshot 2021-10-28 at 13 32 19

// With this change (which matches the behaviour before #21) Screenshot 2021-10-28 at 13 32 29

For this syntax, void is coloured like a built-in rather than a class name (although with semantic tokens, it has a modifier so that can be overridden by users/editors if they choose).

@devoncarew