Package com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor

Examples of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.CommentText


      ICommentContainerInformation in = (nodes.size() == 1 && nodes.get(0).getGrammarElement() == ga.getML_COMMENTRule())
          ? commentConfiguration.getContainerInformation(CommentType.Multiline)
          : (commentConfiguration.getContainerInformation(CommentType.SingleLine));

      CommentProcessor cpr = new CommentProcessor();
      CommentText comment = cpr.separateCommentFromContainer(result, in, "\n"); // TODO: cheating on line separator
      return new RubyDocProcessor().asHTML(comment.getLines());

    }
    return null;
  }
View Full Code Here


    final int maxTrailing = 1;

    // set up extraction context (use 0 if there was no INode model)
    ICommentContainerInformation in = commentContext.create(Math.max(0, pos));
    CommentProcessor cpr = new CommentProcessor();
    CommentText comment = cpr.separateCommentFromContainer(textOfNodes(nodes), in, lineSeparator);

    // format in position 0 to measure it
    TextFlow formatted = cpr.formatComment(comment, pos0Context, new CommentFormattingOptions(
      advice, Integer.MAX_VALUE, trailing, maxTrailing), layoutContext);
    int w = formatted.getWidth();
View Full Code Here

          int posOnLine = offsetOfNode -
              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));
View Full Code Here

TOP

Related Classes of com.puppetlabs.xtext.dommodel.formatter.comments.CommentProcessor.CommentText

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.