Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » import of namespace in Xtext editor(import of namespace in Xtext editor)
icon5.gif  import of namespace in Xtext editor [message #1647406] Tue, 03 March 2015 12:07 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi All,

I have a grammar in which I have "import of namespace" concept.
Similar to java i.e. writing import statements at the top.

As we have seen in java, the import statements will be automatically added when we try to access some class etc.

Can we do the same in xtext ?

I mean to say: when I refer to an EObject , the import statement for its namespace should be automatically added.

Thanks for any help! Smile

Re: import of namespace in Xtext editor [message #1647459 is a reply to message #1647406] Tue, 03 March 2015 12:43 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13939
Registered: July 2009
Senior Member
Have a look how Xbase/Xtend is doing this.
- org.eclipse.xtext.common.types.xtext.ui.JdtTypesProposalProvider.createTypeProposal(String, int, boolean, ICompletionProposalFactory, ContentAssistContext, ICompletionProposalAcceptor, IJvmTypeProvider, IValueConverter<String>)
- org.eclipse.xtext.xbase.ui.contentassist.ImportingTypesProposalProvider$FQNImporter
- org.eclipse.xtext.xbase.ui.contentassist.ImportingTypesProposalProvider.createTextApplier(ContentAssistContext, IScope, IQualifiedNameConverter, IValueConverter<String>)

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :

[Updated on: Tue, 03 March 2015 12:56]

Report message to a moderator

Previous Topic:Xbase: Add own EMF-classes to the model
Next Topic:Supporting unquoted string with spaces
Goto Forum:

Current Time: Thu May 13 07:06:03 GMT 2021

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

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

Back to the top