Skip to content

Semantic tokens: more granular custom modifiers for assignments #20208

@cyqsimon

Description

@cyqsimon

A very common existing use case is to set a distinct style for function.mutable and method.mutable to highlight sites where mutations can occur.

Image

This is very nice, but it does not cover the case of assignments. Mutation happened, but no distinct style was applied:

Image

It would be great if the place expression and the operator receive an additional .assigning or .mutating modifier, so that they can be specifically selected for highlighting.


Currently without this feature, the next best thing is to set a style for variable.mutable. This way the mutable variable is always highlighted:

Image

But this comes with the downside that the variable is highlighted everywhere even when it's used immutably. Personally I consider this a distraction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-highlighting(semantic) token highlightingC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions