Experimental Highlight Api
@RequiresOptIn(message = "This API is part of the experimental compose-highlight surface and may change or be removed in future releases without a deprecation cycle.", level = RequiresOptIn.Level.ERROR )
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD ] )
Marks an API as experimental within the compose-highlight library.
Experimental APIs may change signature, behavior, or be removed in any future release without a deprecation cycle. They are provided for early feedback and are not yet considered stable for production use.
To use an API annotated with @ExperimentalHighlightApi, opt in at the call site:
// Opt in for a single composable or function:
@OptIn(ExperimentalHighlightApi::class)
@Composable
fun MyScreen() {
SyntaxHighlightedTextEditor(...)
}Content copied to clipboard
Or propagate the requirement to your own API:
@ExperimentalHighlightApi
@Composable
fun MyEditorScreen() {
SyntaxHighlightedTextEditor(...)
}Content copied to clipboard
To opt in for an entire file, add this to the top of the file (before the package statement):
@file:OptIn(ExperimentalHighlightApi::class)Content copied to clipboard