Skip to main content



      Home
Home » Modeling » TMF (Xtext) » .ecore models in linked folders not indexed
.ecore models in linked folders not indexed [message #854255] Mon, 23 April 2012 16:33 Go to next message
Eclipse UserFriend
In project Spray we faced the problem that .ecore models from the development workspace were not indexed. We are referring to EClasses in our DSL. It works from plugin Jars, and when importing the metamodel project (with Xtext nature enabled) into the runtime workspace.

After some debugging I have came to JdtToBeBuiltComputer#wasFragmentRootAlreadyProcessed(). In the case of the .ecore file being in a development workspace project, the project's name of variable otherProject has value '.org.eclipse.jdt.core.external.folders'. The condition
previouslyBuilt.contains(otherProject.getName())
returns true and subsequently ignores this "project". Further this "project" has no Xtext nature, although the original project has the nature.

The URI has e.g. this value:
platform:/resource/.org.eclipse.jdt.core.external.folders/.link14/org/eclipselabs/spray/styles/Style.ecore

As a first test I have overwritten JdtToBeBuiltComputer with a overridingGuiceModule, and just returning 'false' when 'otherProject' is pointing the the external linked folder:

   IProject otherProject = pair.getSecond();
   if (".org.eclipse.jdt.core.external.folders".equals(otherProject.getName()))
   return false;

I consider this as an ugly workaround, but what would be the appropriate solution? Is this intended behavior or a bug?

Best wishes,
~Karsten
Re: .ecore models in linked folders not indexed [message #854273 is a reply to message #854255] Mon, 23 April 2012 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi Karsten,

that's actually a p2 bug. Folders that are not on the classpath are not
visible from the development workspace in the runtime workspace.

Please note the following case in the JdtToBeBuildComputer

boolean process = XtextProjectHelper.hasNature(otherProject);
String otherName = otherProject.getName();
if (!process) {
process = otherProject.isAccessible() && otherProject.isHidden();

If the project does not have the Xtext nature but is both hidden and
accessible, it is scheduled for indexing thus its contents is processed
by the builder.

You may want to dig into
PackageFragmentRootWalker.traverse(IPackageFragmentRoot, boolean) to
verify this (since the projects contents is cached, a clean build may be
necessary to trigger the indexing of the hidden project).

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 23.04.12 22:33, schrieb Karsten Thoms:
> In project Spray we faced the problem that .ecore models from the
> development workspace were not indexed. We are referring to EClasses in
> our DSL. It works from plugin Jars, and when importing the metamodel
> project (with Xtext nature enabled) into the runtime workspace.
> After some debugging I have came to
> JdtToBeBuiltComputer#wasFragmentRootAlreadyProcessed(). In the case of
> the .ecore file being in a development workspace project, the project's
> name of variable otherProject has value
> '.org.eclipse.jdt.core.external.folders'. The condition
> previouslyBuilt.contains(otherProject.getName())
> returns true and subsequently ignores this "project". Further this
> "project" has no Xtext nature, although the original project has the
> nature.
> The URI has e.g. this value:
> platform:/resource/.org.eclipse.jdt.core.external.folders/.link14/org/eclipselabs/spray/styles/Style.ecore
>
>
> As a first test I have overwritten JdtToBeBuiltComputer with a
> overridingGuiceModule, and just returning 'false' when 'otherProject' is
> pointing the the external linked folder:
>
> IProject otherProject = pair.getSecond();
> if
> (".org.eclipse.jdt.core.external.folders".equals(otherProject.getName()))
> return false;
>
> I consider this as an ugly workaround, but what would be the appropriate
> solution? Is this intended behavior or a bug?
>
> Best wishes,
> ~Karsten
Re: .ecore models in linked folders not indexed [message #855040 is a reply to message #854273] Tue, 24 April 2012 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sebastian,

thanks for the explanation!

Best,
~Karsten
Re: .ecore models in linked folders not indexed [message #897637 is a reply to message #855040] Tue, 24 July 2012 16:38 Go to previous messageGo to next message
Eclipse UserFriend
So, is there a workaround for this issue? I'm currently facing it.

Thanks!
Re: .ecore models in linked folders not indexed [message #897649 is a reply to message #897637] Tue, 24 July 2012 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Am 24.07.12 22:38, schrieb Reynier Ortiz:
> So, is there a workaround for this issue? I'm currently facing it.
>
> Thanks!

Hmm ... can't you avoid using linked folders? I doubt that the PDE will
ever (literally) address that.

Regards,
Sebastian
Re: .ecore models in linked folders not indexed [message #897948 is a reply to message #897649] Wed, 25 July 2012 09:44 Go to previous message
Eclipse UserFriend
At development time (when launching the runtime workspace) I haven't came up with way to avoid them since the linked folders/resources are created automatically by PDE. To make it work and test my DSLs I've to make several tweaks and launch the runtime workspace a couple of times so all the models (that are referred as linked resources) get indexed. Of course this doesn't happen on a production environment where all the plugins are released as jars.

It's a shame that PDE doesn't fix that, this impacts development time.

Regards,
Reynier
Previous Topic:How do I filter the result of AbstractDeclarativeScopeProvider.delegateGetScope()?
Next Topic:[Xtend] Shortcut for switching between xtend and java
Goto Forum:
  


Current Time: Sun Jul 13 15:41:10 EDT 2025

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

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

Back to the top