Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error: "Message could not be parsed" in Socket Mode
Error: "Message could not be parsed" in Socket Mode [message #1852339] Wed, 11 May 2022 09:29 Go to next message
Tom Martens is currently offline Tom MartensFriend
Messages: 5
Registered: May 2022
Junior Member
Hi,
I have an existing Xtext project and my goal is to create a VSCode Extension for it. To get somewhat familiar with the tools and the process I created the example Xtext project with eclipse and created the RunServer (similar to this: https://github.com/itemis/xtext-languageserver-example/blob/master/vscode-extension/src/extension.ts) to run the language server in socket mode and connected the VSCode extension also via socket - and it works fine.
Now I use the same code to run the Server in socket mode for the other existing project. However, when I start the VSCode extension I get this error in VSCode: "Message could not be parsed.". To verify that the xtext project is ok I used the ServerLauncher and the Generic Texteditor in eclipse and everything works fine.
Can anyone give me some hints how to address this problem?

Thanks!
Re: Error: "Message could not be parsed" in Socket Mode [message #1852344 is a reply to message #1852339] Wed, 11 May 2022 11:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
did you check the mssages?
did you check vscode-languageclient and lsp4j / xtext versions if they match?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error: "Message could not be parsed" in Socket Mode [message #1852349 is a reply to message #1852344] Wed, 11 May 2022 13:21 Go to previous messageGo to next message
Tom Martens is currently offline Tom MartensFriend
Messages: 5
Registered: May 2022
Junior Member
Sorry, Im not sure where I can see the messages. Can you please tell me which file/function is responsible for that or which file I should debug?
Xtext ist version 2.25 and vscode-languageclient is 7.0.0, so as far as I can see they should be compatible.
Re: Error: "Message could not be parsed" in Socket Mode [message #1852359 is a reply to message #1852349] Wed, 11 May 2022 15:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
you can do something like (pseudo code)

Injector injector = Guice.createInjector(new ServerModule());
LanguageServerImpl languageServer = injector.getInstance(LanguageServerImpl.class);
Function<MessageConsumer, MessageConsumer> wrapper = consumer -> {
MessageConsumer result = new MessageConsumer() {
public void consume(Message m) {
System.out.println(m);
consumer.consume(m);
}
};
return result;
};

bdesides that i assume you also can debug client side for the error


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 11 May 2022 15:37]

Report message to a moderator

Re: Error: "Message could not be parsed" in Socket Mode [message #1852360 is a reply to message #1852359] Wed, 11 May 2022 15:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
and
Quote:

Xtext ist version 2.25 and vscode-languageclient is 7.0.0, so as far as I can see they should be compatible.


is wrong
https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2022/02/28/version-2-26-0
https://github.com/Microsoft/vscode-languageserver-node


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 11 May 2022 15:54]

Report message to a moderator

Re: Error: "Message could not be parsed" in Socket Mode [message #1852362 is a reply to message #1852360] Wed, 11 May 2022 18:34 Go to previous message
Tom Martens is currently offline Tom MartensFriend
Messages: 5
Registered: May 2022
Junior Member
You are correct, thank you for pointing this out! After downgrading the vscode-languageclient it works fine. Thanks!
Previous Topic:Check Validity of automatically generated instances
Next Topic:How to convert XMI to plain text when opening XTextEditor?
Goto Forum:
  


Current Time: Fri Apr 19 02:08:06 GMT 2024

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

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

Back to the top