Repository navigation
grammar(ts): vendor our tree-sitter-typescript fork (84ffdb8) - #16
Merged
Merged
Conversation
The TypeScript grammar now comes from inth3shadows/tree-sitter-typescript 84ffdb8, our fork (marionebl 53071c9 + dokimasia's import-type commits + our fixes), which runs the tsc differential as its own CI. It is private during burn-in, so docs/grammars/tree-sitter-typescript.patch stays the public, reproducible form: applied to marionebl 53071c9 it gives the fork's common/ byte for byte. New since PR #15, each gated in the fork and diffed node by node: tagged templates with type arguments (sql<Row>`...`), `unique` as a name, and tuple labels named like type keywords (upstream colbymchenry#378). Differential here: 32 -> 3 (effect 29 -> 3, vscode 3 -> 0), new 0, worse 0. Adds the fork's three tsc fixtures (ts + tsx).
Round-1 review of #16 found two regressions from the fork's new rules, fixed in the fork (fa2be11, its PR #7): - keyword tuple labels made `[type]`, `[get, set]`, `[declare?]` fail; labels are now only words that already lex as keywords where a type starts; - `unique` as a reserved identifier broke `f<typeof unique>(x)`; backed out, so `i < unique.length` is a gap fixture again (VS Code's 2 files diverge, as on em.34). New __tests__/typescript-grammar-fork-shapes.test.ts pins the node shapes and the call edges (sql<Row>`...`, behind await, on a member; tuple labels; typeof unique): 4 failed on 84ffdb8, 8 passed on fa2be11. Docs: an operator before a typed tag (shared with generic calls), the unique gap, `in?:`/`in<T>()` members, the Json5 line, a tag with 2+ type args inside an argument list; the rebuild runs `tree-sitter test`; the move checklist lists every vendored file, the hashes, and the marker caveat. The fork commit is named once, in the grammar doc. Differential: 201 -> 5 (effect 3, vscode 2), worse 0.
…s only) The fork's 1439129 changes comments only (generated parsers and wasm are unchanged); the patch and the define-grammar.js hash follow it. Known limits now say exactly which unique, tuple-label and in?/in<T>() forms fail, and the shapes test pins the other typeof unique forms the round-1 regression broke.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Vendors the TypeScript grammar from our fork,
inth3shadows/tree-sitter-typescript@84ffdb8(private during burn-in).docs/grammars/tree-sitter-typescript.patchapplied to marionebl 53071c9 reproduces the fork'scommon/byte for byte, so the build stays reproducible from public sources.New since #15, each landed in the fork under its own differential CI plus a node-by-node tree diff (only files with the targeted construct changed):
sql<{ id: number }>`SELECT ...`: acall_expressionbranch under the generic call's precedence with required type argumentsuniqueas a name outsideunique symbol[symbol: string],[number?: string], upstream fix: center docs content on wide screens colbymchenry/codegraph#378)Differential
new 0, worse 0; local 45 fixtures (5 gap).
Tests
npm run build:kernelexit 0;npm run buildexit 0.npx vitest run:Tests 3 failed | 11084 passed. The 3 failures: ui-server-api "busiest symbol" (fails on main too, it reads the local.codegraph), and twofunction-ref.test.tsCaller/impact graph misses methods passed as first-class references (callbacks), e.g. executor.submit(obj.method, …) colbymchenry/codegraph#1820 cases that hit the 60s timeout under full-suite load; alone they pass (36/36) on this grammar, on em.34's grammar, and withCODEGRAPH_KERNEL=0.No EXTRACTION_VERSION bump (fork re-indexes manually).