Repository navigation
Tint 0.1.0
First public release.
Tint
TextMate syntax colorization for .NET 8 and .NET 10, without native dependencies, trimming and NativeAOT safe.
- A port of vscode-textmate 9.3.2's tokenizer (
Tokenizer,
StateStack, injections,whilerules, captures with retokenization, back-referencedend/whilepatterns, time
budget), over GregsEx's Oniguruma flavor. Every case of the
vscode-textmate test suites passes, through runtime-loaded and generated grammars alike. TokenizeLine(ranges and scope stacks) andTokenizeLineEncoded(vscode-textmate's binarytokenizeLine2
layout, with token types and balanced bracket flags fromGrammarInfo). No allocation per line once warm.GrammarRegistry: grammars, embedded languages, injections, missing-grammar reporting, tokenizers and
highlighters.- Themes: VS Code JSON color themes (with
include) and.tmThemefiles, resolved as VS Code does
(ThemeLoadMode.VSCode) or as written (ThemeLoadMode.Raw);Theme.FromSource,Theme.Match,ColorMap. GrammarLoaderandThemeLoaderread JSON and plist files at runtime.Highlighterwith shiki-compatible HTML (HtmlRenderer: inline styles or CSS classes, line numbers, a light and
a dark theme or more through CSS variables) and 24-bit ANSI output (AnsiRenderer), to strings,TextWriter,
IBufferWriter<char>orStringBuilder.- The Tint source generator, in the package:
<TintGrammar>/<TintTheme>items and[TextMateGrammar]/
[TextMateTheme]attributes turn grammar and theme files into classes at build time; every regex is validated
then (an invalid pattern is a build error with its position), patterns are parsed on first use, and hot grammars
can opt into ahead-of-time compiled GregsEx kernels (Kernels). - Opt-in tier-2 compilation of hot patterns at runtime (
TokenizerOptions.CompileHotPatterns). - Themes whose file has no
nametake it from theDisplayNameitem metadata or attribute property (VS Code labels
Monokai, Monokai Dimmed and Tomorrow Night Blue from their extension'spackage.json).
Tint.Grammars
The 84 grammar files of Visual Studio Code's built-in extensions (51 extensions, synced from microsoft/vscode
3ac0f056), generated with Tint's source generator: one class per grammar (CSharpGrammar.Instance),
TintGrammars.CSharp-style properties, TintGrammars.All and TintGrammars.Find(scopeName). Trimming keeps only
the grammars an application references. Licenses in licenses/THIRD-PARTY-NOTICES.txt.
Tint.Themes
The 19 color themes of Visual Studio Code (Dark+, Light+, Dark Modern, the 2026 themes, high contrast, Monokai,
Solarized, Abyss and the others), generated the same way: TintThemes.DarkPlus, TintThemes.All,
TintThemes.Find(name).
Tint.Grammars.Sources and Tint.Themes.Sources
File-only development dependencies with the same VS Code grammar and theme files, for applications that generate
their own classes: $(TintGrammarsSourcesPath)/$(TintThemesSourcesPath) point at the files, @(TintGrammarsSourcesAll)
and @(TintThemesSourcesAll) list them with the bundles' metadata, and the generator compiles only the ones an
application includes, with its own names and kernels. Nothing ships with the application.
Verification
- vscode-textmate suites: 95 tokenization cases and the 72-file themes suite, through the loader and generated paths.
- Differential corpus check against TextMateSharp 2.0.4 over 10,345 files and 3.3 million lines, every difference
judged by vscode-textmate (report), and a 20-minute differential fuzz
campaign over the 84 grammars (report). - Trimmed and NativeAOT smoke apps on linux-x64 and osx-arm64.
Packages on nuget.org: Tint, Tint.Grammars, Tint.Themes, Tint.Grammars.Sources, Tint.Themes.Sources. Playground: https://sebastienros.github.io/tint/