Skip to content

feature: Improve C Highlighting #251

Closed as not planned
Closed as not planned
@LeoBras

Description

@LeoBras

Did you check the tree-sitter docs?

Is your feature request related to a problem? Please describe.

It would be awesome if we could have different colors for function parameters, global variables and macro defines!

In some of the examples below, I compare Zed (using tree-sitter) and VS Code, which uses it's own parser/highlighter, just as an example of what would like to have.

Describe the solution you'd like

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

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

Describe alternatives you've considered

N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions