Class ITextRegionTransformer.Default

  • All Implemented Interfaces:
    ITextRegionTransformer
    Enclosing interface:
    ITextRegionTransformer

    public static final class ITextRegionTransformer.Default
    extends java.lang.Object
    implements ITextRegionTransformer
    Default text region to document highlight transformation function. Works only with ITextRegionWithLineInformation instances.
    • Constructor Summary

      Constructors 
      Constructor Description
      Default()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.lsp4j.DocumentHighlight apply​(Document document, org.eclipse.xtext.util.ITextRegion region, org.eclipse.lsp4j.DocumentHighlightKind kind)
      Transforms the text region argument into a document highlight instance by calculating the proper position from the document.
      • Methods inherited from class java.lang.Object

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

      • Default

        public Default()
    • Method Detail

      • apply

        public org.eclipse.lsp4j.DocumentHighlight apply​(Document document,
                                                         org.eclipse.xtext.util.ITextRegion region,
                                                         org.eclipse.lsp4j.DocumentHighlightKind kind)
        Description copied from interface: ITextRegionTransformer
        Transforms the text region argument into a document highlight instance by calculating the proper position from the document. The given kind will be used to distinguish between read, write and ordinary text occurrences.

        This conversion is required to transform the Xtext specific document relative offsets into language server specific line relative offsets.

        Specified by:
        apply in interface ITextRegionTransformer
        Parameters:
        document - the document that contains the text content. Cannot be null.
        region - the text region that has to be converted. Cannot be null.
        kind - the document highlight kind. Cannot be null.
        Returns:
        with a new transformed document highlight instance.