Skip to content

🤖 fix: restore starlark code block highlighting#3187

Merged
coadler merged 1 commit intomainfrom
fix/shiki-starlark-highlighting
Apr 23, 2026
Merged

🤖 fix: restore starlark code block highlighting#3187
coadler merged 1 commit intomainfrom
fix/shiki-starlark-highlighting

Conversation

@coadler
Copy link
Copy Markdown
Collaborator

@coadler coadler commented Apr 23, 2026

Summary

Use a shared Shiki language fallback so Starlark/Bazel fenced code blocks stay highlighted instead of logging an unsupported-language warning and falling back to plain text.

Background

Closes #3117. The shipped Shiki bundle does not include a native starlark grammar, so attempting to highlight those fences throws at runtime.

Implementation

  • map starlark, bazel, and bzl to Python in the shared Shiki language mapper
  • reuse that shared mapper in the highlight worker instead of maintaining a duplicate copy
  • add a regression test for the fallback mapping

Validation

  • bun test src/browser/utils/highlighting/shiki-shared.test.ts
  • make typecheck
  • make lint
  • make static-check

Risks

Low. This only changes how unsupported Bazel/Starlark fences are mapped for syntax highlighting, and it keeps the existing plain-text fallback if highlighting still fails for another reason.


Generated with mux • Model: openai:gpt-5.4 • Thinking: xhigh • Cost: $0.00

Map unsupported Starlark/Bazel fence names to Python so Shiki keeps
highlighting those code blocks instead of warning and falling back to plain
text. Also reuse the shared language mapping in the highlight worker.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=0.00 -->
@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented Apr 23, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coadler coadler enabled auto-merge April 23, 2026 17:59
@coadler coadler added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 23, 2026
@coadler coadler added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 9d449a6 Apr 23, 2026
23 checks passed
@coadler coadler deleted the fix/shiki-starlark-highlighting branch April 23, 2026 18:35
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.

Missing starlark highlighting in shiki

1 participant