Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » LSP4J : Language Server method call never ends
LSP4J : Language Server method call never ends [message #1851859] Wed, 20 April 2022 12:20 Go to next message
Kuldeep Singh is currently offline Kuldeep SinghFriend
Messages: 1
Registered: April 2022
Junior Member
I have created a Java-based LSP client, but none of the method calls are completed & it waits indefinitely.

Socket socket = new Socket("localhost", 6008);
Launcher<LanguageServer> createClientLauncher = LSPLauncher.createClientLauncher (languageClient,
                socket.getInputStream(), socket.getOutputStream());
LanguageServer server = createClientLauncher.getRemoteProxy();

InitializeResult result = server.initialize(new InitializeParams()).get();


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 -

Function<MessageConsumer, MessageConsumer> wrapper = consumer -> {
			MessageConsumer result = consumer;
			return result;
		Launcher<LanguageClient> launcher = createSocketLauncher(languageServer, LanguageClient.class, new InetSocketAddress("localhost", 6008), Executors.newCachedThreadPool(), wrapper);
		Future<?> future = launcher.startListening();
		while (!future.isDone()) {

What could be the issue here?
Re: LSP4J : Language Server method call never ends [message #1851868 is a reply to message #1851859] Wed, 20 April 2022 16:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
cannot reproduce this with the snippet you share.
do you mean that the main method does not stop?
you dont call System.exit(0); at end
Did you debug if the startListening in the client blocks
Are you sure you create the client socket connection correct ?
Does anything at the server arrive using debugger

I also wonder if you should use AsynchronousSocketChannel
As others do

Maybe you can also check how lsp4e uses

you can also check out

Twitter : @chrdietrich
Blog :

[Updated on: Wed, 20 April 2022 18:52]

Report message to a moderator

Previous Topic:Packages does not exist from Xtext Maven Example
Next Topic:Get already build xtext resource in languageServer
Goto Forum:

Current Time: Mon Jul 22 08:26:22 GMT 2024

Powered by FUDForum. Page generated in 0.03358 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top