Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » fill model for external libraries?
fill model for external libraries? [message #780246] Tue, 17 January 2012 13:02 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

For an existing language, I'd like to provide code assist (completion, documentation, etc) even for the standard libraries. I wonder about some things regarding this:

- can the libraries be preprocessed, the model saved in a file and merged into the current instance? I know ecore model can be saved/loaded, but am not sure about merging it with existing Xtext model (cross-links, for example).

- some information (for example the documentation) is available in a different format for the libraries than for regular code (XML files instead of inline javadoc-like). Is there any way to plug in a custom documentation provider, or should I include the docs in the preprocessed model?

At the moment I just want to know if it's possible (and about how difficult it is), we are trying to decide if we can use Xtext or not.

Thanks for the help!

best regards,
Vlad
Re: fill model for external libraries? [message #780259 is a reply to message #780246] Tue, 17 January 2012 13:46 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Vlad,

yes this will be possible, although I would handle it different. Standard libraries, I think you mean defined in the DSL itself, I would not "magically" merge, but rather deliver them in a plugin. A custom documentation provider can be configured in the runtime module. It would have to distuinguish that a resource is from the library, to render different output. I would use Xtend to implement it.

Regards,
Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: fill model for external libraries? [message #780271 is a reply to message #780259] Tue, 17 January 2012 14:09 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Thank you Karsten!

What do you mean by not magically merging the libraries, but delivering them in a plugin?

The setting is just like for Java: a project is linked to a certain preexisting runtime library and the user can select another. I would like to have the libraries preindexed, ready to be referred to from the user code.

regards,
Vlad
Re: fill model for external libraries? [message #780324 is a reply to message #780271] Tue, 17 January 2012 15:57 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Vlad,

you spoke of Quote:
can the libraries be preprocessed, the model saved in a file and merged into the current instance

I understood this in a way that you want to do "magic merging", or just some sophisticated stuff that is just not necessary.

The index will contain also elements from a library that is packaged, usually within a plugin. In the simplest case you just have a Java plugin project in your workspace with a dependency to the library plugin. That's it.

Regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: fill model for external libraries? [message #780344 is a reply to message #780324] Tue, 17 January 2012 16:27 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I'm a little thick today, I don't see what you mean Smile

A library plugin would be a plugin that contains all the library source code - and then the model will be built from there?

I'd like the user to install the language runtime separately from Eclipse and my tools and just point Eclipse to the installation directory. In case there is a prebuilt model there, I can load it, if not then I can build it in the background.

regards,
Vlad
Re: fill model for external libraries? [message #780353 is a reply to message #780344] Tue, 17 January 2012 16:48 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Vlad,

I consider a "Standard Library" to be something that is prebuilt, not what needs to be built in the background.

Your initial question was if it can be achieved somehow to provide prebuilt libraries against which you could link and for which you would provide different documentation providers. The answer is yes. Also independent from Eclipse UI, but then you might confuse the role of the documentation provider. This would affect primarely the UI (-> tooltips), which would be Eclipse dependent.

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: fill model for external libraries? [message #780357 is a reply to message #780353] Tue, 17 January 2012 16:51 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Ah, so the "package as a plugin" was relating to the documentation provider too? I thought it was about generally loading the library model.

Thanks!
/Vlad
Previous Topic:Multiple languages in one file
Next Topic:Critical MWE2Launcher error
Goto Forum:
  


Current Time: Wed Sep 25 01:33:35 GMT 2024

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

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

Back to the top