/*
 * generated by Xtext
 */
package org.eclipse.xtext.testlanguages.fileAware.scoping;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.testlanguages.fileAware.fileAware.FileAwarePackage;

import com.google.inject.Inject;

/**
 * This class contains custom scoping description.
 * 
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
 * on how and when to use it.
 */
public class FileAwareTestLanguageScopeProvider extends AbstractFileAwareTestLanguageScopeProvider {

	@Inject IGlobalScopeProvider global;

	public IScope getScope(EObject context, EReference reference) {
		if (reference == FileAwarePackage.Literals.IMPORT__ELEMENT) {
			return global.getScope(context.eResource(), reference, null);
		}
		return super.getScope(context, reference);
	}

}
