Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Check loaded language ABI (#783)
* fix: Check loaded language ABI Check that the tree-sitter ABI version reported by the loaded language is within bounds for the tree-sitter client library that's bundled with diffsitter. This should give more helpful errors when a user has a grammar that's built against a tree-sitter version that's not in range. Previously the program would just segfault which does not make it clear to users that there is a mismatch between the grammar being loaded and the library bundled in diffsitter. * test(grammars): Add unit test for ts ABI Adds a unit test for bundled tree-sitter ABIs to verify that they have a compatible ABI version. * refactor(parsing): Refactor method to check ABI Refactor the method to check a tree-sitter ABI version for a grammar so that it returns a result type so the method can be used monadically and re-used for a unit test.
- Loading branch information