Replies: 1 comment 1 reply
-
GitHub uses the tree-sitter grammar you first highlighted (as denoted in the README.md file). The grammar in the vendor/grammars directory is only provided for compatibility with other users of Linguist and other grammars that may pull in some of the Rust syntax. As for getting this resolved, this is completely out of Linguist's control. The tree-sitter grammars are pulled in directly by the syntax highlighting engine as and when and by the team that maintains the highlighting engine. I know they're in the process of refactoring a few things so the Rust grammar may be updated at the same time. If you desperately have a critical reason for this, please open a support ticket, else wait and I'm sure the update will arrive. Closing as this isn't anything Linguist has any control over. |
Beta Was this translation helpful? Give feedback.
-
While reviewing a PR today I noticed that GitHub's syntax highlighting seems to incorrectly highlight Rust's let-else syntax.
let-else is a relatively recent addition to the language which was released in November 2022, so I assumed the underlying tooling might not fully support this yet.
Trying to understand what code is responsible for syntax highlighting, it seems that Linguist is used to select the language but then uses syntax grammars from other projects to implement syntax highlighting. I found the vendor list which refers to https://github.com/tree-sitter/tree-sitter-rust, which apparently has indirect updates. The latest release for that repo is from last week and there is a closed issue for let-else syntax.
However, looking at https://github.com/github-linguist/linguist/tree/main/vendor/grammars it seems the actual repo used for Rust might be https://github.com/dustypomerleau/rust-syntax, which has no tags and no releases and a last commit from 2 months ago, and no issues discussing let-else support.
So, curious what exactly the state here is?
Beta Was this translation helpful? Give feedback.
All reactions