Examples of ErlangFunction


Examples of org.erlide.engine.model.erlang.ErlangFunction

    }
    String _mod_1 = res.getMod();
    String _path_1 = res.getPath();
    String _fun_1 = res.getFun();
    int _arity = res.getArity();
    ErlangFunction _erlangFunction = new ErlangFunction(_fun_1, _arity);
    final IErlFunction result = this.modelFindService.findFunction(model, project, module, _mod_1, _path_1, _erlangFunction, scope);
    boolean _tripleNotEquals = (result != null);
    if (_tripleNotEquals) {
      return result;
    }
    String _mod_2 = res.getMod();
    String _path_2 = res.getPath();
    String _fun_2 = res.getFun();
    ErlangFunction _erlangFunction_1 = new ErlangFunction(_fun_2, ErlangFunction.ANY_ARITY);
    return this.modelFindService.findFunction(model, project, module, _mod_2, _path_2, _erlangFunction_1, scope);
  }
View Full Code Here

Examples of org.erlide.engine.model.erlang.ErlangFunction

                    final OtpErlangAtom m = (OtpErlangAtom) frame.elementAt(0);
                    final OtpErlangAtom f = (OtpErlangAtom) frame.elementAt(1);
                    final OtpErlangLong a = (OtpErlangLong) frame.elementAt(2);
                    try {
                        stackFrames.add(new ErlangUninterpretedStackFrame(m.atomValue(),
                                new ErlangFunction(f.atomValue(), a.intValue()), this,
                                getDebugTarget()));
                    } catch (final OtpErlangRangeException e) {
                        ErlLogger.error(e);
                    }
                }
View Full Code Here

Examples of org.erlide.engine.model.erlang.ErlangFunction

        moduleD.open(null);
        // when
        // looking for it with ?MODULE
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlElement element1 = modelFindService.findFunction(model, project1,
                moduleD, "?MODULE", null, new ErlangFunction("f", 0),
                IErlElementLocator.Scope.PROJECT_ONLY);
        // then
        // it should be found
        assertTrue(element1 instanceof IErlFunction);
    }
View Full Code Here

Examples of org.erlide.engine.model.erlang.ErlangFunction

        final String mName = ((StatsTreeObject) getParent()).getLabel();
        IErlModule m;
        try {
            m = ErlangEngine.getInstance().getModel().findModule(mName);
            final IErlFunction f = m.findFunction(new ErlangFunction(getLabel(),
                    getArity()));

            lineStart = f.getLineStart();
        } catch (final ErlModelException e) {
            ErlLogger.error(e);
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

    int endOffset = lastChild.getTextRange().getEndOffset();

    boolean needNewline = !(lastChild instanceof PsiWhiteSpace && StringUtil.countNewLines(lastChild.getText()) > 0);

    CaretModel caretModel = editor.getCaretModel();
    ErlangFunction function = PsiTreeUtil.getParentOfType(psiFile.findElementAt(caretModel.getOffset()), ErlangFunction.class);
    String name = function != null ? function.getName() : "name";
    caretModel.moveToOffset(endOffset);
    insertTestFunction(project, editor, name, needNewline);
  }
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

          Location location = testProxy.getLocation(project, GlobalSearchScope.allScope(project));
          PsiElement psiElement = location != null ? location.getPsiElement() : null;

          if (!(psiElement instanceof ErlangFunction)) continue;

          ErlangFunction function = (ErlangFunction) psiElement;
          String functionName = ErlangPsiImplUtil.getQualifiedFunctionName(function);
          testsToRerun.add(functionName);
        }

        configuration.getConfigData().setFunctionNames(testsToRerun);
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

    return testFiles;
  }

  @Nullable
  public static ErlangFunction getZeroArityFunction(@Nullable PsiElement psiElement) {
    ErlangFunction function = psiElement instanceof ErlangFunction ? (ErlangFunction)psiElement : PsiTreeUtil.getParentOfType(psiElement, ErlangFunction.class);
    int arity = function == null ? -1 : function.getArity();
    return 0 == arity ? function : null;
  }
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

    return locations;
  }

  @Nullable
  private static Location getTestLocation(Project project, ErlangFile file, String function, String line) {
    ErlangFunction f = ContainerUtil.getFirstItem(file.getFunctionsByName(function));
    String fileText = file.getText();
    int lineNumber = StringUtil.parseInt(line, -1);
    if (f == null) return null;
    if (lineNumber != -1) {
      lineNumber -= 1;
      if (lineNumber != StringUtil.offsetToLineNumber(fileText, f.getTextOffset())) {
        PsiElement testElement = findTestElementInLine(file, fileText, lineNumber);
        if (testElement != null) {
          return new PsiLocation<PsiElement>(project, testElement);
        }
      }
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

  }

  @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)) {
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangFunction

          @Nullable
          @Override
          public ErlangFunction fun(AbstractTestProxy testProxy) {
            Location location = testProxy.getLocation(project, GlobalSearchScope.allScope(project));
            PsiElement psiElement = location != null ? location.getPsiElement() : null;
            ErlangFunction function = psiElement instanceof ErlangFunction ? (ErlangFunction) psiElement : null;
            if (function != null && function.getArity() != 0) {
              failedGeneratedTests.add(function);
            }
            return function;
          }
        });
        Set<ErlangFile> suites = ContainerUtil.map2Set(failedTests, new Function<ErlangFunction, ErlangFile>() {
          @Nullable
          @Override
          public ErlangFile fun(ErlangFunction function) {
            PsiFile containingFile = function.getContainingFile();
            return containingFile instanceof ErlangFile ? (ErlangFile) containingFile : null;
          }
        });
        suites.remove(null);
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.