From 65eecc539111c00c564153fa83beb69f45636afc Mon Sep 17 00:00:00 2001 From: Jordan Miller Date: Tue, 1 Sep 2026 04:19:15 -0400 Subject: [PATCH] Highlight .sx on GitHub as TypeScript GitHub Linguist has no entry for the `.sx` extension, so every SxfeScript file in the repository renders as unhighlighted plain text and is left out of the language statistics. Map the extension to TypeScript in .gitattributes. Of the grammars Linguist ships, TypeScript is the closest fit: SxfeScript is JavaScript plus erasable `:` type annotations, so declarations, strings, comments, numbers, regexes, template literals, and annotations all highlight correctly. The tokens it does not know are `let mut`, `&mut`, and `unsafe`, which fall back to plain identifier styling rather than breaking the rest of the line. This only affects rendering on github.com. The build, the tests, and the VS Code extension in tooling/vscode -- which has the real SxfeScript grammar -- are untouched. Co-Authored-By: Claude Opus 5 --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c3779e4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# GitHub Linguist does not know `.sx`, so it renders SxfeScript as plain text. +# TypeScript is the closest grammar it ships: same expression and statement +# syntax, same `:` type annotations. `let mut`, `&mut`, and `unsafe` are the +# only tokens it misses. The real grammar lives in +# tooling/vscode/syntaxes/sxfe.tmLanguage.json. +*.sx linguist-language=TypeScript