-
Notifications
You must be signed in to change notification settings - Fork 798
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
Getting value after executing command programmatically #329
Comments
Can you please provide an example of what you want to achieve? |
I have defined command in package.json, for e.g.
What I want is to call vscode.commands.executeCommand('my_cmd') and get result returned by language server that I also created.
but the result is undefined. So, is that even possible? |
From where do you call the command. From the client or the server. Command execution from the server is currently not possible and would require to specify valid commands which is almost impossible given that a server should work with n clients. |
I am calling the command from the client. And on the server I have a function which has a command name and arguments as function parameters. So, I can handle different commands and return different objects from the server. |
Actually that should work. Have you registered the commands from the server using the ServerCapabilities.executeCommandProvider property. |
Hello, I am working on the same extension. I have looked at source code of vscode-languageclient module and tried to log server's response.
with this:
to be sure that server is returning a value. And it does. Our activation function:
package.json has commands section described in above comment. |
@danixeee now I understand. We should continue the discussion in https://github.com/Microsoft/vscode-languageserver-node. In general this should work and it is not a specification problem. Looks more like a bug either in VS Code or in one of the LSP libraries. Can you try to produce a minimal example using the LSP client and server module I can clone and open a new issue here: https://github.com/Microsoft/vscode-languageserver-node. Then I can definitely have a look and see why it is not working. |
I have registered specific commands both on server and client. I am trying to fetch values from lang server when command is executed, but instead value is undefined. Is it possible to do that?
The text was updated successfully, but these errors were encountered: