The cause of the regression is that GitHub recently switched from Linguist to tree-sitter-rust for Rust code highlighting.
The first bug is a one-liner in queries/highlights.scm. The second bug is more complicated. Part of it is due to handling (identifier) and (scoped_identifier) but not (type_identifier) and (scoped_type_identifier), but after that, it's probably impossible to distinguish names of struct-like enum variants from names of structs in (struct_pattern) using this pattern language. So whether we highlight them as enum variants (which would be correct in this example) or as type names, we'll be wrong sometimes.
Some folks noticed that GitHub's code highlighting for Rust recently regressed. Some examples are
not highlighting
async
as a keyword inhighlighting the two match arms differently in
The cause of the regression is that GitHub recently switched from Linguist to
tree-sitter-rust
for Rust code highlighting.The first bug is a one-liner in queries/highlights.scm. The second bug is more complicated. Part of it is due to handling
(identifier)
and(scoped_identifier)
but not(type_identifier)
and(scoped_type_identifier)
, but after that, it's probably impossible to distinguish names of struct-like enum variants from names of structs in(struct_pattern)
using this pattern language. So whether we highlight them as enum variants (which would be correct in this example) or as type names, we'll be wrong sometimes.