Skip to content

KotlinStringLiteralTextEscaper

A LiteralTextEscaper for Kotlin string literals, enabling language injection into them.

It decodes the raw literal text of a KtStringTemplateExpression into the string value it denotes (resolving escape sequences) and maintains a mapping between offsets in the decoded value and offsets in the host PSI, so that an injected language can be edited and its ranges translated back to the original source.

Constructors

KotlinStringLiteralTextEscaper

constructor(host: KtStringTemplateExpression)

Properties

isOneLine

open override fun isOneLine(): Boolean
open override val isOneLine: Boolean

relevantTextRange

open override val relevantTextRange: TextRange

Functions

decode

open override fun decode(rangeInsideHost: TextRange, outChars: StringBuilder): Boolean

getOffsetInHost

open override fun getOffsetInHost(offsetInDecoded: Int, rangeInsideHost: TextRange): Int

getRelevantTextRange

open override fun getRelevantTextRange(): TextRange