Repository navigation
Mirror #3226: parse TS variance annotations - #13
Merged
Merged
Conversation
…n out T>`) Vendor tree-sitter-typescript v0.23.2 with a grammar patch, regenerated with tree-sitter-cli 0.25.10, for both the wasm and the kernel (which now compiles the same C instead of the crate). `type_parameter` takes an optional `in` / `out` / `in out`, with `const` on either side; `out` stays usable as a parameter name (upstream colbymchenry#364's rule + brajevicm@9fcaa13). Known limit: a type or JSX tag literally named `out`/`in` right after an expression `<` (`<out>x`, `<out>…</out>`) no longer parses; accepting `out` as a type name everywhere instead broke `[out: T]` tuple labels. Effect: 239 -> 185 files with a parse error, 54 newly clean, none newly broken; Zod 4 -> 0. VS Code src/ and Excalidraw (.ts/.tsx) parse to identical trees. Provenance in docs/grammars/tree-sitter-typescript.md.
…g claims Review follow-ups on the variance patch: assert tree shape (call_expression type arguments, mapped-type and type-predicate names, tuple labels) rather than only hasError; make the extraction test fail without the patch; scope the indexing setup to the test that uses it; drop the next-line-method guard (it belongs with the colbymchenry#335 scanner change). The changelog no longer names Effect files that colbymchenry#335 still blocks, and the docs list the `<out.Provider>` tsx limit, the real over-acceptance (`<out in>`), and that the second `const` is ours rather than colbymchenry#364's.
The patched grammar fixes 54 Effect files, all 4 Zod files and the variance.ts fixture; Excalidraw and VS Code are unchanged; no new errors.
… README cites fix PRs colbymchenry#361/colbymchenry#364
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.
Mirrors upstream colbymchenry#3226 (commits 0014466 and 6e4354d, branch fix/ts-variance) into fork main. It also:
Differential result for the patched wasm (before
--update, exit 0)These numbers match colbymchenry#3226's own measurement:
Verified locally on mirror/3226
tsc --noEmitexits 0.--maxWorkers=4gives 10529 passed and 1 failed. The failure is theui-server-api"busiest symbol" timing assertion, 123ms against a 100ms limit under load. It passes 2/2 when run alone.typescript-variance-parse.test.tspasses 7/7.After this merges, re-index TypeScript projects.