Class FormattingService


  • public class FormattingService
    extends java.lang.Object
    Language Service Implementation for Formatting and Range-Formatting
    Since:
    2.11
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<? extends org.eclipse.lsp4j.TextEdit> format​(Document document, org.eclipse.xtext.resource.XtextResource resource, org.eclipse.lsp4j.DocumentFormattingParams params, org.eclipse.xtext.util.CancelIndicator cancelIndicator)  
      java.util.List<? extends org.eclipse.lsp4j.TextEdit> format​(Document document, org.eclipse.xtext.resource.XtextResource resource, org.eclipse.lsp4j.DocumentRangeFormattingParams params, org.eclipse.xtext.util.CancelIndicator cancelIndicator)  
      java.util.List<org.eclipse.lsp4j.TextEdit> format​(org.eclipse.xtext.resource.XtextResource resource, Document document, int offset, int length, org.eclipse.lsp4j.FormattingOptions options)  
      protected java.util.List<org.eclipse.xtext.formatting2.regionaccess.ITextReplacement> format2​(org.eclipse.xtext.resource.XtextResource resource, org.eclipse.xtext.util.ITextRegion selection, org.eclipse.xtext.preferences.ITypedPreferenceValues preferences)  
      protected org.eclipse.lsp4j.TextEdit toTextEdit​(Document document, java.lang.String formattedText, int startOffset, int length)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormattingService

        public FormattingService()
    • Method Detail

      • format

        public java.util.List<? extends org.eclipse.lsp4j.TextEdit> format​(Document document,
                                                                           org.eclipse.xtext.resource.XtextResource resource,
                                                                           org.eclipse.lsp4j.DocumentFormattingParams params,
                                                                           org.eclipse.xtext.util.CancelIndicator cancelIndicator)
      • format

        public java.util.List<? extends org.eclipse.lsp4j.TextEdit> format​(Document document,
                                                                           org.eclipse.xtext.resource.XtextResource resource,
                                                                           org.eclipse.lsp4j.DocumentRangeFormattingParams params,
                                                                           org.eclipse.xtext.util.CancelIndicator cancelIndicator)
      • format

        public java.util.List<org.eclipse.lsp4j.TextEdit> format​(org.eclipse.xtext.resource.XtextResource resource,
                                                                 Document document,
                                                                 int offset,
                                                                 int length,
                                                                 org.eclipse.lsp4j.FormattingOptions options)
        Since:
        2.14
      • toTextEdit

        protected org.eclipse.lsp4j.TextEdit toTextEdit​(Document document,
                                                        java.lang.String formattedText,
                                                        int startOffset,
                                                        int length)
      • format2

        protected java.util.List<org.eclipse.xtext.formatting2.regionaccess.ITextReplacement> format2​(org.eclipse.xtext.resource.XtextResource resource,
                                                                                                      org.eclipse.xtext.util.ITextRegion selection,
                                                                                                      org.eclipse.xtext.preferences.ITypedPreferenceValues preferences)