Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem referencing other Files during clean all
Problem referencing other Files during clean all [message #555832] Sun, 29 August 2010 10:40 Go to next message
Johannes Stelzer is currently offline Johannes StelzerFriend
Messages: 30
Registered: October 2009
Member
When I'm editing one of my files the #include is resolved perfectly to other files in in the project.
But when I'm doing a 'clean all' on my projects the references cannot be resolved.

Before 1.0 this did work (until M6 I think).

This is the way I'm resolving the reference:

public class InputFileGlobalScope extends AbstractDeclarativeScopeProvider
		implements IGlobalScopeProvider {

....

	@Inject
	private IResourceDescriptions allDescriptions;

	public IScope scope_Include_includedInputFile(InputFile inputFile,
			EReference reference) {
		List<IEObjectDescription> allElements = new ArrayList<IEObjectDescription>();

		for (IResourceDescription resource : allDescriptions
				.getAllResourceDescriptions()) {
			IEObjectDescription objectDescription = Iterables
					.getOnlyElement(resource
							.getExportedObjects(InputFilePackage.eINSTANCE
									.getInputFile()));

			allElements.add(objectDescription);
		}

		return new SimpleScope(allElements);
	}
} 


Any ideas?

[Updated on: Sun, 29 August 2010 10:42]

Report message to a moderator

Re: Problem referencing other Files during clean all [message #555878 is a reply to message #555832] Sun, 29 August 2010 21:56 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Johannes,

please have a look at how the AbstractGlobalScopeProvider obtains the
right IResourceDescriptions depending on the context (builder or
editor). You have to mimic this behavior if you implement the global
scope provder by yourself. Btw: Why do you do this?

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

Am 29.08.10 12:40, schrieb Johannes Stelzer:
> When I'm editin one of my Files the #include is resilved perfectly to
> the other File in my Workspace. But when I'm doing a 'clean all' on my
> projec the references cannot be resolved.
>
> Before 1.0 this did work (until M6 I think).
>
> This is the way I'm resolving the reference:
>
>
> public class InputFileGlobalScope extends AbstractDeclarativeScopeProvider
> implements IGlobalScopeProvider {
>
> ....
>
> @Inject
> private IResourceDescriptions allDescriptions;
>
> public IScope scope_Include_includedInputFile(InputFile inputFile,
> EReference reference) {
> List<IEObjectDescription> allElements = new
> ArrayList<IEObjectDescription>();
>
> for (IResourceDescription resource : allDescriptions
> .getAllResourceDescriptions()) {
> IEObjectDescription objectDescription = Iterables
> .getOnlyElement(resource
> .getExportedObjects(InputFilePackage.eINSTANCE
> .getInputFile()));
>
> allElements.add(objectDescription);
> }
>
> return new SimpleScope(allElements);
> }
> }
Re: Problem referencing other Files during clean all [message #555892 is a reply to message #555878] Mon, 30 August 2010 05:59 Go to previous messageGo to next message
Johannes Stelzer is currently offline Johannes StelzerFriend
Messages: 30
Registered: October 2009
Member
I'll have a look at this.

I'm using my own global scope provider because i have default imports from other files (even other models) on global scope.

And isn't the global scope provider for all the refrences not residing in the same resource?

[Updated on: Mon, 30 August 2010 06:04]

Report message to a moderator

Re: Problem referencing other Files during clean all [message #556096 is a reply to message #555892] Mon, 30 August 2010 18:45 Go to previous message
Johannes Stelzer is currently offline Johannes StelzerFriend
Messages: 30
Registered: October 2009
Member
Thanks Sebastian,

I've did the dirty copy & paste from the AbstractGlobalSopeProvider - and it works like a charm.

p.s. I've also first tried to move this scope to my 'normal' scopeprovider - but it didn't work.
There are problem-markers created although the are greyed out.

Greets Johannes

[Updated on: Mon, 30 August 2010 18:47]

Report message to a moderator

Previous Topic:underscore missing in function name?
Next Topic:content assist/cross reference/scoping
Goto Forum:
  


Current Time: Wed Apr 24 17:11:08 GMT 2024

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

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

Back to the top