I have a question. I want to use the language server from extern. Before I updated my Che version I did this with http://localhost:{agent_port}/api/languageserver/{command}/
Now this path is not valid.
Is there any possibility to this in another way?
Hope someone can help me.
Thanks
@phill1234 here's, for example, how I initialize a Python language server for a particular file:
http://172.19.20.16:32814/api/languageserver/initialize?path=/console-python3_5-simple/main.py
What exact calls fail on your side?
Thanks for the fast answer 馃憤
I've reading you changed the connection to an json-rpc client. The languageserver runs but i have no chance to call something like http://localhost:{agent_port}/api/languageserver/hover/
to get an response because the TextDocumentService isn't able to call over an url.
Is it possible for me to implement my own Service? Or is there a problem because lsp4j is working asynchron ?
My goal is to use eclipse Che as workspace server. And I wrote my own "IDE" using eclipse Orion code edit. I use the Che File API to save and load files into my widget and the Command Api to execute the written code. Before changing the LanguageServerService I was able to call http://localhost:{agent_port}/api/languageserver/hover/ for example to get the response for my hover functionality.
Now the great palantir python language server is used in Che but I'm not able to communicate with.
@dkuleshov will help here
Hi @phill1234
Yes we're switching the communication to JSON-RPC protocol, please see this issue to get more broad understanding of the reasons that stands by that decision.
If I understand your problem correct for current variant of TextDocumentService in order to call hover you need to have a websocket connection to workspace agent where this service is hosted (this looks a bit messy but should help you in understanding the way we do it), the url in our case should be similar to this: ws://localhost:{agent_port}/websocket/{client_id}, than you can send JSON-RPC compliant request over that websocket connection, should be something like this:
{
"jsonrpc" : "2.0",
"method" : "textDocument/hover",
"params" : "...",
"id" : 0
}
Where params are a JSON representation of TextDocumentPositionParams. The response is also a JSON-RPC compliant JSON message.
It might be also useful to check our implementation of remote TextDocumentServiceClient
@dkuleshov Thanks for the fast answer
I understand why this decision was chosen. iT is an improvement of Che and needed to be done. Good work.
I already tried to start the websocket connection but I stumble over the two parameters
agent_port should be the wsagent started in the workspace?
Yes
client_id which parameter is this ? Can I choose my own?
This is actually used to uniquely identify on server side a client that establishes the websocket connection. It would be nice if we could provide those IDs in some centralized way (for example generate on server side) but we're not there yet with our current implementation so yes - you can choose the unique ID by your own.
Thanks a lot
It works - you saved my day
馃憤
This is actually used to uniquely identify on server side a client that establishes the websocket connection. It would be nice if we could provide those IDs in some centralized way (for example generate on server side) but we're not there yet with our current implementation so yes - you can choose the unique ID by your own.
Created issue for implementing a centralized way for receiving identifiers by clients.