Examples of ErlangSpecification


Examples of org.intellij.erlang.psi.ErlangSpecification

  @Nullable
  @Override
  public String getDocText() {
    ErlangFunction prevFunction = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, ErlangFunction.class);
    ErlangSpecification spec = ErlangPsiImplUtil.getSpecification(myErlangFunction);
    PsiComment comment = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, PsiComment.class);

    String commentText = "";
    if (spec != null && ErlangPsiImplUtil.notFromPreviousFunction(spec, prevFunction)) {
      commentText += spec.getText().replaceFirst("spec", "<b>Specification:</b><br/>") + "<br/><br/>";
    }
    if (comment != null && comment.getTokenType() == ErlangParserDefinition.ERL_FUNCTION_DOC_COMMENT &&
      ErlangPsiImplUtil.notFromPreviousFunction(comment, prevFunction)) {
      commentText += "<b>Comment:</b><br/>" + ErlangDocUtil.getCommentsText(
        ErlangDocUtil.collectPrevComments(comment), "%%", ErlangDocUtil.EDOC_FUNCTION_TAGS);
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangSpecification

  @Nullable
  @Override
  public Collection<PsiElement> getAdditionalElementsToDelete(PsiElement element, Collection<PsiElement> allElementsToDelete, boolean askUser) {
    if (element instanceof ErlangFunction) {
      ErlangSpecification specification = ErlangPsiImplUtil.getSpecification((ErlangFunction) element);
      if (specification != null) {
        return ContainerUtil.newSmartList(specification.getParent());
      }
    }
    return null;
  }
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangSpecification

  @Override
  public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
    ErlangFunction function = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), ErlangFunction.class);
    if (function != null) {
      ErlangSpecification specification = ErlangPsiImplUtil.getSpecification(function);
      if (specification != null) {
        specification.getParent().delete();
      }
      function.delete();
    }
  }
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.