afnanenayet / diffsitter

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

feat: Strip/ignore whitespace in nodes #761

Closed afnanenayet closed 10 months ago

afnanenayet commented 11 months ago

This cleans up some code and allows for stripping whitespace/newlines from the diffs when processing the tree-sitter AST. This yields more granular diffs that don't break on whitespace differences and newlines, which seems to be desirable.

This also updates some APIs for constructing tree-sitter grammars which makes it easier to make unit tests.

codecov-commenter commented 11 months ago

Codecov Report

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

Comparison is base (1da051a) 59.47% compared to head (9e0b1d8) 59.00%.

Files Patch % Lines
src/input_processing.rs 61.81% 21 Missing :warning:
src/diff.rs 62.50% 15 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #761 +/- ## ========================================== - Coverage 59.47% 59.00% -0.48% ========================================== Files 13 13 Lines 1451 1488 +37 ========================================== + Hits 863 878 +15 - Misses 588 610 +22 ```

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