-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java LS "Classpath is incomplete" warning when loading petclinic #13427
Comments
It looks like the project which was cloned after initializing jdt.ls workspace, isn't recognized as maven/gradel project. After reloading the browser tab or restarting jdt.ls (Clean the Java Language server workspace command), it works well. |
So it looks like a concurrency problem: if the project takes time to be cloned, and JDT LS in the meantime get started, the project won't be indexed correctly. A possible solution would be to guarantee that a LS is started only once the cloning operation has completed: @evidolob @benoitf what's your opinion? |
From my point of view, JDT LS should assume that project might not be ready when it starts and try to initialize it later |
@l0rd I think the LS is receiving multiple events. I'm unsure that it's possible to wait clone before sending events. All is asynchronous so you could have multiple clones over the lifecycle and you may have finished to clone a project before cloning a new one so it's better to work totally asynchronously. |
@benoitf @l0rd this is really the expected behaviour: many language servers (jdt.ls being one) will not pick up on new projects being created in the workspace root (in our case: /projects). The user is expected to reopen the folder or "add folder to workspace". Expecting the language servers to pick this case up consistently is going to be a losing battle, IMO.
|
Alternative would be to treat each folder in /projects as a workspace root. When detecting a new folder, we would notify the IDE that a new root has been added. But:
|
@tsmaeder I don't want to clone the git repo before the IDE is started because that means that the start of a workspace may take even more. What about restarting Theia (just restarting the pod or restarting the node app) once the cloning is done? |
We don't need to restart the pod or back end, a reload of the window is sufficient (reopen the /projects folder programmatically, even). |
Please test eclipse-jdtls/eclipse.jdt.ls#901, ask @snjeza for details |
We've done some experiments, and the verdict is mixed: The picture is evenly split, I don't think we can expect language servers to pick up changes in general. That means we'll have to restart the language servers, which usually is done by doing a reload of the front end (which will trigger new copies of the back end plugins) |
@l0rd jdt.ls does not detect this: there is a long-standing PR, but it would need some serious attention and testing before it can be merged. And as I argued above, it's not a solution for any other language servers out there. |
@tsmaeder what's your proposal to mitigate the problem for Che 7.0.0? |
We need to wait for a new release of vscode-languageserver-node and a rebuild of vscode-java in order to proceed with moving to a multi-root based che workspace |
Reactivating: I suspect with the later activation of the plugins, our use cases should work. Retest and move towards a merge: |
Blocked until tasks work with multi-root. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
This is no longer the case right? I think we should be unblocked now cc @tsmaeder |
This should be fixed. |
Description
After I have created a workspace using the following devfile
a classpath incomplete warning is shown every time a Java file is opened:
Reproduction Steps
Start a workspace using this devfile:
OS and version:
macOS / minikube / nightly che-server / chectl / helm / jtd ls 0.45.0
The text was updated successfully, but these errors were encountered: