Interface CodeHighlighter
-
- All Implemented Interfaces:
public interface CodeHighlighter
-
-
Method Summary
-
-
Method Detail
-
highlight
abstract <Error class: unknown class><<Error class: unknown class>> highlight(String code, MimeType mimeType)
Highlights code according to rules for the language specified by mimeType, and returns flow of styled strings. For basic highlighters with rigid color schemes it is enough to return a flow of one element:
return flowOf(highlightedString(code, mimeType))However, some implementations might want gradual highlighting (for example, apply something simple while waiting for the extensive info from server), or they might rely upon a color scheme that can change at any time.
In such cases, they need to produce more than one styled string for the same piece of code, and that's when flows come in handy.
-
-
-
-