Request adding new 'decorator' semantic token scopes for Javascript/Typescript #114082
Labels
feature-request
Request for new features or functionality
insiders-released
Patch has been released in VS Code Insiders
semantic-tokens
Semantic tokens issues
verification-needed
Verification of issue is requested
verified
Verification succeeded
Milestone
Current Limitation
In the current Typescript development, after enabling Semantic Highlighting, the typescript decorators are identified as a function. I have no way to specify the decorator syntax color.
Consider the color scheme extension contains the following configuration
Let's check the following rendered images.
Disabled Semantic Highlighting (Expected Color I want)
Enabled Semantic Highlighting (No way configure as
function
semantic token type overwrite)Motivation
This limitation is an obstacle for syntax highlighting color scheme developers to use rich color to represent different syntax.
Real World Codebase example and IDE Competitor
Consider in a typescript graphql development with
type-graphql
: Use lots of decorator with typescript reflect meta data to generate GraphQL schematypedi
: Use decorator to register/indicate the dependencies injectionthose two libraries heavily use decorators to abstract and simplify the code bases.
However, current VSCode Typescript development lacking
decorator
semantic token causing a limitation thatdecorator
syntax highlighted color must be the same color withfunction
.Others IDE Competitor(Intellij Ultimate / WebStorm), has no limitation with its "Semantic highlighting" implementation
It would be great if VSCode can solve this limitation and gives more flexibility for syntax highlighting color scheme developer to use more color to represent different syntax. In my opinion, the more consistent syntax color representation, the more productivity on reading source code just like the design philosophy of Dark and Dark+.
Suggestion
Adding a new semantic token type can solve this problem. To keep the backward compatibility of the wide range of typescript color schemes,
entity.name.function
should be used as a fallback for those color themes that might not yet be adding the new color, i.e.semanticTokenColors.decorator
.The text was updated successfully, but these errors were encountered: