Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Building for Eclipse and LSP
Building for Eclipse and LSP [message #1761441] Thu, 11 May 2017 08:55 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

I upgraded to Xtext 2.11 and need to build both an Eclipse plugin and a vscode extension. The problem is that plugins can only be built with Maven, and the LSP server is much easier to build with Gradle.

I am trying to combine those, but without luck yet. Should it work, or am I trying in vain?

I tried to find a Maven plugin that would bundle the LSP server with all deps in a fat jar, but could not make that work either.

What would be the best way to provide both artifacts?

best regards,
Vlad
Re: Building for Eclipse and LSP [message #1761443 is a reply to message #1761441] Thu, 11 May 2017 09:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
hi,

what was your exact problem with that.

what about having a maven AND a gradle build?
if you select eclipse + gradle in the wizard it should offer you to do that?


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: Building for Eclipse and LSP [message #1761445 is a reply to message #1761443] Thu, 11 May 2017 09:06 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Oh, I didn't read the second sentence when choosing Gradle, about creating a Tycho build too.

It's a bit of work to recreate the projects with the wizard for an existing code base, but it sure is easier than trying to do it by hand! I had probably missed some settings.

Thanks Christian!
Re: Building for Eclipse and LSP [message #1761446 is a reply to message #1761443] Thu, 11 May 2017 09:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
anf for pure maven you should have a look at

- copy dependencies from https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
- https://maven.apache.org/plugins/maven-shade-plugin/
-


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: Building for Eclipse and LSP [message #1761448 is a reply to message #1761446] Thu, 11 May 2017 09:08 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I tried those plugins, but again, something is probably missing because I got an incomplete result. I hope to get Gradle working, though.
Re: Building for Eclipse and LSP [message #1761451 is a reply to message #1761448] Thu, 11 May 2017 09:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
=> use the wizard. that should work out of the box

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: Building for Eclipse and LSP [message #1763263 is a reply to message #1761451] Fri, 12 May 2017 09:17 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Thanks, it looks like it is working, but when trying out the mydsl example, I get an error; any ideas what I can do to fix it?

[Error - 11:14:53 AM] Server initialization failed.
Message: java.lang.reflect.InvocationTargetException
Code: -32603
Re: Building for Eclipse and LSP [message #1763272 is a reply to message #1763263] Fri, 12 May 2017 10:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
did you start the java -jar manualy to get a complete stacktrace

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: Building for Eclipse and LSP [message #1763274 is a reply to message #1763272] Fri, 12 May 2017 10:30 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I used the embedded variant. Will try the standalone, but so far I can't get it to connect (to be specified that I don't have a pure mydsl demo, but implemented it similarly on my code base)
Re: Building for Eclipse and LSP [message #1763275 is a reply to message #1763274] Fri, 12 May 2017 10:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
no i mean:

in the embedded variant you have a shell script or something
simply call that manually from cmd line


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: Building for Eclipse and LSP [message #1763277 is a reply to message #1763275] Fri, 12 May 2017 10:37 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
The error is thrown when receiving the first message. Just starting from CLI works fine, the server sits and waits for a connection.
Re: Building for Eclipse and LSP [message #1763280 is a reply to message #1763277] Fri, 12 May 2017 10:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
that looks strange. so the error happens on connect. maybe you can start the server with remote debugging so you can inspect

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: Building for Eclipse and LSP [message #1763284 is a reply to message #1763280] Fri, 12 May 2017 11:05 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I will try that, it's been a while since doing that.

My guess is that the problem occurs when the jsonrpc dispatcher calls the initialize method - that would be consistent with the InvocationTargetException that is reflection-related.
Re: Building for Eclipse and LSP [message #1763550 is a reply to message #1763284] Wed, 17 May 2017 10:24 Go to previous messageGo to next message
anil chalil is currently offline anil chalilFriend
Messages: 38
Registered: October 2010
Member
I encoutered with same error as well. Then i moven my dsl files to a new directory and from vscode i opened directory. Exception has gone. But i dont know what fixed it i mean opening the directory or a fresh directory without other files.
Re: Building for Eclipse and LSP [message #1763625 is a reply to message #1763550] Thu, 18 May 2017 07:15 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
You are right, thanks!

So the problem happens when opening files without a current open folder... Looking at the code, it should be handled with a proper error message, but maybe something goes wrong before getting there, while doing the dependency injection magic.
Re: Building for Eclipse and LSP [message #1763627 is a reply to message #1763625] Thu, 18 May 2017 07:21 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14497
Registered: July 2009
Senior Member
well this is: https://github.com/eclipse/xtext-core/issues/57

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
Previous Topic:Cannot be resolved
Next Topic:default value for Boolean attribute and serialization
Goto Forum:
  


Current Time: Thu Jun 08 22:11:33 GMT 2023

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

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

Back to the top