Skip to content

Conversation

@dmmulroy
Copy link
Contributor

@dmmulroy dmmulroy commented Dec 3, 2025

Summary

Fixes syntax highlighting in the Quick Editor light theme. Variables were appearing as gray instead of being colored.

Why only some users saw this bug: VS Code uses two highlighting systems - semantic highlighting (from TypeScript/JS language service) and TextMate tokenization (regex-based fallback). Semantic highlighting layers on top of TextMate and masks theme bugs when active. Users hit the broken TextMate fallback when:

  • Language server is still initializing (first load)
  • Large files (LS skips semantic tokens for performance)
  • LS unavailable or crashed

Root cause: Light theme's Variables rule had variable.other instead of variable. Per TextMate scope matching, variable.other only matches variable.other.* tokens, not plain variable tokens. The dark theme correctly uses variable.

Changes:

  • Add variable scope to light theme Variables rule
  • Remove redundant variable.other (covered by variable)
  • Remove duplicate variable.other.object entries from both themes

  • Tests
    • Tests included/updated
    • Tests not necessary because: JSON theme configuration fix - no executable code, verified visually
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix to existing functionality
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: solarflare-theme is not part of Wrangler

Light theme was missing the base `variable` scope in the Variables rule,
causing JS/TS variables to fall back to the default editor foreground
color (#62676A gray) instead of being highlighted.

The dark theme correctly had `variable` which matches all variable.*
tokens via TextMate prefix matching. The light theme only had
`variable.other` which doesn't match plain `variable` scoped tokens.

Also removes duplicate `variable.other.object` entries from both themes.
@dmmulroy dmmulroy requested a review from a team as a code owner December 3, 2025 20:49
@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: a6d599c

The changes in this PR will be included in the next version bump.

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

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 3, 2025
@dmmulroy dmmulroy changed the title fix(solarflare-theme): add missing variable scope to light theme fix(quick-edit): add missing variable scope to solarflare light theme Dec 3, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 3, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11515

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11515

miniflare

npm i https://pkg.pr.new/miniflare@11515

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11515

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11515

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11515

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11515

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11515

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11515

wrangler

npm i https://pkg.pr.new/wrangler@11515

commit: a6d599c

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Dec 3, 2025
@dmmulroy dmmulroy force-pushed the dmmulroy/fix-quick-edit branch from 695da77 to 75ecbc8 Compare December 3, 2025 23:09
@jamesopstad jamesopstad merged commit 643f9e8 into cloudflare:main Dec 4, 2025
30 of 32 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 4, 2025
@dmmulroy dmmulroy deleted the dmmulroy/fix-quick-edit branch December 4, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants