Package org.intellij.erlang.psi

Examples of org.intellij.erlang.psi.ErlangFunTypeSigs


  @Override
  protected void checkFile(@NotNull ErlangFile file, @NotNull final ProblemsHolder problemsHolder) {
    for (ErlangSpecification spec : file.getSpecifications()) {
      //supported functions without modules only for now
      ErlangFunTypeSigs signature = spec.getSignature();
      if (signature != null) {
        PsiReference reference = signature.getReference();
        if (reference != null && reference.resolve() == null) {
          problemsHolder.registerProblem(spec, "Specification for undefined function '" + signature.getSpecFun().getText() + "'");
        }
      }
    }
  }
View Full Code Here


public class ErlangIncorrectAritySpecificationInspection extends ErlangInspectionBase {
  @Override
  protected void checkFile(@NotNull ErlangFile file, @NotNull ProblemsHolder problemsHolder) {
    for (ErlangSpecification spec : file.getSpecifications()) {
      ErlangFunTypeSigs signature = spec.getSignature();
      PsiElement psiArity = signature != null ? signature.getSpecFun().getInteger() : null;
      int arity = psiArity != null ? ErlangPsiImplUtil.getArity(psiArity) : -1;
      if (arity != -1) {
        for (ErlangTypeSig typeSig : signature.getTypeSigList()) {
          if (typeSig.getFunType().getFunTypeArguments().getTopTypeList().size() != arity) {
            problemsHolder.registerProblem(spec, "Specification has the wrong arity '" + signature.getSpecFun().getText() + "'");
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.intellij.erlang.psi.ErlangFunTypeSigs

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.