Skip to content

languages: Highlight enumerator values as constants in C++#46115

Closed
ozacod wants to merge 1 commit intozed-industries:mainfrom
ozacod:fix/cpp-enum-constant-highlighting
Closed

languages: Highlight enumerator values as constants in C++#46115
ozacod wants to merge 1 commit intozed-industries:mainfrom
ozacod:fix/cpp-enum-constant-highlighting

Conversation

@ozacod
Copy link
Contributor

@ozacod ozacod commented Jan 5, 2026

Before:
before

After:

after

Release Notes:

  • Fix constant highlight issue for enumerator values

@cla-bot
Copy link

cla-bot bot commented Jan 5, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @ozacod on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@maxdeviant maxdeviant changed the title language: Highlight enumerator values as constants C++ languages: Highlight enumerator values as constants in C++ Jan 5, 2026
@ozacod
Copy link
Contributor Author

ozacod commented Jan 5, 2026

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 5, 2026
@cla-bot
Copy link

cla-bot bot commented Jan 5, 2026

The cla-bot has been summoned, and re-checked this pull request!

@maxbrunsfeld
Copy link
Collaborator

My only issue with this is that we probably can't do it consistently between definitions of the enumerator values and usages of those values. If this adds greater inconsistency, I tend to be against it. Thoughts @ozacod ?

@ozacod
Copy link
Contributor Author

ozacod commented Jan 6, 2026

If enumerator value is not upper case, it would not be possible to highlight "Color:Red" without semantic understanding. This is probably not possible with tree sitter, requires lsp semantic tokens (Issue #7450). I agree, we should not implement it before related issue is solved. @maxbrunsfeld

@maxbrunsfeld
Copy link
Collaborator

Yeah we will be adding semantic LSP-based highlighting in the near future, so maybe we should leave it as-is for now.

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

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants