Closed kuldeeparora89 closed 2 years ago
Have you tried turning on the tracing? See trace
argument to createLauncher
: https://github.com/eclipse/lsp4j/blob/3a5cce9597fef1a53f98f6e9a5d21a34c8bfc757/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/Launcher.java#L73
That may give some indication of the problem.
Yep both on client & server side, Client trace - [Trace - 03:06:52 PM] Sending request 'initialize - (1)' Params: { "processId": null, "rootUri": null }
Server side nothing.
Your code looks correct to me - I would end up starting to see if any bytes are arriving on the server (debug it) and make sure you don't have a firewall blocking the traffic too. If you are on linux you can stick socat between the two so you can see what ends up on the "wire", or even manually prod the server that way.
Since both client & server running on localhost so I was not expecting any firewall-related issue, but the issue is the same after disabling the firewall. On server side code execution is getting stuck at below line int c = input.read(); under StreamMessageProducer.java
@Override
public void listen(MessageConsumer callback) {
if (keepRunning) {
throw new IllegalStateException("This StreamMessageProducer is already running.");
}
this.keepRunning = true;
this.callback = callback;
try {
StringBuilder headerBuilder = null;
StringBuilder debugBuilder = null;
boolean newLine = false;
Headers headers = new Headers();
while (keepRunning) {
int c = input.read();
I got the issue , I had another client instance which was blocking the request of this client.
Great - thanks for reporting back your resolution.
I have created a Java-based LSP client, but none of the method calls are completed & it waits indefinitely.
initialize method never returns. The Language Server is working fine when tested with the VSCode instance.
Seems like requests are not reaching the server as nothing is printed in trace logs of the server.
Server Code -
What could be the issue here?