Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access to Resource of other file
Access to Resource of other file [message #1350116] Mon, 12 May 2014 14:03 Go to next message
Raja B. is currently offline Raja B.Friend
Messages: 6
Registered: May 2014
Junior Member

I have a problem with access to resources in other files.
For example, I have an Element E defined in the file file1 and I use it in the file file2.
In the plugin, I have no problem using E in file2, even the auto-completion with cross reference works.
In the MyDslGenerator, I can access to the element E only if it is used. When I scan resource.allContents, I can find only elements defined in the file1.

Is it possible to access to the element E directly from the resource of file1 ? without going through the use of E in file1 ?

Re: Access to Resource of other file [message #1350363 is a reply to message #1350116] Mon, 12 May 2014 16:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13613
Registered: July 2009
Senior Member
If you have all resources in the resource set you could ask your
resource for its resource set but this won't work in the builders
generator. Alternatively you could use the Xtext index to load all
resources that contain certain stuff. Could you elaborate a bit more
on your usecase

Need training, onsite consulting or any other kind of help for Xtext?
Go visit or send a mail to xtext at itemis dot de

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Re: Access to Resource of other file [message #1409549 is a reply to message #1350116] Mon, 18 August 2014 11:25 Go to previous message
cheney cao is currently offline cheney caoFriend
Messages: 5
Registered: August 2014
Junior Member
Hi Raja,

Have your tried the suggestion from Christian, does it work for you?

I think I have the same request with you. Even more in my case the file1 and file2 is coming from different model (they have different file extension).
Previous Topic:How I make error message of code written in my program language?
Next Topic:xtext 2.6 and
Goto Forum:

Current Time: Mon Sep 28 19:10:17 GMT 2020

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

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

Back to the top