Overhaul CodeBlock rendering#3019
Conversation
🦋 Changeset detectedLatest commit: dda3132 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The pull request is quite large, with significant changes across multiple files. It might be beneficial to split the changes into smaller, more focused pull requests. Here are some suggestions:
Please consider splitting the pull request to improve reviewability and maintain focus on specific changes. Let me know if you need further assistance! |
|
thanks! I am working on a follow up PR for terminal syntax highlight |
Overview
Note: This work was done by @KJ7LNW - I just fixed the latest merge conflicts related to the recent terminal handling PR.
This is a port of cline/cline#1583 to RooCode, plus new features:
This PR has become pretty mature, please give it a try.
Summary of CodeBlock Features
Summary of Shiki Features
github-darkorgithub-lightdepending on whether the vscode theme contains the word "light" (close/reopen the Roo task if you change your VSCode theme).Testing
Latest test build:
Here is a good test instruction:
How to Test
New Screenshots
Older Screenshots
These were taken earlier in development, before the expand/collapse and word-wrap widgets were added:
Code
Notice that the current syntax highlight Rehype (left) is not recognizing syntax like regular expression symbols or nested
var = "${variables} in strings"--- but Shiki does this really well (right, this PR).Shell
Shiki also provides beautiful shell markup:
More examples:
Current Rehype (left) - Shiki (right, this PR)

Get in Touch
If you have any questions or feedback, please reach out on the Roo Code Discord.
My Discord handle is KJ7LNW.
Important
Overhaul
CodeBlockrendering with new features, Shiki integration for syntax highlighting, and build updates for WebAssembly support.CodeBlock.tsx.highlighter.ts.github-darkorgithub-lightbased on VSCode theme.vite.config.tsto include a WebAssembly plugin for Shiki.shikiand related dependencies from optimization invite.config.ts.CodeBlockinCodeBlock.test.tsx.package.jsonto includeshikiand adjust dependencies.This description was created by
for 1117500926889242a2fc63f1d102b1b9cf78e864. It will automatically update as commits are pushed.