GithubHelp home page GithubHelp logo

Comments (10)

morandat avatar morandat commented on June 15, 2024 1

from gumtree.

jrfaller avatar jrfaller commented on June 15, 2024

You can search for the first ancestor of type TypeDeclaration and look its SimpleName child, would it answer your question?

from gumtree.

irajdeep avatar irajdeep commented on June 15, 2024

I am not sure, so I was having a look at the file HtmlDiffs.java file, through which I can access all the changes and their properties via (ITree t) , should I access the parents of 't' to get to the method or class to which it belongs ?
For ex
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } }
If the print statement is modified , I want to view that there was a change in the main method and HelloWorld class.

from gumtree.

jrfaller avatar jrfaller commented on June 15, 2024

You need to have at hand the ITree corresponding to the file

Then simply go through the ancestors of the modified node (getParents if I remember correctly) until you find a MethodDeclaration and a TypeDeclaration, and look for the direct SimpleName child of these nodes.

from gumtree.

irajdeep avatar irajdeep commented on June 15, 2024

Thanks a lot , I will have a look

from gumtree.

irajdeep avatar irajdeep commented on June 15, 2024

Yeah figured it out , Thanks.
BTW will it be useful to show the classes and methods which have changes in the "listdiff" ? If yes I can work on it and send a corresponding PR.

from gumtree.

morandat avatar morandat commented on June 15, 2024

from gumtree.

irajdeep avatar irajdeep commented on June 15, 2024

I was thinking of providing something like classes and methods that have changed in a file (for now will be only JAVA file) from left to right version .

from gumtree.

jrfaller avatar jrfaller commented on June 15, 2024

Maybe this would be best done via a dedicated GumTree client tailored for the analysis of a specific language?

from gumtree.

irajdeep avatar irajdeep commented on June 15, 2024

Makes sense. I will list down a few parameters that we can output using GumTree for JAVA code change analysis and get it reviewed.
I can start working on the client thereafter.

from gumtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.