Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolving proxies across different projects(Is it possible, using EcoreUtil.resolve(EObject, ResourceSet)?)
Resolving proxies across different projects [message #1872330] Mon, 28 October 2024 10:21 Go to next message
Eclipse UserFriend
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 #1872336 is a reply to message #1872330] Mon, 28 October 2024 14:39 Go to previous messageGo to next message
Eclipse UserFriend
do the project have project references or java classpath references between each other?
if yes it should work ootb
Re: Resolving proxies across different projects [message #1872339 is a reply to message #1872336] Mon, 28 October 2024 15:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian, thank you for your quick reply, as usual.
I have already set up a bidirectional Project Reference between the two projects, but it did not fix my issue. Nothing changed.
Re: Resolving proxies across different projects [message #1872345 is a reply to message #1872336] Mon, 28 October 2024 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich wrote on Mon, 28 October 2024 14:39
do 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 Go to previous messageGo to next message
Eclipse UserFriend
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)
Re: Resolving proxies across different projects [message #1872404 is a reply to message #1872348] Wed, 30 October 2024 10:52 Go to previous message
Eclipse UserFriend
Excellent, thanks. This will probably come in handy in the future.
Previous Topic:Portable JAVA+DSL installer with ecoretools diagram editor
Next Topic:Xtext 2.37.0.M2 for Eclipse 2024-12 M3
Goto Forum:
  


Current Time: Fri Feb 14 02:58:15 GMT 2025

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

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

Back to the top