fill model for external libraries? [message #780246] |
Tue, 17 January 2012 13:02 |
Vlad Dumitrescu 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 |
|
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 #780324 is a reply to message #780271] |
Tue, 17 January 2012 15:57 |
|
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 #780353 is a reply to message #780344] |
Tue, 17 January 2012 16:48 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04823 seconds