I got a problem on clicking locations. The thing I do is creating a AST from a method with the function:
getMethodASTEclipse(method, model=projectModel);
where method is just an instance of
methods(projectModel);
When I visit that tree and want to get if statements for example I can call
case i: \if(_, _, _):println(i@src);
The source will be printed and I can click on it, eclipse will go to the right class with the right if statement. The form is like this:
|project://MyProject/src/MyClass.java|(2836,143,<104,1>,<109,2>)
But when I get the AST from file with the method:
createAstFromFile(class, true);
and giving a class instaed of a method or even a file I can also visit it and get the same if statement and print it but the form of it is different and I can't click on it. Why not ?
The form of it looks like this:
|java+class:///MyClass/src/MyClass|(17938,1105,<544,4>,<570,5>)
What I also notice is that the offsets are incrementing heavily after each location is printed.
How can I make it clickable to the right location? I think it has to do something with the offset and the form of the location. I tried to use the method:
resolveJava(loc l);
from the Registry class but that didn't work either and tried to look up at declarations for the |loc definition but that wasn't there either.
Thanks in advance.