Package com.intellij.psi

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


      final PsiElement toAdd = DartElementGenerator.createTopLevelStatementFromText(file.getProject(), "import '" + urlToImport + "';");
      if (toAdd != null) {
        final PsiElement anchor = findAnchorForImportStatement(file, importStatements);
        if (anchor == null) {
          final PsiElement child = file.getFirstChild();
          file.addBefore(toAdd, child);
          if (!(child instanceof PsiWhiteSpace)) {
            file.getNode().addLeaf(DartTokenTypesSets.WHITE_SPACE, "\n", child.getNode());
          }
        }
        else {
View Full Code Here


        }
      }
      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) containingFile);

      if (elementBefore != null) {
        containingFile.addBefore(ErlangElementFactory.createExportFromText(project, exportText), elementBefore);
        containingFile.addBefore(ErlangElementFactory.createLeafFromText(project, "\n\n"), elementBefore);
      }
    }
  }
}
View Full Code Here

      }
      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) containingFile);

      if (elementBefore != null) {
        containingFile.addBefore(ErlangElementFactory.createExportFromText(project, exportText), elementBefore);
        containingFile.addBefore(ErlangElementFactory.createLeafFromText(project, "\n\n"), elementBefore);
      }
    }
  }
}
View Full Code Here

        }
      }
      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) containingFile);

      if (elementBefore != null) {
        containingFile.addBefore(ErlangElementFactory.createExportTypeFromText(project, exportText), elementBefore);
        containingFile.addBefore(ErlangElementFactory.createLeafFromText(project, "\n\n"), elementBefore);
      }
    }
  }
}
View Full Code Here

      }
      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) containingFile);

      if (elementBefore != null) {
        containingFile.addBefore(ErlangElementFactory.createExportTypeFromText(project, exportText), elementBefore);
        containingFile.addBefore(ErlangElementFactory.createLeafFromText(project, "\n\n"), elementBefore);
      }
    }
  }
}
View Full Code Here

    if (file instanceof ErlangFile) {
      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) file);

      if (elementBefore != null) {
        file.addBefore(record, elementBefore);
        String newLines = elementBefore instanceof ErlangRecordDefinition ? "\n" : "\n\n";
        file.addBefore(ErlangElementFactory.createLeafFromText(project, newLines), elementBefore);
      }
    }
  }
View Full Code Here

      ErlangCompositeElement elementBefore = getAnchorElement((ErlangFile) file);

      if (elementBefore != null) {
        file.addBefore(record, elementBefore);
        String newLines = elementBefore instanceof ErlangRecordDefinition ? "\n" : "\n\n";
        file.addBefore(ErlangElementFactory.createLeafFromText(project, newLines), elementBefore);
      }
    }
  }

  private static List<String> getFieldNames(@NotNull ErlangRecordRef recordRef) {
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.