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
feat(highlight): bundled TextMate TypeScript grammar for embedded contexts
<script lang="ts"> is the dominant real-world Vue pattern, but it fell
back to JS-approximation highlighting because fresh had no TextMate
TypeScript grammar (TS buffers are tree-sitter). Add a compact
house-style TS grammar (like the existing dart/kotlin ones) so embedded
regions resolve "ts" to real TS-aware highlighting — interface/type/
enum/namespace keywords, primitive-type names, decorators — in Vue
blocks and Markdown ```ts fences alike.
Vendoring Sublime's official TypeScript syntax is not an option: it
relies on branch_point, which no released syntect supports (checked:
5.3.0, Sep 2025, is current and fresh already uses it).
Buffer routing is unchanged by design: the grammar catalog skips
"TypeScript" by name exactly like the existing "JavaScript" skip, so
.ts files keep the richer tree-sitter highlighting while
find_syntax_by_token("ts") still resolves the new grammar for embedded
regions. The pre-existing backend-selection test (test.ts →
tree-sitter) pins that this doesn't flip.
The unresolvable-lang fallback test now uses a genuinely unknown token,
since lang="ts" resolving is the new behavior (covered by its own
tests: TS-only constructs get categories the JS fallback never gave).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKX2Du2zizG7k9yZgMeZvS
0 commit comments