Package com.intellij.lang

Examples of com.intellij.lang.ASTNode


    return null;
  }

  @NotNull
  public static String getSuperComponentName(PsiElement element) {
    ASTNode superComponentNode = getSuperComponentNode(element);
    if (superComponentNode != null) {
      return superComponentNode.getText();
    }
    return "";
  }
View Full Code Here


    return "";
  }

  @Nullable
  public static CfmlComponentReference getSuperComponentReference(PsiElement element) {
    ASTNode node = getSuperComponentNode(element);
    if (node != null) {
      return new CfmlComponentReference(node, element);
    }
    return null;
  }
View Full Code Here

  @Override
  public PsiReference[] getReferences() {
    final PsiElement reference = getAttributeValueElement("component");

    if (reference != null) {
      ASTNode referenceNode = reference.getNode();
      if (referenceNode != null) {
        return new PsiReference[]{new CfmlComponentReference(referenceNode, this)};
      }
    }
    return super.getReferences();
View Full Code Here

  public PsiElement getNameIdentifier() {
    PsiElement lastChild = getLastChild();
    if (lastChild == null) {
      return null;
    }
    ASTNode node = lastChild.getNode();
    if (node != null && node.getElementType() == CfscriptTokenTypes.IDENTIFIER) {
      return lastChild;
    }
    else {
      CfmlNamedAttributeImpl namedAttribute = PsiTreeUtil.findChildOfType(this, CfmlNamedAttributeImpl.class);
      if (namedAttribute != null) {
View Full Code Here

  private static boolean checkType(@Nullable PsiElement element, IElementType type) {
    if (element == null) {
      return false;
    }
    ASTNode node = element.getNode();
    if (node != null && node.getElementType().equals(type)) {
      return true;
    }
    return false;
  }
View Full Code Here

    PsiElement newElement;

    final PsiElement referenceNameElement = getReferenceNameElement();
    if (referenceNameElement != null) {
      final ASTNode referenceNode = referenceNameElement.getNode();
      if (referenceNode == null) {
        return this;
      }
      if (referenceNode.getElementType() == CfmlTokenTypes.STRING_TEXT) {
        newElement = CfmlPsiUtil.createConstantString(newElementName, getProject());
      }
      else {
        newElement = CfmlPsiUtil.createIdentifier(newElementName, getProject());
      }
View Full Code Here

    }
    return Collections.emptyList();
  }

  public JSExpression getCollection() {
    final ASTNode myNode = getNode();
    final ASTNode secondExpression = myNode.findChildByType(
      JSElementTypes.EXPRESSIONS, myNode.findChildByType(JSTokenTypes.IN_KEYWORD)
    );
    return secondExpression != null ? (JSExpression)secondExpression.getPsi() : null;
  }
View Full Code Here

    if (parentType == CfmlElementTypes.TERNARY_EXPRESSION && mySettings.ALIGN_MULTILINE_TERNARY_OPERATION) {
      return myBaseAlignment;
    }

    if (parentType == CfmlElementTypes.PARAMETERS_LIST || parentType == CfmlElementTypes.ARGUMENT_LIST) {
      ASTNode boundParent = myNode.getTreeParent();
      IElementType boundElType = boundParent.getElementType();
      boolean doAlign = false;
      if (boundElType == CfmlElementTypes.FUNCTION_DEFINITION) {
        doAlign = mySettings.ALIGN_MULTILINE_PARAMETERS;
      }
      else if (boundElType == CfmlElementTypes.FUNCTION_CALL_EXPRESSION) {
View Full Code Here

    return findChildByType(CfmlTokenTypes.STRING_TEXT);
  }

  @NotNull
  public String getValue() {
    final ASTNode value = getNode().findChildByType(CfmlTokenTypes.STRING_TEXT);
    if (value != null) {
      return value.getText();
    }
    return "";
  }
View Full Code Here

        return provider.getReferencesByString(args[1], referenceElement, 0);
      }
      else if ((args.length == 2 && "component".equals(args[0]) &&
                expressions.length == 2 && expressions[1] == this) ||
               (args.length == 1 && expressions.length == 1 && expressions[0] == this)) {
        final ASTNode referenceNode = referenceElement.getNode();
        if (referenceNode != null) {
          return new PsiReference[]{new CfmlComponentReference(referenceNode)};
        }
      }
    }
    else if (functionCallEl != null && functionCallEl.isExpandPath()) {
      final PsiElement referenceElement = findChildByType(CfmlTokenTypes.STRING_TEXT);
      if (referenceElement == null) {
        return super.getReferences();
      }
      final ASTNode referenceNode = referenceElement.getNode();
      if (referenceNode != null) {
        return (new CfmlFileReferenceSet(this, 1)).getAllReferences();
      }
    }
    else if (functionCallEl != null && functionCallEl.isCreateFromJavaLoader()) {
View Full Code Here

TOP

Related Classes of com.intellij.lang.ASTNode

Copyright © 2018 www.massapicom. 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.