eclipse.jdt.ls icon indicating copy to clipboard operation
eclipse.jdt.ls copied to clipboard

Performing search operation are blocked until the build is done in vscode

Open gayanper opened this issue 2 years ago • 3 comments

When opening a workspace, the project build is started. When the project is large it takes time to complete the build which is same in Eclipse as well. But in vscode the search operations such as reference and call hierarchy are blocked until the build is finished. In eclipse this works fine. As I remember a search operation is only blocked for indexing operations. It would be nice to support the same behavior as in Eclipse IDE from the LS as well so editors like VSCode can simulate the same behavior like Eclipse IDE.

gayanper avatar May 17 '22 08:05 gayanper

When opening a workspace, the project build is started.

@gayanper it would happen only when starting your workspace the first time. Could you provide a project sample?

snjeza avatar May 17 '22 19:05 snjeza

Unfortunately the project is proprietary. But will try with for example jdt.core and see if i experience the same and get back

gayanper avatar May 23 '22 21:05 gayanper

This should be related with the timing of registering these capabilities. At the moment we delay the registration until the build job has finished. It makes sense to enable earlier if some features don't conflict with build job.

https://github.com/eclipse/eclipse.jdt.ls/blob/2130d70af2c39cbf7c6da825f89580456361608a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/JDTLanguageServer.java#L270-L283

testforstephen avatar May 24 '22 02:05 testforstephen

Is this really the case ? I just tried re-importing eclipse.jdt.ls into a fresh Eclipse workspace, and a call hierarchy search still seemed to block until the build was completed.

For what it's worth, with https://github.com/eclipse/eclipse.jdt.ls/pull/2341, the time it takes for the index to load could be improved quite a bit. With that said, I agree that we should look into registering capabilities sooner if it allows users to take advantage of more functionality sooner.

rgrunber avatar Feb 06 '23 01:02 rgrunber