GitHub Linguist — Vox language
GitHub Linguist — Vox language
Section titled “GitHub Linguist — Vox language”GitHub uses Linguist to classify repository languages for stats, syntax highlighting, and search. Vox source (.vox) should appear as Vox, not as generic text or another language.
Local repo configuration (done here)
Section titled “Local repo configuration (done here)”Root .gitattributes marks every .vox file:
*.vox text eol=lf linguist-language=Vox linguist-detectable=truelinguist-language=Vox— force the display name in GitHub language breakdowns.linguist-detectable=true— include.voxin language statistics (override Linguist heuristics that might skip small or mixed extensions).
This is effective on GitHub once the attributes file is on the default branch. It does not require an upstream Linguist merge, but upstream registration improves highlighting defaults and cross-repo consistency.
Upstream submission checklist
Section titled “Upstream submission checklist”Linguist accepts new languages when they have a real grammar, reasonable adoption, and maintainer responsiveness. Vox already ships a Tree-sitter grammar at tree-sitter-vox.
1. Prepare the grammar artifact
Section titled “1. Prepare the grammar artifact”- Grammar source:
tree-sitter-vox/grammar.js - Vocabulary SSOT:
tree-sitter-vox/GRAMMAR_SSOT.md - Regenerate when the compiler vocabulary changes:
vox grammar --format ssot-markdown --output tree-sitter-vox/GRAMMAR_SSOT.md(seevox ci grammar-ssot-parity).
Ensure tree-sitter-vox builds cleanly:
cd tree-sitter-voxnpm installnpx tree-sitter generatenpx tree-sitter test2. Fork github/linguist
Section titled “2. Fork github/linguist”-
Fork github/linguist.
-
Add
vendor/grammars/tree-sitter-voxas a git submodule pointing at this repo’stree-sitter-voxdirectory (or the published mirror once split). -
Edit
languages.ymlwith a new entry:Vox:type: programmingcolor: "#5B4FCF"extensions:- ".vox"tm_scope: source.voxace_mode: textcodemirror_mode: nullcodemirror_mime_type: text/x-voxlanguage_id: <next free id — check linguist languages.yml> -
Add a sample under
samples/Vox/(≥25 lines of representative.voxfromexamples/golden/). -
Run Linguist’s test suite locally:
script/cibuildorbundle exec rake testper upstream docs.
3. Open the pull request
Section titled “3. Open the pull request”- Title:
Add Vox language - Link to
tree-sitter-voxand the Vox project site. - Note that the canonical compiler is
vox-compiler(recursive descent); Tree-sitter is for highlighting and editor tooling. - Respond to reviewer feedback on sample size, grammar conflicts, and
language_idallocation.
4. After merge
Section titled “4. After merge”- Remove or relax repo-level
linguist-languageoverrides only if upstream detection is reliable. - Keep
.gitattributestext eol=lffor cross-platform line endings regardless of Linguist status.
Related
Section titled “Related”- Editor integrations — VS Code, Tree-sitter, LSP
- Parser ambiguity inventory — compiler vs Tree-sitter roles
tree-sitter-vox/README.md— local grammar build steps