Search in sources :

Example 1 with ImportScope

use of org.eclipse.xtext.scoping.impl.ImportScope in project statecharts by Yakindu.

the class STextScopeProvider method scope_ActiveStateReferenceExpression_value.

public IScope scope_ActiveStateReferenceExpression_value(EObject context, EReference reference) {
    Statechart statechart = getStatechart(context);
    if (statechart == null)
        return IScope.NULLSCOPE;
    List<State> allStates = EcoreUtil2.getAllContentsOfType(statechart, State.class);
    IScope scope = Scopes.scopeFor(allStates, nameProvider, IScope.NULLSCOPE);
    return new ImportScope(getActiveStateNormalizer(context), scope, new EObjectDescriptionLookUp(Lists.newArrayList(scope.getAllElements())), reference.getEReferenceType(), false);
}
Also used : EObjectDescriptionLookUp(org.eclipse.xtext.resource.impl.EObjectDescriptionLookUp) State(org.yakindu.sct.model.sgraph.State) ImportScope(org.eclipse.xtext.scoping.impl.ImportScope) Statechart(org.yakindu.sct.model.sgraph.Statechart) IScope(org.eclipse.xtext.scoping.IScope)

Aggregations

EObjectDescriptionLookUp (org.eclipse.xtext.resource.impl.EObjectDescriptionLookUp)1 IScope (org.eclipse.xtext.scoping.IScope)1 ImportScope (org.eclipse.xtext.scoping.impl.ImportScope)1 State (org.yakindu.sct.model.sgraph.State)1 Statechart (org.yakindu.sct.model.sgraph.Statechart)1