Distinguishing between different operators in semantic highlighting #8279
Labels
A-highlighting
(semantic) token highlighting
S-actionable
Someone could pick this issue up and work on it right now
Currently, rust-analyzer categorizes all operators as being of "operator" semantic token type. While this is very much according to the spec, it does make coloring different operators different colors impossible in semantic highlighting, which was not (and still is not) a problem with non-semantic syntax highlighting. Themes and token color customization settings cannot be used to work around this problem. The
keyword.operator
textmate blanket matching rule is used for operators in semantic highlighting, and such a rule is defined in the intrinsic base themes supplied with VS Code. Since semantic token coloring rules always override textmate coloring rules when semantic highlighting is enabled, this means that all operators are colored the same color according to some token coloring rule.My proposal is to add custom semantic token modifiers to the different kinds of operators so that token coloring rules can selectively select some operators but not others, and color them as desired. I am not aware of any particular LSP language server that does this yet, but I would not be surprised to find out about ones that do this or are in the process of implementing such modifiers.
The text was updated successfully, but these errors were encountered: