Skip to content

feat(highlight): add javascript and typescript parser for jsx and tsx…#12212

Open
mmfallacy wants to merge 1 commit intoanomalyco:devfrom
mmfallacy:tsx-parser
Open

feat(highlight): add javascript and typescript parser for jsx and tsx…#12212
mmfallacy wants to merge 1 commit intoanomalyco:devfrom
mmfallacy:tsx-parser

Conversation

@mmfallacy
Copy link

packages/opencode/parser-config.ts

Closes #12211

What does this PR do?

Adds syntax highlighting to jsx and tsx code blocks within markdown by adding JSX and TSX parsers to parser-config.ts.

How did you verify your code works?

Ran bun dev with a session that outputs jsx and tsx code blocks.

Before:
image
image

After:
image
image

Remarks

Remarks:

  • tree-sitter-javascript.wasm seems to be able to handle jsx
  • tree-sitter-typescript highlights seems incomplete
  • Maybe it's better to map tsx and jsx to markdown's infoMapString within @opentui/core.

jsx and tsx files seem to be highlighted when part of Write tool output, so this might be only an issue for markdown-injected jsx and tsx.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: JSX and TSX syntax highlighting for markdown-injected

1 participant