Interface ISyntaxHighlighter
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Provides syntax highlighting by tokenizing source lines into colored spans. Implement this interface to provide custom syntax coloring for specific languages or formats.
public interface ISyntaxHighlighter
- Extension Methods
Methods
Tokenize(string, int, SyntaxLineState)
Tokenizes a source line given the parse state at its start.
Returns the token list and the parser state at the end of the line
(to be passed as startState for the next line).
(IReadOnlyList<SyntaxToken> Tokens, SyntaxLineState EndState) Tokenize(string line, int lineIndex, SyntaxLineState startState)
Parameters
linestringThe source line text to tokenize.
lineIndexintThe zero-based line index within the document.
startStateSyntaxLineStateThe parser state at the start of this line.