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
Dynamic registrations that the server withdraws while LSP4IJ installs them can stay installed, or remove what a registration again of their id installed #2273
A language server can withdraw a dynamic registration (client/unregisterCapability) while LSP4IJ is still installing it, from the batch of a client/registerCapability request, and then register the same id again. LSP4IJ didn't handle these overlaps.
What went wrong
Withdrawn before it's installed: the registration was installed anyway, and stayed with no way for the server to remove it.
Withdrawn while it's installed: what it installed stayed after its installation ended.
Registered again with the same id meanwhile: the late end of the withdrawn installation could remove, or replace, what the later registration had installed:
workspace/didChangeWatchedFiles: the watchers are registered by id, so the withdrawn registration's cleanup removed the later registration's watchers. If it added its own watchers late, they replaced the later ones, and its cleanup then left the later registration with none. File changes then no longer reached the server until it registered its watchers again or restarted.
workspace/executeCommand: the cleanup's removeAll dropped the later registration's copy of the same command. With assertions on, the later registration wasn't installed at all.
workspace/didChangeWorkspaceFolders: the later registration was ignored as "already enabled", and the withdrawn one then turned the workspace folders off.
Expected
A withdrawn registration installs nothing, or only until its installation ends. Its cleanup removes only what it added itself. A later registration of the same id keeps what it installed.
These are found and fixed in #2254, whose tests reproduce each case.
Activity