Sysmagine / SemanticDiff

Community support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
https://semanticdiff.com
40 stars 0 forks source link

Code moved between files not working as expected #45

Open Kangaroux opened 8 months ago

Kangaroux commented 8 months ago

Describe the Bug When moving code from one file to another, I'm expecting to see it moved in the viewer, but it's not.

To Reproduce

  1. Create a file with some code and commit to master
  2. Create a PR that moves the code into a new file

Expected Behavior I see that code was moved from original.py to one.py, two.py, three.py

Actual Behavior No moved code is detected

Links I created a simple repo to test: https://github.com/Kangaroux/semanticdiff-moved-code

This PR moves the code and deletes the original file: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/1/#one.py

This PR moves the code and deletes all the content, but keeps the file intact: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/2/#one.py

mmueller2012 commented 8 months ago

Thanks for your bug report.

TLDR: Unfortunately, we do not support cross-file moves yet, but we're planning to implement this in the future.

We support viewing any public pull request with SemanticDiff, whether they have our GitHub App installed or not. This means we can't precompute any data and have to generate the diff on the fly when a user clicks on a file. Transferring and analyzing all the files in a pull request at once could result in long wait times for large pull requests. As a result, the diff generation only takes the file currently displayed by the user into account.

We plan to change this for repos that have our GitHub App installed. In this case, we will use webhooks to determine when a pull request has been opened or updated and perform more sophisticated analysis. This would also make cross file movement detection feasible. However, this is still a work in progress.