Examples of HashSLCommentContainer


Examples of com.puppetlabs.xtext.dommodel.formatter.comments.ICommentContainerInformation.HashSLCommentContainer

          String issueString = xtextDocument.get(issue.getOffset(), issue.getLength());
          final boolean endsWithBreak = issue.getData() != null && issue.getData().length == 1 &&
              "true".equals(issue.getData()[0]);
          CommentProcessor commentProcessor = new CommentProcessor();
          JavaLikeMLCommentContainer mlContainer = new ICommentContainerInformation.JavaLikeMLCommentContainer();
          HashSLCommentContainer hashContainer = new ICommentContainerInformation.HashSLCommentContainer();
          int offsetOfNode = issue.getOffset();

          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));

          if(!endsWithBreak)
            result.appendBreak();
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.