tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
341 stars 104 forks source link

Grammar and generated code are in inconsistent state #193

Closed hendrikvanantwerpen closed 2 years ago

hendrikvanantwerpen commented 2 years ago

It seems to me that the grammar and the generated code in the repository are not consistent at the moment.

Observed Behavior

After running npm run build, the generated code is updated and different from what is checked into the repository.

When running npm test after this, various tests fail.

Suggested Solution

Short term: fix the repository by fixing tests or reverting changes that introduced the problem.

Long term: add a check to CI that verifies that the checked in generated files are up to date. This can probably be done by running npm run build and checking if any of them changed.

hendrikvanantwerpen commented 2 years ago

I have investigated some more, and 5f90415434414122111ea124d456ea1cc0770d16 still has the correct generated files. I think the problem is present from #190.

hendrikvanantwerpen commented 2 years ago

Turns out the problem was not with the repo, but with the locally installed package versions. I've opened a PR #196 that should prevent such problems in the future.