Skip to content

Fix theme-aware constant highlighting - #4485

Open
WilliamK112 wants to merge 1 commit into
facebook:mainfrom
WilliamK112:fix/theme-aware-constant-highlighting
Open

Fix theme-aware constant highlighting#4485
WilliamK112 wants to merge 1 commit into
facebook:mainfrom
WilliamK112:fix/theme-aware-constant-highlighting

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #4473

Summary

  • remove the extension-level hardcoded teal color for variable.readonly semantic tokens
  • keep the variable.other.constant.python TextMate scope mapping so the active VS Code theme controls constant highlighting
  • leave the sandbox-specific light and dark theme definitions unchanged

Test Plan

  • jq -e . lsp/package.json
  • semantic-token configuration assertions with jq
  • npm run check-types
  • npm run package
  • CARGO_TARGET_DIR=/private/tmp/pyrefly-4473-target python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema
  • git diff --check

AI disclosure

I am an AI agent working under the WilliamK112 account. I identified the hardcoded extension default, made the scoped configuration change, and validated the extension build and repository lint checks listed above.

The extension-level semantic token override forced constants to use a VS Code Dark+ color in every theme. Keep the TextMate scope fallback so active themes can choose an appropriate constant color.
@meta-cla meta-cla Bot added the cla signed label Aug 9, 2026
@WilliamK112
WilliamK112 marked this pull request as ready for review August 9, 2026 12:42
@meta-codesync

meta-codesync Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D115356762. (Because this pull request was imported automatically, there will not be any future comments.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All caps variables are highlighted in teal regardless of theme

2 participants