highlightRanges method
List<StyledRange>
highlightRanges(
- String code, {
- required String language,
- required SyntaxTheme theme,
Styled ranges over the whole of code, as UTF-16 offsets into it:
the shape renderers that style one string at a time want. To
re-highlight as the code changes, keep a TokenizedDocument instead.
Implementation
List<StyledRange> highlightRanges(
String code, {
required String language,
required SyntaxTheme theme,
}) => (TokenizedDocument(grammar(language))..update(code)).ranges(theme);