Resolving proxies across different projects [message #1872330] |
Mon, 28 October 2024 10:21  |
Eclipse User |
|
|
|
Hi,
In my Xtext project I use EcoreUtil.resolve(EObject, ResourceSet) to cause the loading of the resources required for resolving some proxies into the ResourceSet. The ResourceSet I pass to resolve() is fetched from another EObject using EcoreUtil2.getResourceSet(), so it is some kind of ResourceSet that is created internally by Xtext at some point. Now, suppose in the Workspace of my DSL editor I created two or more projects to experiment with my DSL. From within a file in project A I'd like to resolve a proxy that points to an entity defined in a file in project B. This doesn't seem to be working out of the box, it looks like whatever ResourceSet I fetch and pass to resolve() has a "project scope", i.e. it does not support loading resources belonging to a different project. Is there any way I can achieve what I want?
Thanks!
|
|
|
|
|
Re: Resolving proxies across different projects [message #1872345 is a reply to message #1872336] |
Mon, 28 October 2024 16:08   |
Eclipse User |
|
|
|
Christian Dietrich wrote on Mon, 28 October 2024 14:39do the project have project references or java classpath references between each other?
if yes it should work ootb
Hi Chirstian, a follow-up. Setting up Project References did not help, but indeed adding the project where the entity is defined to the classpath of the project where the entity is referenced fixed my problem! Thank you very much! Adding the latter to the classpath of the former doesn't seem to be needed.
|
|
|
Re: Resolving proxies across different projects [message #1872348 is a reply to message #1872345] |
Mon, 28 October 2024 17:25   |
Eclipse User |
|
|
|
you can also check configuration of
public Provider<? extends IAllContainersState> provideIAllContainersState() {
return Access.getJavaProjectsState();
}
in MyDslUiModile.
there is also
org.eclipse.xtext.ui.shared.Access.getWorkspaceProjectsState()
(am not sure about your project setup / situation)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03827 seconds