Examples of formatComment()


Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

      new ICommentFormatterAdvice.DefaultCommentAdvice(), 80);
    JavaLikeMLCommentContainer in = new ICommentContainerInformation.JavaLikeMLCommentContainer(0);
    CommentProcessor cp = new CommentProcessor();
    String source = "/* the\nquick\n     *brown\n * fox\n   \n\n*/ ";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    String expected = "/* the\n * quick\n * brown\n * fox\n */ ";
    assertEquals("Should produce expected result", expected, s.getText().toString());
  }

  @Test
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

        + " * 0123456789 0123456789\n * 0123456789 0123456789\n"//
        + " * abc\n" //
        + " * 0123456789 0123456789\n * 0123456789 0123456789\n"//
        + " */";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    assertEquals("Should produce expected result", expected, s.getText().toString());
  }

  @Test
  public void test_CommentProcessor_folding() {
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

        + " * abc\n" //
        + " * 0123456789 0123456789\n * 0123456789 0123456789\n"//
        + " */";

    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    assertEquals("Should produce expected result", expected, s.getText().toString());
  }

  @Test
  public void test_CommentProcessor_folding_indent() {
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

    "/*   0123456789 0123456789\n *   0123456789 0123456789\n"//
        + " * abc\n" //
        + " * 0123456789 0123456789\n * 0123456789 0123456789\n"//
        + " */";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    assertEquals("Should produce expected result", expected, s.getText().toString());
  }

  @Test
  public void test_CommentProcessor_Indented() {
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

    CommentProcessor cp = new CommentProcessor();
    CommentFormattingOptions options = new CommentFormattingOptions(
      new ICommentFormatterAdvice.DefaultCommentAdvice(), 80);
    String source = "/* the\n  quick\n       *brown\n   * fox\n     \n  \n  */ ";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    // pad expected and result with 2 spaces to emulate the inserting of the result
    // (makes comparison look nicer if test fails)
    String expected = "  /* the\n   * quick\n   * brown\n   * fox\n   */ ";
    assertEquals("Should produce expected result", expected, "  " + CharSequences.trimLeft(s.getText()).toString());
  }
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.formatComment()

              Math.max(0, 1 + CharSequences.lastIndexOf(
                xtextDocument.get(0, xtextDocument.getLength()), "\n", offsetOfNode - 1));

          CommentText commentText = commentProcessor.separateCommentFromContainer(
            issueString, mlContainer.create(posOnLine), "\n");
          TextFlow result = commentProcessor.formatComment(
            commentText, hashContainer.create(posOnLine), new CommentFormattingOptions(
              commentConfigurationProvider.get().getFormatterAdvice(CommentType.SingleLine),
              Integer.MAX_VALUE, 0, 1), formattingContextFactory.create(state, FormattingOption.Format));

          if(!endsWithBreak)
View Full Code Here

Examples of org.wikipediacleaner.api.constants.EnumWikipedia.formatComment()

    }
    API api = APIFactory.getAPI();
    try {
      EnumWikipedia wiki = page.getWikipedia();
      api.deletePage(
          wiki, page, wiki.formatComment(reason.trim(), false));
      if (listener != null) {
        listener.pageDeleted(page.getTitle());
      }
    } catch (APIException ex) {
      Utilities.displayError(parent, ex);
View Full Code Here

Examples of org.wikipediacleaner.api.constants.EnumWikipedia.formatComment()

                newText.append("\n");
                newText.append(buffer.toString());
                newText.append(contents.substring(end));
                api.updatePage(
                    wiki, page, newText.toString(),
                    wiki.formatComment(
                        config.getString(WPCConfigurationString.ISBN_ERRORS_PAGE_COMMENT),
                        true),
                    false);
                saved = true;
              }
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.