GumTreeDiff / gumtree

An awesome code differencing tool
https://github.com/GumTreeDiff/gumtree/wiki
GNU Lesser General Public License v3.0
933 stars 174 forks source link

How to debugging gumtree? #272

Closed sws797 closed 2 years ago

sws797 commented 2 years ago

223

Okay I see what's going on. This is fixed in the latest commit. In your version you can get it to work using : /gradlew :dist:run --args="..."

Cheers!

Hi @jrfaller , The gumtree is very cool, as a person who has not formally studied Java, I want to learn about the implementation of gumtree at the code level, but I have some problems: It can really run with /gradlew run --args="webdiff D:/left/file1.java D:/right/file1.java", but it doesn't seems like a debugging way. I've been trying to run the project in debugging mode these days, but all the schemes mentioned in issues failed.

I encountered the following errors while running Client.Run by IDEA:

  1. No command given. (So next I added the command)
  2. Unknown sub-command 'webdiff'. (Next I changed it to Available Commands: parse)
  3. Error while running client 'parse'.... java.lang.UnsupportedOperationException: No generator found for file: D:/left/file1.java

This is my file1.java:

public class Test {
    public String foo(int i) {
        if (i == 0) return "Foo!";
    }
}

How should I run it in debug mode using IDEA, any suggestions?

Originally posted by @sws797 in https://github.com/GumTreeDiff/gumtree/issues/223#issuecomment-1056073882

jrfaller commented 2 years ago

Hi!

To debug using IDEA I use a gradle run configuration with the following run command : run --args='webdiff left.java right.java', then I launch it in debug mode.

sws797 commented 2 years ago

Thanks for your reply. I don't understand how to "launch it in debug mode". First run: image then: image and get: image

Did I miss something?

sws797 commented 2 years ago

If I change webdiff to parse, the result is: image

jrfaller commented 2 years ago

This is how I configure it :

Capture d’écran 2022-03-02 à 12 32 49
sws797 commented 2 years ago

Oh, it works! Thank you very much! (o゜▽゜)o☆