Search in sources :

Example 1 with MaybeExported

use of org.elixir_lang.psi.call.MaybeExported in project intellij-elixir by KronicDeth.

the class ModuleImpl method exports.

@Contract(pure = true)
@NotNull
public static MaybeExported[] exports(@NotNull TreeElement mirror) {
    PsiElement mirrorPsi = mirror.getPsi();
    MaybeExported[] exports;
    if (mirrorPsi instanceof Call) {
        Call mirrorCall = (Call) mirrorPsi;
        final List<MaybeExported> exportedList = new ArrayList<MaybeExported>();
        Modular.callDefinitionClauseCallWhile(mirrorCall, new Function<Call, Boolean>() {

            @Override
            public Boolean fun(Call call) {
                if (call instanceof MaybeExported) {
                    MaybeExported maybeExportedCall = (MaybeExported) call;
                    if (maybeExportedCall.isExported()) {
                        exportedList.add(maybeExportedCall);
                    }
                }
                return true;
            }
        });
        exports = exportedList.toArray(new MaybeExported[exportedList.size()]);
    } else {
        exports = new MaybeExported[0];
    }
    return exports;
}
Also used : MaybeExported(org.elixir_lang.psi.call.MaybeExported) Call(org.elixir_lang.psi.call.Call) ArrayList(java.util.ArrayList) StubBasedPsiElement(com.intellij.psi.StubBasedPsiElement) PsiElement(com.intellij.psi.PsiElement) Contract(org.jetbrains.annotations.Contract) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 StubBasedPsiElement (com.intellij.psi.StubBasedPsiElement)1 ArrayList (java.util.ArrayList)1 Call (org.elixir_lang.psi.call.Call)1 MaybeExported (org.elixir_lang.psi.call.MaybeExported)1 Contract (org.jetbrains.annotations.Contract)1 NotNull (org.jetbrains.annotations.NotNull)1