Skip to content



The tokenisation and syntax manipulation of text within the code editor is handled by formatters. A formatter is a class that implements this interface. In theory, the code editor can handle the styling of any language with the appropriate formatter.


Name Parameters Returns
AllowsLeadingWhitespace Boolean
IsCommentLine line As XUICELine Boolean
Name String
NearestDelimitersForCaretPos caretPos As Integer XUICEDelimiter
Parse lines() As XUICELine
SupportsDelimiterHighlighting Boolean
SupportsUnmatchedBlockHighlighting Boolean
TokenIsComment token As XUICELineToken Boolean
Tokenise lines() As XUICELine, firstVisibleLineNumber As Integer, lastVisibleLineNumber As Integer
TokeniseAll lines() As XUICELine
TokenTypes String()

Method Descriptions

AllowsLeadingWhitespace() As Boolean True if this formatter allows whitespace at the beginning of a line. If False, the editor will strip it when pasting and prevent it from being typed.

IsCommentLine(line As XUICELine) As Boolean True if this entire line is a comment.

Name() As String The name of this formatter.

NearestDelimitersForCaretPos(caretPos As Integer) As XUICEDelimiter Returns the nearest delimiters at the given caretPos. May be Nil.

Parse(lines() As XUICELine) Called periodically by the editor. An opportunity to parse the tokenised lines. Will always be called after the lines have been tokenised.

SupportsDelimiterHighlighting() As Boolean True if this formatter supports highlighting the delimiters around the caret.

SupportsUnmatchedBlockHighlighting() As Boolean True if this formatter highlights unmatched blocks.

TokenIsComment(token As XUICELineToken) As Boolean True if token is considered to be a comment.

Tokenise(lines() As XUICELine, firstVisibleLineNumber As Integer, lastVisibleLineNumber As Integer) Tokenises a portion of an array of lines.

TokeniseAll(lines() As XUICELine) Tokenises an array of lines.

TokenTypes() As String() Returns an array of all token types used by this formatter.