How to: list all visible packages from Project [message #1426935] |
Fri, 19 September 2014 12:52 |
Simon Sperl Messages: 21 Registered: May 2014 |
Junior Member |
|
|
I have an example project structure:
IProject A
a.dsl
package a
package a.a.a
IProject C
references A
cfile.file
"a is green"
"a.a.a is yellow"
I now want to check for entries in cfile.file if a and a.a.a exist/ are in the "scope of C".
but the classical way:
URI resourceURI = //cfile.file URI
IResourceDescriptions rds = rdp.getResourceDescriptions( someResourceSet);
IResourceDescription rd = rds.getResourceDescription(resourceURI);
List<IContainer> vis = cm.getVisibleContainers(rd, rds);
rds.getResourceDescription(resourceURI); always returns null since cfile.file exports no ResourceDescriptions/ is no dsl file (i guess).
How do I do that? (..I do not want to loadResource everything)
[Updated on: Fri, 19 September 2014 13:36] Report message to a moderator
|
|
|
|
|
|
Re: How to: list all visible packages from Project [message #1426977 is a reply to message #1426963] |
Fri, 19 September 2014 14:01 |
Simon Sperl Messages: 21 Registered: May 2014 |
Junior Member |
|
|
Ty but sry, I just checked the uris are in that form (and exist).
the problem is that the
resourceDescriptionMap of ResourceDescriptions just does not contain an entry for
"platform:/resource/C/cfile.file" (since cfile.file is never parsed it is just a dumb textfile and (pretty sensibly) so never generates eobjectdescriptions)
I just don't know how to get all EObjectDescriptions of a single Project, if I have that I am happy.
[Updated on: Fri, 19 September 2014 14:01] Report message to a moderator
|
|
|
|
Re: How to: list all visible packages from Project [message #1427427 is a reply to message #1427045] |
Sat, 20 September 2014 06:30 |
|
p.s. you may digg into
org.eclipse.xtext.ui.containers.AbstractAllContainersState.getVisibleContainerHandles(String)
this is basically what
org.eclipse.xtext.resource.containers.StateBasedContainerManager.getVisibleContainers(IResourceDescription, IResourceDescriptions)
does
some debugging may show you what actually happens.
the real question i have is: why do you NOT have a start resource?
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03249 seconds