You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The project's package fragments are not update to date when adding a new one. #1137
Open a java project to let the Java Language Server start up
Create a new folder, the folder path is belong to one of the project's PackageFragmentRoot
Create a Java file in that folder
Then, when we get a IJavaProject instance in the Java side, and inspect the PackageFragment, there is no entry for the new created one. (You can call project.getPackageFragmentRoots() first, after find the right root, call getChildren() over it)
This bug affects several scenario, like:
Cannot move a compilation unit to a newly created package (gif above)
Could not find or load main class xxx when debugging a main class in newly created package
Java dependency viewer cannot show the newly created package and its members in the explorer
Java Test explorer cannot show the newly created package and its members in the explorer
We always refresh the parent with zero depth. After this operation, the parent of the newly created package is still not aware of the existence of its new member. Maybe we need to use DEPTH_ONE here?
Activity
jdneo commentedon Oct 12, 2019
@snjeza @fbricon
I found a reason which may cause this bug. In https://github.com/eclipse/eclipse.jdt.ls/blob/ff78ddaf41417aec47cfdf1aa619a96f87462f61/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java#L894
We always refresh the parent with
zerodepth. After this operation, the parent of the newly created package is still not aware of the existence of its new member. Maybe we need to useDEPTH_ONEhere?fbricon commentedon Oct 12, 2019
If that's what it takes to work then ok