c/highlights : Add a tag for function parameters, global variables, and macro defines #24928
LeoBras
started this conversation in
Feature Ideas / Enhancements
Replies: 3 comments
-
I think it makes more sense to add this as a request to tree-sitter: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Actually, the original tree-sitter version seems less featured than Zed's. I am unsure on which project to ask for this improvement. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is likely not possible with tree-sitter alone and would likely require: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for working on Zed, I am loving using it!
Few requests :)
In C, It would be awesome if we could have different colors for function parameters, global variables and macro defines!
Function parameters:
They are super useful to be easily spotted because we can track faster which parts of the function are being affected by the parameter. I have seen a request for python #17532, and it would look like this:

See how parameter b has a different color than variable i
Global variables:
Sometimes it's important (while you read functions) to make sure to know which variables are global, and which are local, for a very similar reason than function parameters. So it would be awesome to be able to select a color for those.

Sample code with bad color choice, but representing the idea: check a and b
Macro defines:
Telling macros apart from functions can also be very useful, and there are already ways of setting a color on the "#define" part, so it makes sense to match the color on the usage:
On "improved", macro's usage has the same color as it's define
Edit: Adding a new request:
Fade-out disabled code
On VSCode, when code is disabled by a #ifdef, we have the text being faded-out:
(somewhere in the project, CONFIG_SMP is defined, so the second line is disabled and faded-out)
Is there any chance the above features are possible to achieve?
Thanks!
Leo
Beta Was this translation helpful? Give feedback.
All reactions