-
Notifications
You must be signed in to change notification settings - Fork 328
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
executeCommandProvider fails with command .. already exists
with multi-root servers
#333
Comments
@Tehnix I think you didn't finish your sentence.
|
command .. already exists
with multi-root servers
@rcjsuen yeah sorry, did not know that Github comments on CMD + SHIFT + Enter ^_^ I've updated/finished the issue now. |
This is very likely caused by fixing bugs in the library and now correctly surfacing this. Registering the same command twice and make it magically work in a multi server setup never worked. The underlying problem is that all servers register the commands using the same id. In general spawning n servers is nothing the LSP can magically handle in terms of de-duping the commands or other global things. So all I can recommand here is to create different command ids per launched server and making it clear which server is used when executing the command. If the commands need to be dispatch to all servers then you need to register one command in the extension and dispatch the command yourself to all servers using the provided @Tehnix I would like to close the issue since IMO there is nothing the LSP can do to make this magically work. |
How do you create different command ids though? Is this something that has to be done in the server, or can it be done in the client? I have been digging around for hooks to anything with By ID are you referring to the first argument of If you mean the server needs to be aware that it has multiple instances, then I don't think that's a realistic solution to this problem. EDIT: My main point is, |
The solution you need to pick depends on how the command should work. In our example the |
The |
OK. then for |
Hmm, I'm not exactly sure I follow where this is all supposed to be going on :/ Would this be in the server or in the client? Like, the UUID is generated in the |
For now, we've reverted to version 4.0.1, where the LSP will not be stopped because of this, until we find a workaround. |
You should use let uuid = generateUUID();
....
"executeCommandProvider": {
"commands": [/*applyrefact:applyOne*/ uuid, "hare:demote"]
} |
Let me know if this helps. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
… client This is used when a client has more than one project microsoft/vscode-languageserver-node#333 (comment)
Context: vscode-hie-server
After upgrading
vscode-languageclient
from 3.5.0 to 4.1.3, we are having problems with multiple spawned language servers, which is needed for multi-root support. I want to note that this works in 3.5.0, and some breaking change was introduced (or errors were made non-silent) in 4.x.The error comes from hie giving back its capabilities on initialization, where it registers
executeCommandProvider
s. When a second server gets spawned, this command already exists, and VSCode then complains about this.The Haskell language server sends this response,
which causes an error to occur and the process to get shut down on the VSCode side of things,
Generally, I'd also like there to be a better story with editor commands and multiple servers. Currently we are doing something like this on activation,
and then register the command like so,
which looks up the client on activation.
The text was updated successfully, but these errors were encountered: