Skip to content

c/highlights : Add a tag for function parameters, global variables, and macro defines #27367

@LeoBras

Description

@LeoBras

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
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
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
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:

image
(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

Originally posted by @LeoBras in #24928

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions