KaRenderer¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaRenderer
Renders Analysis API entities such as KaSymbols or KaTypes into a KaRenderingOutput as human-readable, Kotlin-like text.
A renderer is an immutable bundle of KaPieceRenderers (a stack per KaPiece) together with KaRenderingOption values. You can obtain the standard renderer via default and derive customized variants with copy.
Types¶
Companion¶
object Companion
Functions¶
copy¶
abstract fun copy(block: KaRendererBuilder.() -> Unit): KaRenderer
Returns a copy of this renderer with the customizations applied by block (overriding KaRenderingOptions or pushing additional KaPieceRenderers). This renderer is left unchanged.
The resulting renderer may call the block on-demand. Never rely on exact timing of its call, and keep the block free of side effects.
render¶
render¶
context(session: KaSession)
fun KaRenderer.render(symbol: KaSymbol, output: KaRenderingOutput)
context(session: KaSession)
fun KaRenderer.render(type: KaType, output: KaRenderingOutput)
renderToString¶
context(session: KaSession)
fun KaRenderer.renderToString(symbol: KaSymbol): @NlsSafe String
Renders the symbol into a string.
context(session: KaSession)
fun KaRenderer.renderToString(type: KaType): @NlsSafe String
Renders the type into a string.