Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] Porting project from xtext plugin to xtext lsp server(Fastest way to migrate from eclipse DSL plugin to a xtext lsp server)
[SOLVED] Porting project from xtext plugin to xtext lsp server [message #1826982] Tue, 05 May 2020 16:18 Go to next message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
Hi guys, I've got an xtext project that atm is builded and used as Eclipse plugin.
Hearing that xtext supports language server protocol I would like to try and use it.
Unfortunately, as per the docs, i need to build the project using Gradle and to enable gradle I need to create an xtext project without the "Plugin functionalities"

Here is my question: "Since the project is huge is there some official way, I don't know, maybe an export and import" to duplicate the project but using gradle and removing all "eclipse plugin" related code?

Thanks.

[Updated on: Wed, 06 May 2020 14:23]

Report message to a moderator

Re: Porting project from xtext plugin to xtext lsp server [message #1827005 is a reply to message #1826982] Wed, 06 May 2020 05:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13641
Registered: July 2009
Senior Member
Hi, you don't have to use gradle.
You just need to make sure you export the .ide part in a way that you have something you can start.
AFAIK this is in the wizard if you select,language server and eclipse


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Porting project from xtext plugin to xtext lsp server [message #1827017 is a reply to message #1827005] Wed, 06 May 2020 07:57 Go to previous messageGo to next message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
Hello, there is no such option in the export menu.
Is there any documentation reference where I can find how to do this procedure?

Re: Porting project from xtext plugin to xtext lsp server [message #1827021 is a reply to message #1827017] Wed, 06 May 2020 08:27 Go to previous messageGo to next message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 114
Registered: February 2016
Senior Member
Try to use this combination

Re: Porting project from xtext plugin to xtext lsp server [message #1827023 is a reply to message #1827021] Wed, 06 May 2020 08:39 Go to previous messageGo to next message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
The only way I know to reach that window is by recreating the whole project and manually reimporting everything.
Is there a faster way to reach it from an already created project?
Re: Porting project from xtext plugin to xtext lsp server [message #1827027 is a reply to message #1826982] Wed, 06 May 2020 09:08 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 739
Registered: July 2009
Location: Dortmund, Germany
Senior Member

That's already the fastest way to come to a working project. To be faster, hire experts to help you.
Re: Porting project from xtext plugin to xtext lsp server [message #1827030 is a reply to message #1827027] Wed, 06 May 2020 09:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13641
Registered: July 2009
Senior Member
istill dont get your goal:

(a) ditch and eclipse and move to lsp
(b) make the eclipse stuff also LSP capable

what is your goal


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Porting project from xtext plugin to xtext lsp server [message #1827031 is a reply to message #1827027] Wed, 06 May 2020 09:21 Go to previous messageGo to next message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
The project already exists and this is for a graduation thesis, I've got no budget for an expert on eclipse just to modify settings of an old project.
Anyway if this is the best way i'll try it, thanks
Re: Porting project from xtext plugin to xtext lsp server [message #1827033 is a reply to message #1827030] Wed, 06 May 2020 09:37 Go to previous messageGo to next message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
- I've got this project using xtext and xtend to parse a simple DSL
- I want to give users the ability to use their own preferred IDE
- I've read about LSP and it should be possible to make the already existing xtext part of my project as a language-server
- I'm trying to follow the guide https://www.typefox.io/blog/building-a-vs-code-extension-with-xtext-and-the-language-server-protocol but it only covers the creation of a new project. Indeed this new project needs to be created with different parameters
- I'm thereby asking if anyone knows the best way to port the old project to work with this feature without having to recreate a whole project from scratch.

thanks for your time
Re: Porting project from xtext plugin to xtext lsp server [message #1827037 is a reply to message #1827033] Wed, 06 May 2020 11:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13641
Registered: July 2009
Senior Member
assuming you dont care about CI & already have a .ide project

- add a new launch config to ide calling the org.eclipse.xtext.ide.server.ServerLauncher
- launch the config and add missing dependencies to manifest until no errors
- use the export -> java -> runnable jar file
to get a runnable jar.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Porting project from xtext plugin to xtext lsp server [message #1827064 is a reply to message #1827037] Wed, 06 May 2020 14:22 Go to previous message
Luca Reccia is currently offline Luca RecciaFriend
Messages: 14
Registered: May 2020
Junior Member
Thanks for all your support, after a few hours of strugle I managed to make it work. Here are the steps i followed for some future reference:

as christian has anticipated I didn't have any CI or complex maven setup I cared about

- create an xtext project with the same name and workspace as the old one (there will be some copy and paste and this will make it easier)
- select "eclipse plugin option" if you need it
- select Gradle as build system
- select normal as "language server"
- select "web" if needed and click finish
- move all the /src/* of all the old project (in my case the root one, 'ide', 'target', 'tests', 'ui', 'web') in the respective src folders of the new project
- do "run as mwe2 workflow" on the file "rootporject"/"YourGrammar".mwe2
- (OPTIONAL) add ` applicationName = 'xtext-server' ` the row beneath "mainClassName" inside "rootproject".ide/build.gradle
- open terminal inside the project and run "gradle installDist"
- "rootproject".ide/build/install/xtext-server/bin/xtext-server is your language server, you can call it from an ide plugin frontend (further reference on how to do this for VSCODE https://www.typefox.io/blog/building-a-vs-code-extension-with-xtext-and-the-language-server-protocol)

Thanks for all your help
Previous Topic:How to call generators in an LSP command
Next Topic:[SOLVED] Export DSL as runnable Jar
Goto Forum:
  


Current Time: Tue Oct 27 23:32:20 GMT 2020

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

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

Back to the top