Search in sources :

Example 1 with ElixirNoParenthesesOneArgument

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

the class FieldWithDefaultValue method is.

/*
     * Static Methods
     */
public static boolean is(QuotableKeywordPair quotableKeywordPair) {
    boolean fieldWithDefaultValue = false;
    PsiElement parent = quotableKeywordPair.getParent();
    if (parent instanceof QuotableKeywordList) {
        PsiElement grandParent = parent.getParent();
        if (grandParent instanceof ElixirNoParenthesesOneArgument) {
            PsiElement greatGrandParent = grandParent.getParent();
            if (greatGrandParent instanceof Call) {
                Call greatGrandParentCall = (Call) greatGrandParent;
                fieldWithDefaultValue = Structure.is(greatGrandParentCall);
            }
        }
    }
    return fieldWithDefaultValue;
}
Also used : Call(org.elixir_lang.psi.call.Call) ElixirNoParenthesesOneArgument(org.elixir_lang.psi.ElixirNoParenthesesOneArgument) QuotableKeywordList(org.elixir_lang.psi.QuotableKeywordList) PsiElement(com.intellij.psi.PsiElement)

Example 2 with ElixirNoParenthesesOneArgument

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

the class Field method is.

/*
     * Static Methods
     */
public static boolean is(ElixirAtom atom) {
    boolean field = false;
    PsiElement parent = atom.getParent();
    if (parent instanceof ElixirAccessExpression && parent.getChildren().length == 1) {
        PsiElement grandParent = parent.getParent();
        if (grandParent instanceof ElixirList) {
            PsiElement greatGrandParent = grandParent.getParent();
            if (greatGrandParent instanceof ElixirAccessExpression && greatGrandParent.getChildren().length == 1) {
                PsiElement greatGreatGrandParent = greatGrandParent.getParent();
                if (greatGreatGrandParent instanceof ElixirNoParenthesesOneArgument) {
                    PsiElement greatGreatGreatGrandParent = greatGreatGrandParent.getParent();
                    if (greatGreatGreatGrandParent instanceof Call) {
                        Call greatGreatGreatGrandParentCall = (Call) greatGreatGreatGrandParent;
                        field = Structure.is(greatGreatGreatGrandParentCall);
                    }
                }
            }
        }
    }
    return field;
}
Also used : Call(org.elixir_lang.psi.call.Call) ElixirNoParenthesesOneArgument(org.elixir_lang.psi.ElixirNoParenthesesOneArgument) ElixirList(org.elixir_lang.psi.ElixirList) ElixirAccessExpression(org.elixir_lang.psi.ElixirAccessExpression) PsiElement(com.intellij.psi.PsiElement)

Aggregations

PsiElement (com.intellij.psi.PsiElement)2 ElixirNoParenthesesOneArgument (org.elixir_lang.psi.ElixirNoParenthesesOneArgument)2 Call (org.elixir_lang.psi.call.Call)2 ElixirAccessExpression (org.elixir_lang.psi.ElixirAccessExpression)1 ElixirList (org.elixir_lang.psi.ElixirList)1 QuotableKeywordList (org.elixir_lang.psi.QuotableKeywordList)1