[][src]Module syntect::highlighting

Everything having to do with turning parsed text into styled text. You might want to check out Theme for its handy text-editor related settings like selection color, ThemeSet for loading themes, as well as things starting with Highlight for how to highlight text.

Structs

Color

RGBA color, these numbers come directly from the theme so for now you might have to do your own color space conversion if you are outputting a different color space from the theme. This can be a problem because some Sublime themes use sRGB and some don't. This is specified in an attribute syntect doesn't parse yet.

FontStyle

This can be a combination of BOLD, UNDERLINE and ITALIC

HighlightIterator

Highlights a line of parsed code given a HighlightState and line of changes from the parser. This is a backwards compatible shim on top of the RangedHighlightIterator which only yields the Style and the Text of the token, not the range.

HighlightState

Keeps a stack of scopes and styles as state between highlighting different lines. If you are highlighting an entire file you create one of these at the start and use it all the way to the end.

Highlighter

Basically a wrapper around a Theme preparing it to be used for highlighting. This is part of the API to preserve the possibility of caching matches of the selectors of the theme on various scope paths or setting up some kind of accelerator structure.

RangedHighlightIterator

Highlights a line of parsed code given a HighlightState and line of changes from the parser. Yields the Style, the text as well as the Range of the text in the source string.

ScopeSelector

A single selector consisting of a stack to match and a possible stack to exclude from being matched. You probably want ScopeSelectors which is this but with union support.

ScopeSelectors

A selector set that matches anything matched by any of its component selectors. See The TextMate Docs for how these work.

ScoredStyle
Style

The foreground, background and font style

StyleModifier

A change to a Style applied incrementally by a theme rule.

Theme

A theme parsed from a .tmTheme file. Contains fields useful for a theme list as well as settings for styling your editor.

ThemeItem

A component of a theme meant to highlight a specific thing (e.g string literals) in a certain way.

ThemeSet
ThemeSettings

Various properties meant to be used to style a text editor. Basically all the styles that aren't directly applied to text like selection color. Use this to make your editor UI match the highlighted text.

Enums

ParseThemeError
SettingsError

An error parsing a settings file

UnderlineOption