Package com.intellij.psi

Examples of com.intellij.psi.PsiElement.addBefore()


                                               List<PsiElement> occurrences,
                                               boolean replaceAll) {
    PsiElement anchor = replaceAll ? findAnchor(occurrences) : findAnchor(expression);
    assert anchor != null;
    final PsiElement parent = anchor.getParent();
    return parent.addBefore(declaration, anchor);
  }
}
View Full Code Here


  private static PsiElement addDeclaration(@NotNull PsiElement declaration, @NotNull List<PsiElement> occurrences) {
    PsiElement anchor = findAnchor(occurrences);
    assert anchor != null;
    PsiElement parent = anchor.getParent();
    return parent.addBefore(declaration, anchor);
  }

  @Nullable
  private static PsiElement replaceLeftmostArgumentDefinition(@NotNull PsiElement declaration, @NotNull List<PsiElement> occurrences) {
    PsiElement argDef = extractLeftmostArgumentDefinition(occurrences);
View Full Code Here

            PsiElement added = functionParent.addAfter(newFunction, function);
            functionParent.addBefore(newLine(), added);
            functionParent.addAfter(newLine(),  function);

            PsiElement parent = first.getParent();
            parent.addBefore(ErlangElementFactory.createExpressionFromText(getProject(), bindingsS + signature), first);
            parent.deleteChildRange(first, last);
          }

          private PsiElement newLine() {
            return ErlangElementFactory.createLeafFromText(project, "\n");
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.