-
Notifications
You must be signed in to change notification settings - Fork 93
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
Fix duplicate client/registerCapability for workspace/executeCommand #938
Conversation
6408e2f
to
463ff39
Compare
Fixes eclipse-lemminx#937 Signed-off-by: azerr <[email protected]>
OK, downloaded OpenJDK 15, pulled this PR, ran The build process fails with the following error. As it is the first time trying to compile Java stuff, I am a bit lost at this point.
|
That's strange, our CI build is working but we compile it with JDK 8. |
I managed to build with OpenJDK 11. Your changes appear to work correctly. I see only one
Running the commands works as well.
|
Seems like with this change all commands would be registered/unregistered against one registration id which is probably ok. Our Spring XML extension should work fine with this change... Wonder if we need to call |
@@ -181,6 +184,11 @@ private void registerWatchedFiles() { | |||
registerCapability(WORKSPACE_WATCHED_FILES_ID, WORKSPACE_WATCHED_FILES, options); | |||
} | |||
|
|||
public void registerExecuteCommand(List<String> commands) { | |||
registerCapability(WORKSPACE_EXECUTE_COMMAND_ID, WORKSPACE_EXECUTE_COMMAND, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't seem to call unregisterCapability
anywhere... if commands are registered again does this "registration over registration" works ok in VScode and Eclipse?
You should keep in mind the mechanism is to register language server capabilities which is A client can store a list of commands exposed via this registration handshake if needed. |
If I understand correctly, in order to support adding and removing individual commands after the first initialization, we could use the following process each time we modify the set of commands:
I'll see if I can implement this. |
As of right now we have no use case for unregistering commands, so this solution works. @deathaxe does sublime-lsp support registering new commands dynamically by sending another registration for |
It just overwrites the former registration and puts a debug message to console about it happening. The list of registered commands is not very interesting as it is lacking required information to build menu items or command palette entries anyway. It just helps to see what the language server has to offer in general. Finally it's just interesting to see Command Palette entries are defined statically in local files, which is no problem as LemMinX is handled by dedicated LSP-lemminx helper package. |
Thanks @datho7561 @BoykoAlex for your review |
Fix duplicate client/registerCapability for workspace/executeCommand
Fixes #937
Signed-off-by: azerr [email protected]