Custom formatters using the flat iterator cannot enable rainbow brackets.
JavaScript highlightIter and Rust highlight_iter expose no rainbow-bracket option, so callbacks only receive punctuation.bracket. Built-in formatters avoid this limitation by using the event API with options.
In JavaScript, the current workaround is highlightEvents(source, language, { rainbowBrackets: true }) followed by manually flattening the event stream.
Expected: flat iterator users can opt into the same rainbow bracket scopes available to built-in formatters.
Custom formatters using the flat iterator cannot enable rainbow brackets.
JavaScript
highlightIterand Rusthighlight_iterexpose no rainbow-bracket option, so callbacks only receivepunctuation.bracket. Built-in formatters avoid this limitation by using the event API with options.In JavaScript, the current workaround is
highlightEvents(source, language, { rainbowBrackets: true })followed by manually flattening the event stream.Expected: flat iterator users can opt into the same rainbow bracket scopes available to built-in formatters.