Skip to content

Highlight .sx on GitHub as TypeScript - #1

Merged
nanofuxion merged 1 commit into
mainfrom
sx-gitattributes
Sep 1, 2026
Merged

Highlight .sx on GitHub as TypeScript#1
nanofuxion merged 1 commit into
mainfrom
sx-gitattributes

Conversation

@nanofuxion

Copy link
Copy Markdown
Contributor

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.

This maps 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,
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.

Verified on examples/hello.sx rendered from a pushed branch: let and
function highlight as keywords, mut renders as a plain identifier, and the
& in &mut renders as an operator. No line loses its highlighting.

This only affects rendering on github.com. The build, the tests, and the
VS Code extension in tooling/vscode -- which carries the real SxfeScript
grammar at syntaxes/sxfe.tmLanguage.json -- are untouched.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@nanofuxion
nanofuxion merged commit 895d60b into main Sep 1, 2026
0 of 6 checks passed
@nanofuxion
nanofuxion deleted the sx-gitattributes branch September 1, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant