Fix theme-aware constant highlighting - #4485
Conversation
|
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.) |
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@WilliamK112 can you confirm that #1780 is still fixed after your change? since this effectively reverts part of the original fix for that. screenshots of light and dark themes would be useful evidence, the current test plan is insufficient for this change, since this is not covered by automated testing. |
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.
b8479f7 to
d1761ae
Compare
|
Thanks for flagging #1780. The first live check showed that simply removing the override was not sufficient: Dark Modern still distinguished constants via the retained That preserves #1780's visual distinction in themes that do not assign constants a separate color, while #4473 remains fixed because each active theme still controls the actual color. Light Modern Dark Modern Both screenshots are from isolated VS Code Extension Development Host profiles running this PR's extension against a locally built Pyrefly LSP. The logs confirm Validation on head
|
|
Thank you! |


Summary
variable.other.constant.pythonTextMate scope fallbackThis lets the active VS Code theme choose the constant color while preserving the visual distinction added for #1780. Light Modern and Dark Modern were both verified in isolated Extension Development Host profiles; screenshots and details are included in the review thread.
Fixes #4473
Validation
npm run packageAGENTS.mdgit diff --checkAI disclosure
I used an AI coding assistant to help inspect the extension configuration, implement the change, and validate the result. I manually reviewed the final diff and visual evidence.