Package com.intellij.lang

Examples of com.intellij.lang.ASTNode


        return (NginxDirectiveName) nameNode.getPsi();
    }

    @Nullable
    public NginxContext getDirectiveContext() {
        ASTNode contextNode = getNode().findChildByType(NginxElementTypes.CONTEXT);
        return contextNode != null ? (NginxContext) contextNode.getPsi() : null;
    }
View Full Code Here


        return contextNode != null ? (NginxContext) contextNode.getPsi() : null;
    }

    @Nullable
    public NginxContext getParentContext() {
        ASTNode parentNode = getNode().getTreeParent();
        if (parentNode.getPsi() instanceof NginxContext) {
            return (NginxContext) parentNode.getPsi();
        } else {
            return null;
        }
    }
View Full Code Here

    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }
View Full Code Here

    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }
View Full Code Here

    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }
View Full Code Here

    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }
View Full Code Here

    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }
View Full Code Here

    @Nullable
    public static CssMediumList findMediumList(@Nullable PsiElement element)
    {
        while (element != null)
        {
            ASTNode node = element.getNode();
            if (node != null)
            {
                if ("CSS_MEDIA".equals(node.getElementType().toString()))
                {
                    return PsiTreeUtil.getChildOfType(element, CssMediumList.class);
                }
            }
            element = element.getParent();
View Full Code Here

    replaceStatement = elements[0].getParent().addBefore(replaceStatement, elements[0]);
    replaceStatement.getParent().addBefore(newLineNode, replaceStatement);

    function.getParent().addAfter(newLineNode, function);

    final ASTNode nextChild = replaceStatement.getNode().getTreeNext();
    replaceStatement.getParent().getNode().addLeaf(DartTokenTypes.SEMICOLON, ";", nextChild);

    elements[0].getParent().deleteChildRange(elements[0], elements[elements.length - 1]);

    PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
View Full Code Here

      return null;
    }

    final IElementType elementType = myNode.getElementType();
    final IElementType parentType = myNode.getTreeParent() == null ? null : myNode.getTreeParent().getElementType();
    final ASTNode node1 = ((AbstractBlock)child1).getNode();
    final IElementType type1 = node1.getElementType();
    final ASTNode node2 = ((AbstractBlock)child2).getNode();
    final IElementType type2 = node2.getElementType();

    if (AT == type1) return Spacing.createSpacing(0, 0, 0, false, 0);
    if (METADATA == type1) return Spacing.createSpacing(1, 1, 0, true, 0);

    if (FUNCTION_DEFINITION.contains(type2)) {
      final int lineFeeds = COMMENTS.contains(type1) ? 1 : 2;
      return Spacing.createSpacing(0, 0, lineFeeds, false, mySettings.KEEP_BLANK_LINES_IN_CODE);
    }
    if (DOC_COMMENT_CONTENTS.contains(type2)) {
      return Spacing.createSpacing(0, Integer.MAX_VALUE, 0, true, mySettings.KEEP_BLANK_LINES_IN_CODE);
    }
    if (type2 != SEMICOLON && BLOCKS.contains(elementType)) {
      boolean topLevel = elementType == DART_FILE || elementType == EMBEDDED_CONTENT;
      int lineFeeds = 1;
      if (!COMMENTS.contains(type1) && (elementType == CLASS_MEMBERS || topLevel && DECLARATIONS.contains(type2))) {
        if (type1 == SEMICOLON && type2 == VAR_DECLARATION_LIST) {
          final ASTNode node1TreePrev = node1.getTreePrev();
          if (node1TreePrev == null || node1TreePrev.getElementType() != VAR_DECLARATION_LIST) {
            lineFeeds = 2;
          }
        }
        else {
          lineFeeds = 2;
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.