Skip to content

Conversation

@CasualDeveloper
Copy link

Adds three optional theme tokens for XML/HTML syntax highlighting:

  • syntaxTag - tag names (fallback: error)
  • syntaxAttribute - attributes (fallback: syntaxKeyword)
  • syntaxTagDelimiter - < > / (fallback: syntaxOperator)

Closes #6128

Copilot AI review requested due to automatic review settings December 24, 2025 21:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds three optional theme tokens for XML/HTML syntax highlighting, allowing custom themes to independently control tag colors instead of inheriting from unrelated tokens. The implementation maintains backward compatibility by providing fallbacks to the original hardcoded color mappings.

  • Added syntaxTag, syntaxAttribute, and syntaxTagDelimiter as optional theme tokens
  • Updated type definitions to support the new tokens with proper fallback handling
  • Modified the opencode default theme to explicitly define colors for the new tokens

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/web/public/theme.json Added JSON schema definitions for the three new optional syntax token properties
packages/opencode/src/cli/cmd/tui/context/theme/opencode.json Defined explicit color values for the new tokens in the default opencode theme
packages/opencode/src/cli/cmd/tui/context/theme.tsx Updated TypeScript types, resolution logic, and syntax rules to support the new tokens with backward-compatible fallbacks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add syntaxTag, syntaxAttribute, and syntaxTagDelimiter theme tokens
for customizing HTML/XML/JSX tag highlighting.

Closes sst#6128
@CasualDeveloper
Copy link
Author

CasualDeveloper commented Dec 24, 2025

Re-committed with valid GPG signature. Closes #6128

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.

Add configurable syntax tokens for XML/HTML tag highlighting

1 participant