Examples of ErlangExpression


Examples of org.intellij.erlang.psi.ErlangExpression

    String oldConfigText = oldConfig.exists() ? new String(FileUtil.loadFileText(oldConfig)) : "";
    ErlangFile configPsi = (ErlangFile) PsiFileFactory.getInstance(myConfiguration.getProject())
      .createFileFromText(CONFIG_FILE_NAME, ErlangFileType.TERMS, oldConfigText);
    List<ErlangTupleExpression> eunitOptsSections = ErlangTermFileUtil.getConfigSections(configPsi, "eunit_opts");
    if (eunitOptsSections.isEmpty()) {
      ErlangExpression form = ErlangTermFileUtil.createForm(EUNIT_OPTS);
      assert form != null;
      configPsi.add(form);
    } else {
      removeReportOptions(eunitOptsSections);
      addEunitTeamcityReportOptions(eunitOptsSections.get(0));
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangExpression

        ErlangTermFileUtil.deleteListExpressionItem(erlangTupleExpression);
        return true;
      }
    };
    for (ErlangTupleExpression eunitOptsSection : eunitOptsSections) {
      ErlangExpression eunitOptsList = eunitOptsSection.getExpressionList().get(1);
      ContainerUtil.process(ErlangTermFileUtil.getConfigSections(eunitOptsList, "report"), deletingProcessor);
      ContainerUtil.process(ErlangTermFileUtil.getConfigSections(eunitOptsList, "no_tty"), deletingProcessor);
    }
  }
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangExpression

      ContainerUtil.process(ErlangTermFileUtil.getConfigSections(eunitOptsList, "no_tty"), deletingProcessor);
    }
  }

  private void addEunitTeamcityReportOptions(ErlangTupleExpression eunitOptsTuple) throws IOException {
    ErlangExpression eunitOptsList = eunitOptsTuple.getExpressionList().get(1);
    if (!(eunitOptsList instanceof ErlangListExpression)) {
      throw new IOException("Invalid rebar.config file");
    }
    ErlangTermFileUtil.addListExpressionItem((ErlangListExpression) eunitOptsList, createExpression(EUNIT_TEAMCITY_REPORTER));
    ErlangTermFileUtil.addListExpressionItem((ErlangListExpression) eunitOptsList, createExpression(EUNIT_NO_TTY_OPTION));
View Full Code Here

Examples of org.intellij.erlang.psi.ErlangExpression

  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
    List<TextRange> select = super.select(e, editorText, cursorOffset, editor);
    PsiElement clause = e.getParent();
    if (clause instanceof ErlangClauseBody) {
      List<ErlangExpression> list = ((ErlangClauseBody) clause).getExpressionList();
      ErlangExpression first = ContainerUtil.getFirstItem(list);
      ErlangExpression last = ContainerUtil.getLastItem(list);

      if (first != null && last != null) {
        TextRange allExpressionsRange = TextRange.create(first.getTextRange().getStartOffset(), last.getTextRange().getEndOffset());
        return ContainerUtil.concat(select, expandToWholeLine(editorText, allExpressionsRange, false));
      }
    }
    return select;
  }
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.