microsoft / microsoft/vscode-cpptools

Emit semantic tokens for user defined conversions

Open
#10,550 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Colorization Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Feature Request

User defined conversions are the only operator overloads that aren't able to be syntax colored to make them more obvious (aside from new and delete, which I reported recently).

I'd like to request semantic tokens to enable syntax highlighting when a user defined conversion is invoked.

image

The tricky bit is, which token should it be? On the parentheses? Sometimes there aren't any parenthesis.

image

Perhaps it should be a modifier on the variable being converted? Can we do that if it's an entire expression? Maybe then we could underline the expression without changing the color of the entire thing.

image

It would also be nice if "go to definition" worked for the conversion, like other operator overloads. But I don't know if that's feasible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how the extension currently emits semantic tokens and supports go-to-definition for other C++ operator overloads. Compare the reported conversion examples, including cases without parentheses, and determine a token representation that can be applied consistently. Done means the behavior, token choice, and any definition navigation support are specified and covered for the relevant conversion forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.