How to move existing projects on Eclipse to Theia

Hi, we are trying to move existing projects on Eclipse to Theia.
But we have met several problems.

Now we have transfered our Ecore Model to Xtext as language server.

The first error : there is a problem with the Xtext from the Ecore conversion, Eclipse can’t recognize the URL of our tool. And this step only produces ‘mydsl.xtext’, the rest of the file is empty.

The second error : there is a file named ‘GenerateMyDsl.mwe2’ be created, but when we click ‘running as mwe2 Workflow’ it has some errors. The console shows that it’s unmapped with our genmodel. The errors screenshot are as follows. If run as MWE2 Workflow successfully, what files will we get?

The last question : We use the xtext file that we created to be our language server, and executed the command ‘gradlew build’, then BUILD SUCCESS. But we check some successful examples and find that there are some Xtend files in their folder, we don’t have them. How can we produce the files we don’t have? Can it be generated automatically,or we need to write them by ourselves? Is our language server correct, Why can we build success?

[original thread by Qizewen]

Is there a way to see your project? It seems to be some misconfiguration. Here is a xtext-example with Theia: https://github.com/theia-ide/theia-xtext

[Qizewen]

May I have your email please. I can send some screenshot of our project to you. My email is 13260906239@163.com

@qizewen unfortunately I can help only with public general questions around Theia

maybe @jankoehnlein, @svenefftinge or @kittaakos can help somehow based on your questions

you can as well send a support request to TypeFox to ask for help with the proprietary solution: https://www.typefox.io/contact/

[Hermann]

Anton,

first, thank you for the great work on Theia, it’s awesome. I used it for some time now with a single xtext DSL and a xtext generated language server integrated as backend with Theia following your example. It works nicely.

Next step is now to port another DSL language that is refering to this first language. I created a language server including both languages but I do not manage to make the 2nd DSL work. Even worse the first language that worked like a charm in a single DSL application stopped working. No code completion anymore, no references or such.

Could you point the community to a working example of a multi DSL server/backend/frontend or make a simple example available to everybody.

Thank you and regards

Hermann

Could you share an example repo? Unfortunately i don’t have time on building examples right now :frowning:

[Hermann]

Now with the Covid-19 crisis and me being stuck at home I found time to work on this. I prepared an example git repo with the Eclipse project and a Theia extension project.

You find it at : https://github.com/Morris-dev/theia-xtext-multi-lsp

It is made of 2 languages that both are merged into 1 jar file as LSP based servers.

  • The problem seems to be related to the way Theia or MONACO is connecting to the backend. The language server client wants 2 independent LSP servers.

  • The second problem is that the xtext jar file cannot handle links between the languages.

Thank you for looking into this.

Hermann

p.s. Stay Home / Stay safe — Bleib zuhaus

It should be possible to configure only one server which handles both languages. A language server will be activated on any of languages. I think the problem is in how a concrete language extension configures language server activation.

[Hermann]

I think so too … what is needed is a server name independent from the languages that it provides. I.e. Only 1 backend LanguageProvider but multiple frontend language providers refering to the same LSP server

[Hermann]

I had some progress on this. The problem with the language server not being able to resolve links between models I fixed.

The problem was due to the ‘shadowJar’ gradle plugin I used. This one is collecting all related files and mainly copies them into the jar file. The file META-INF/services/org.eclipse.xtext.ISetup describing the language config was overwritten in the fat jar and not appended as it should be. So using ‘append’ for this file in the shadowJar gradle configuration fixed it.