Skip to content

Allow applications to replace the default tree-sitter parser set #1434

Description

@billyvg

OpenTUI currently registers JavaScript, TypeScript, Markdown, Markdown Inline, and Zig unconditionally. addDefaultParsers can add or replace a parser with the same filetype, but an application cannot remove defaults it never uses. The Bun asset-loader table also statically imports every default grammar, so those WASM files remain in compiled binaries.

Would you accept an API that replaces or filters the defaults before the shared TreeSitterClient initializes? A renderer option or a setDefaultParsers function would work, provided omitted grammar assets are not statically bundled.

sentry-tui uses CodeRenderable only for Sentry stack-frame context. It needs JavaScript, TypeScript, Python, Ruby, PHP, and Go, but never Zig or Markdown; the current fixed set both omits production languages and adds avoidable binary weight. Context: billyvg/sentry-tui#93

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