Skip to content

Syntax Highlighting in attribute macros should consider the node #12842

Closed
@Veykril

Description

@Veykril

Highlighting currently just picks the first token mapping it finds and applies that as that is simple and fast. This has the problem that code in attributes may become very chaotic if the spans are used a lot.
See this snippet without the database attribute
image
and here with it (Note the self parameter and function name colors changing)
image

Syntax highlighting should attempt to prioritize a mapping that fits the input node syntactically and only pick a different one if there is no similar node to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-highlighting(semantic) token highlighting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions