Search in sources :

Example 1 with MemberVisibility

use of org.eclipse.n4js.scoping.accessModifiers.MemberVisibilityChecker.MemberVisibility in project n4js by eclipse.

the class VisibilityAwareMemberScope method isAccepted.

@Override
protected boolean isAccepted(IEObjectDescription description) {
    EObject proxyOrInstance = description.getEObjectOrProxy();
    if (proxyOrInstance != null && !proxyOrInstance.eIsProxy()) {
        if (proxyOrInstance instanceof TMember) {
            TMember member = (TMember) proxyOrInstance;
            MemberVisibility result = checker.isVisible(context, receiverType, member);
            if (!result.visibility)
                this.accessModifierSuggestionStore.put(description.getEObjectURI().toString(), result.accessModifierSuggestion);
            return result.visibility;
        } else if (proxyOrInstance instanceof TEnumLiteral) {
            return checker.isEnumLiteralVisible(context, receiverType);
        }
    }
    return true;
}
Also used : MemberVisibility(org.eclipse.n4js.scoping.accessModifiers.MemberVisibilityChecker.MemberVisibility) TEnumLiteral(org.eclipse.n4js.ts.types.TEnumLiteral) EObject(org.eclipse.emf.ecore.EObject) TMember(org.eclipse.n4js.ts.types.TMember)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 MemberVisibility (org.eclipse.n4js.scoping.accessModifiers.MemberVisibilityChecker.MemberVisibility)1 TEnumLiteral (org.eclipse.n4js.ts.types.TEnumLiteral)1 TMember (org.eclipse.n4js.ts.types.TMember)1