Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using xText content assist from an proprietary plugin
Using xText content assist from an proprietary plugin [message #722121] Sun, 04 September 2011 14:30 Go to next message
Roded Bahat is currently offline Roded BahatFriend
Messages: 152
Registered: August 2011
Senior Member
Hello all,
I'm currently developing a plugin which will provide content assist to various proprietary configuration files.
As some of those files contain DSLs (with their own grammar), I was wondering whether or not it is possible to define their grammar in xText and then use xText as a "black box" of sorts to create content assist proposals from within my own plugin (i.e. not using xText's editor for the defined DSL grammar but using xText via an API of sorts).

Anyone know if this is possible?
Would really appreciate any points in the right direction.
Thanks,
Roded
Re: Using xText content assist from an proprietary plugin [message #722449 is a reply to message #722121] Mon, 05 September 2011 19:45 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Roded,

I think you have to dig into the implementation of the template-proposal
language which does something similar. Please note that it was not meant
to be reused and is only poorly documented but it pretty much does the same.
The respective proposal provider can be found here:
http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/tree/plugins/org.eclipse.xtext.ui.codetemplates.ui/src/org/eclipse/xtext/ui/codetemplates/ui/contentassist/CodetemplatesProposalProvider.java#n302

where complete_Literal is the interesting part, especially
temporaryResourceProvider.useTemporaryResource(..) is the call that
produces a dynamic resource with a model that is computed from a
blackbox-literal.

Please don't hesitate to ask if you have any questions.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 04.09.11 16:30, Roded wrote:
> Hello all,
> I'm currently developing a plugin which will provide content assist to
> various proprietary configuration files. As some of those files contain
> DSLs (with their own grammar), I was wondering whether or not it is
> possible to define their grammar in xText and then use xText as a "black
> box" of sorts to create content assist proposals from within my own
> plugin (i.e. not using xText's editor for the defined DSL grammar but
> using xText via an API of sorts).
>
> Anyone know if this is possible?
> Would really appreciate any points in the right direction.
> Thanks,
> Roded
Re: Using xText content assist from an proprietary plugin [message #722780 is a reply to message #722449] Tue, 06 September 2011 17:14 Go to previous message
Roded Bahat is currently offline Roded BahatFriend
Messages: 152
Registered: August 2011
Senior Member
Hey Sebastian,
I'd have to do some (a lot) more digging before I'll have any more intelligent questions on the matter.
Many thanks for the reply.
Hopefully, you'll hear from me again.
Roded
Previous Topic:Including custom models for default imports
Next Topic:Case insensitive scope resolution
Goto Forum:
  


Current Time: Thu Apr 25 05:35:40 GMT 2024

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

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

Back to the top