Skip to content

Semantic tokens for overloaded operators lose information compared to plain textmate syntax tokens #10549

@akbyrd

Description

@akbyrd

Environment

OS and Version: Windows 10 22H2 19045
VS Code Version: 1.75.1
C/C++ Extension Version: 1.14.3

Bug Summary and Steps to Reproduce

Bug Summary:

Without semantic highlighting enabled and overloaded operator has two tokens for the function name:

  • keyword.other.operator.overload.cpp for the operator keyword
  • entity.name.operator.cpp for the symbol being overloaded (& in the example below)

image

With semantic highlighting enabled both tokens are combined into semantic memberOperatorOverload and mapped to syntax entity.name.function.operator.member.cpp

image

This breaks the ability to color the overload keyword separately from the specific "function name".

The desired outcome is that the semantic token only includes the &, or multiple tokens are emitted that can be colored independently. The example above without semantic highlighting is the desired appearance.

Configuration and Logs

N/A

Other Extensions

No response

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