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
A JDT LS extension registers delegateCommandHanlder via org.eclipse.jdt.ls.core.delegateCommandHandler extension point. In this particular case it is Spring Boot LS registers add/remove classpath listener commands. Essentially JDT LS would be notifying the client about classpath changes of projects in the workspace. (This data from the client is forwarded to Spring Boot LS eventually)
This command is executed once Spring Boot LS initializes. However, there is a race condition. Spring Boot LS won't attempt to send add classpath listsner message until JDT LS is started. Spring Boot LS can only wait until JDT LS is initialized...
JDT LS doesn't register commands with the client at the initialization step because it needs to wait for configuration changed message to register/unregister commands based on the config settings.
Therefore the race condition is between Spring Boot LS send add classpath listener message and JDT LS registering dynamic capabilities for commands.
The race condition could have been avoided if there were some commands that could be registered at the JDT LS initialization stage. For example commands that are independent of configuration settings and would remain registered regardless.
I propose to introduce static flag for the command definition in the org.eclipse.jdt.ls.core.delegateCommandHandlerextension point. Thus,WorkspaceExecuteCommandHandlerwould havegetStaticCommands()andgetNonStaticCommands` methods. Static commands would be registered at the initialization stage while non-static commands would be registered if config changes or at the init stage if dynamic registration not supported.
PR is coming
The text was updated successfully, but these errors were encountered:
A JDT LS extension registers
delegateCommandHanlder
viaorg.eclipse.jdt.ls.core.delegateCommandHandler
extension point. In this particular case it is Spring Boot LS registers add/remove classpath listener commands. Essentially JDT LS would be notifying the client about classpath changes of projects in the workspace. (This data from the client is forwarded to Spring Boot LS eventually)This command is executed once Spring Boot LS initializes. However, there is a race condition. Spring Boot LS won't attempt to send add classpath listsner message until JDT LS is started. Spring Boot LS can only wait until JDT LS is initialized...
JDT LS doesn't register commands with the client at the initialization step because it needs to wait for configuration changed message to register/unregister commands based on the config settings.
Therefore the race condition is between Spring Boot LS send add classpath listener message and JDT LS registering dynamic capabilities for commands.
The race condition could have been avoided if there were some commands that could be registered at the JDT LS initialization stage. For example commands that are independent of configuration settings and would remain registered regardless.
I propose to introduce
static
flag for the command definition in the org.eclipse.jdt.ls.core.delegateCommandHandlerextension point. Thus,
WorkspaceExecuteCommandHandlerwould have
getStaticCommands()and
getNonStaticCommands` methods. Static commands would be registered at the initialization stage while non-static commands would be registered if config changes or at the init stage if dynamic registration not supported.PR is coming
The text was updated successfully, but these errors were encountered: