Skip to content

Tokens includeExplanation typings mismatch #509

@ChcJohnie

Description

@ChcJohnie

Description

While trying to optimize performance of great shiki we encountered confusing typings.
ThemedTokenizer and types both states default of false for includeExplanation options.
But highlighter.codeToThemeTokens is overriding includeExplanation default to true, while being typed with mentioned default false thus being wrongly docummented while accessed in code.

Expected behaviour

Either codeToThemeTokens having includeExplanation: false default (would make sense, its performance save was mindblowing), or fixing types to have correct typing (different defaults) for both ThemedTokenizer and highlighter.codeToThemeTokens (eg. for compatibility reasons I can see).

Guess should be quick change, but does not feel aligned with project enough to pick solution myself and create PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions