Skip to content

highlightIter cannot enable rainbow brackets #1096

Description

@leandrocp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions