Examples of lookupEnclosingPsiElement()


Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

            if (psiElement instanceof BasePsiElement) {
                BasePsiElement basePsiElement = (BasePsiElement) psiElement;
                PsiLookupAdapter lookupAdapter = new ObjectDefinitionLookupAdapter(null, objectType, objectName, ElementTypeAttribute.SUBJECT);
                BasePsiElement specObject = lookupAdapter.findInScope(basePsiElement);
                if (specObject != null) {
                    return specObject.lookupEnclosingPsiElement(ElementTypeAttribute.OBJECT_SPECIFICATION);
                }
            }
        }
        return null;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

            if (psiElement instanceof BasePsiElement) {
                BasePsiElement basePsiElement = (BasePsiElement) psiElement;
                PsiLookupAdapter lookupAdapter = new ObjectDefinitionLookupAdapter(null, objectType, objectName, ElementTypeAttribute.SUBJECT);
                BasePsiElement specObject = lookupAdapter.findInScope(basePsiElement);
                if (specObject != null) {
                    return specObject.lookupEnclosingPsiElement(ElementTypeAttribute.OBJECT_DECLARATION);
                }
            }
        }
        return null;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

            variableDefinitions = scope.collectPsiElements(lookupAdapter, variableDefinitions, 0);

            PsiElement parent = scope.getParent();
            if (parent instanceof BasePsiElement) {
                BasePsiElement basePsiElement = (BasePsiElement) parent;
                scope = basePsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.SCOPE_DEMARCATION);
                if (scope == null) scope = basePsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.SCOPE_ISOLATION);
            } else {
                scope = null;
            }
        }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

            PsiElement parent = scope.getParent();
            if (parent instanceof BasePsiElement) {
                BasePsiElement basePsiElement = (BasePsiElement) parent;
                scope = basePsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.SCOPE_DEMARCATION);
                if (scope == null) scope = basePsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.SCOPE_ISOLATION);
            } else {
                scope = null;
            }
        }
        return variableDefinitions;
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

    public Wrap getWrap(BasePsiElement psiElement, CodeStyleSettings settings) {
        BasePsiElement parentPsiElement = getParentPsiElement(psiElement);
        IterationElementType iterationElementType = (IterationElementType) parentPsiElement.getElementType();
        ElementType elementType = psiElement.getElementType();

        NamedPsiElement namedPsiElement = (NamedPsiElement) parentPsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.EXECUTABLE);
        boolean shouldWrap = namedPsiElement.approximateLength() > settings.RIGHT_MARGIN;
        return getWrap(elementType, iterationElementType, shouldWrap);
    }

    public Spacing getSpacing(BasePsiElement psiElement, CodeStyleSettings settings) {
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

    public Spacing getSpacing(BasePsiElement psiElement, CodeStyleSettings settings) {
        BasePsiElement parentPsiElement = getParentPsiElement(psiElement);
        IterationElementType iterationElementType = (IterationElementType) parentPsiElement.getElementType();
        ElementType elementType = psiElement.getElementType();

        NamedPsiElement namedPsiElement = (NamedPsiElement) parentPsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.EXECUTABLE);
        boolean shouldWrap = namedPsiElement.approximateLength() > settings.RIGHT_MARGIN;
        return getSpacing(iterationElementType, elementType, shouldWrap);
    }
}
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

        super("chop_down_if_statement_long", "Chop down if statement long");
    }

    public Wrap getWrap(BasePsiElement psiElement, CodeStyleSettings settings) {
        BasePsiElement parentPsiElement = getParentPsiElement(psiElement);
        NamedPsiElement namedPsiElement = (NamedPsiElement) parentPsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.EXECUTABLE);
        boolean shouldWrap = namedPsiElement.approximateLength() > settings.RIGHT_MARGIN;
        return shouldWrap ? WRAP_ALWAYS : WRAP_NONE;

    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement.lookupEnclosingPsiElement()

    }

    public Spacing getSpacing(BasePsiElement psiElement, CodeStyleSettings settings) {
        BasePsiElement parentPsiElement = getParentPsiElement(psiElement);
        NamedPsiElement namedPsiElement = (NamedPsiElement) parentPsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.EXECUTABLE);
        boolean shouldWrap = namedPsiElement.approximateLength() > settings.RIGHT_MARGIN;
        return getSpacing(psiElement, shouldWrap);
    }

}
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.psi.IdentifierPsiElement.lookupEnclosingPsiElement()

                        ElementTypeAttribute targetAttribute =
                                elementType.is(ElementTypeAttribute.OBJECT_DECLARATION) ? ElementTypeAttribute.OBJECT_SPECIFICATION :
                                elementType.is(ElementTypeAttribute.OBJECT_SPECIFICATION) ? ElementTypeAttribute.OBJECT_DECLARATION : null;

                        if (targetAttribute != null) {
                            BasePsiElement rootPsiElement = identifierPsiElement.lookupEnclosingPsiElement(ElementTypeAttribute.ROOT);

                            BasePsiElement targetElement = rootPsiElement == null ? null :
                                    rootPsiElement.lookupPsiElementBySubject(targetAttribute,
                                                identifierPsiElement.getChars(),
                                                identifierPsiElement.getObjectType());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.