tree-sitter-diff
tree-sitter-diff copied to clipboard
feat: split command filename to old/new file
This PR is mostly motivated by the following problem:
![](https://user-images.githubusercontent.com/30731072/210175390-eb7291d5-9ae3-4f70-b537-febfa071e052.png)
- The diff command has two filenames, but the parser is currently parsing everything after
diff --git
as a single filename node, which is wrong. - This results in different semantic interpretations during highlighting, whereas ideally it should have the exact semantic meaning. I propose it should be
diff --git (old_file) (new_file)
so that these filenames get the same highlighting/semantic meaning as the ones in the diff output,--- (old_file)
and+++ (new_file)
.