LanguageDataKey

class LanguageDataKey<T>(val name: String)

A type-safe key for language data fields.

Language data is associated with positions in the document via the languageData facet. Each provider returns a map of string keys to values. LanguageDataKey wraps a string name and provides type safety when looking up values with EditorState.languageDataAt.

Standard keys are defined in LanguageDataKey.Companion. Custom keys can be created with LanguageDataKey("myKey").

Parameters

name

The string name used as the map key in provider results.

Type Parameters

T

The type of value this key maps to.

Constructors

Link copied to clipboard
constructor(name: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
infix fun of(value: T): LanguageDataEntry<T>

A type-safe entry pairing a LanguageDataKey with its value.

Link copied to clipboard
open override fun toString(): String