Interface ITextRegionTransformer
- All Known Implementing Classes:
ITextRegionTransformer.Default
public interface ITextRegionTransformer
Representation of a transformer function that creates document
document highlight
instances form
text regions
.- Author:
- akos.kitta - Initial contribution and API
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Default text region to document highlight transformation function. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.lsp4j.DocumentHighlight
apply
(Document document, org.eclipse.xtext.util.ITextRegion region, org.eclipse.lsp4j.DocumentHighlightKind kind) Transforms thetext region
argument into adocument highlight
instance by calculating the proper position from the document.
-
Method Details
-
apply
org.eclipse.lsp4j.DocumentHighlight apply(Document document, org.eclipse.xtext.util.ITextRegion region, org.eclipse.lsp4j.DocumentHighlightKind kind) Transforms thetext region
argument into adocument highlight
instance by calculating the proper position from the document. The given kind will be used to distinguish betweenread
,write
and ordinarytext
occurrences.This conversion is required to transform the Xtext specific document relative offsets into language server specific line relative offsets.
- Parameters:
document
- the document that contains the text content. Cannot benull
.region
- the text region that has to be converted. Cannot benull
.kind
- the document highlight kind. Cannot benull
.- Returns:
- with a new transformed
document highlight
instance.
-