tree-sitter-diff icon indicating copy to clipboard operation
tree-sitter-diff copied to clipboard

feat: split command filename to old/new file

Open thatlittleboy opened this issue 1 year ago • 3 comments

This PR is mostly motivated by the following problem:

  1. The diff command has two filenames, but the parser is currently parsing everything after diff --git as a single filename node, which is wrong.
  2. 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).

thatlittleboy avatar Jan 01 '23 15:01 thatlittleboy