PathFinder always returned whole CompilationUnit but not the smaller parts,
like blocks, fields, classes, which is needed for implementing breakpoints in debugger.
Marking as invalid. Please show me the code from where you call it and where it fails - after you supply this
(preferable as a reproducible test case) please reopen the issue.
Please note that I have not finished this as this is currently not called from anywhere (in the sources that I have)
besides the code that I work on (code completion).
I don't say I will not finish it just that I need to have a proper test case to work with.
As to what it not implemented - I have not copied the code for "findNameSpan" as I was not sure what it does and whether
we need it here. Maybe it would be just ok to call
sourcePositions.getStartPosition(getCurrentPath().getCompilationUnit(), node) and similarly getEndPosition. The other
alternative is to copy the findNameSpan methods from java but that would require some more checking whether that works
ok in JFX case.
Created attachment 59963 [details]
I've attached example of source code which can reproduce the problem.
Without this code I'm not able to submit breakpoints during debug session,
because class name is always null and other info is not correct
Ok, looking at it ..
Unfortunatelly I cannot move forward with this one without #132199 being solved first. The positions in the tree we are
getting from javafxc are not correct ...
Also I've noticed that in TreeUtilities all calls of path.getLeaf().getKind() it is Java kinds trees, then Kind.OTHER will be returned for all instances of JavaFXTree,
so getJavaFXKind should be used to get JavaFX kind.
Thanks for the catch - I will try to fix that but with the wrong positions we will not get much further ;-(
I have just pushed
it includes updated test + some change in the pathfinder.
Can you give it a try please?
I am closing this issue and if something more is needed please reopen or create a new one.
PS: I did not touch the kind as the code is used to fine tune the position on braces etc. Maybe we could improve that
also but please test first whether this will be ok for you ...
It seems like the method is working ok