afnanenayet / diffsitter

A tree-sitter based AST difftool to get meaningful semantic diffs
MIT License
1.59k stars 29 forks source link

fix: Check loaded language ABI #783

Closed afnanenayet closed 8 months ago

afnanenayet commented 8 months ago

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.

This closes #782

codecov-commenter commented 8 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (239bb29) 59.94% compared to head (0b70585) 60.16%.

Files Patch % Lines
src/parse.rs 76.19% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #783 +/- ## ========================================== + Coverage 59.94% 60.16% +0.22% ========================================== Files 13 13 Lines 1523 1544 +21 ========================================== + Hits 913 929 +16 - Misses 610 615 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.