Skip to main content



      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 05:29 Go to next message
Eclipse UserFriend
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 07:36 Go to previous messageGo to next message
Eclipse UserFriend
did you check the mssages?
did you check vscode-languageclient and lsp4j / xtext versions if they match?
Re: Error: "Message could not be parsed" in Socket Mode [message #1852349 is a reply to message #1852344] Wed, 11 May 2022 09:21 Go to previous messageGo to next message
Eclipse UserFriend
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 11:35 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Wed, 11 May 2022 11:37] by Moderator

Re: Error: "Message could not be parsed" in Socket Mode [message #1852360 is a reply to message #1852359] Wed, 11 May 2022 11:40 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Wed, 11 May 2022 11:54] by Moderator

Re: Error: "Message could not be parsed" in Socket Mode [message #1852362 is a reply to message #1852360] Wed, 11 May 2022 14:34 Go to previous message
Eclipse UserFriend
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: Tue Jul 15 08:41:39 EDT 2025

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

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

Back to the top