Interface CodeHighlighter

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.