Module syntect::highlighting [] [src]

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 colour, ThemeSet for loading themes, as well as things starting with Highlight for how to highlight text.

Structs

Color

RGBA colour, these numbers come directly from the theme so for now you might have to do your own colour space conversion if you are outputting a different colour 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 FONT_STYLE_BOLD, FONT_STYLE_UNDERLINE and FONT_STYLE_ITALIC

HighlightIterator

Highlights a line of parsed code given a HighlightState and line of changes from the parser.

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.

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.

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 colour. Use this to make your editor UI match the highlighted text.

Enums

ParseThemeError
SettingsError

An error parsing a settings file

UnderlineOption

Constants

BLACK

Pre-defined convenience colour

FONT_STYLE_BOLD

A bitfield constant FontStyle

FONT_STYLE_ITALIC

A bitfield constant FontStyle

FONT_STYLE_UNDERLINE

A bitfield constant FontStyle

WHITE

Pre-defined convenience colour