You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: New JavaScript features (e.g. the nullish coalescing operator ??) break syntax highlighting in .vue files on GitHub:
<script>constfoo= bar ?? baz</script>
Why?
GitHub uses the TextMate syntax definitions of this repository for its syntax highlighting of Vue SFC files (see: https://github.com/github-linguist/linguist/blob/main/vendor/README.md). Any TextMate-based syntax definition that injects JavaScript code will then use atom/language-javascript for its JavaScript highlighting. Unfortunately, this repository is unmaintained and was archived almost 3 years ago. Therefore, it will not support any new JavaScript language features.
Create Tree-sitter syntax files that can be used by all supporting code editors.
Make GitHub use these new files instead of the old TextMate syntax files.
Note
There are two unmaintained third-party repositories that have implemented a Tree-sitter syntax for Vue. They could be used for "inspiration" to create official tree-sitter syntax files:
What problem does this feature solve?
TL;DR: New JavaScript features (e.g. the nullish coalescing operator
??) break syntax highlighting in.vuefiles on GitHub:Why?
GitHub uses the TextMate syntax definitions of this repository for its syntax highlighting of Vue SFC files (see: https://github.com/github-linguist/linguist/blob/main/vendor/README.md). Any TextMate-based syntax definition that injects JavaScript code will then use atom/language-javascript for its JavaScript highlighting. Unfortunately, this repository is unmaintained and was archived almost 3 years ago. Therefore, it will not support any new JavaScript language features.
→ All
.htmlfiles on GitHub are already highlighted using Tree-sitter (see: https://github.com/github-linguist/linguist/blob/1b43482ac6ab97394a70946cb041f3fa5f3284b5/script/list-grammars#L18):Lengthy discussion on this topic, for reference:
What does the proposed solution look like?
Note
There are two unmaintained third-party repositories that have implemented a Tree-sitter syntax for Vue. They could be used for "inspiration" to create official tree-sitter syntax files: