microsoft / theme-converter-for-vs

CLI tool that allows you to convert your VS Code color theme to a VS 2022 color theme.
MIT License
502 stars 53 forks source link

Semantic token not supported? #127

Closed EdCharbeneau closed 3 years ago

EdCharbeneau commented 3 years ago

Describe the bug

A converted theme does not have the same highlighting for semantic token types. In this case the theme was meant to support Razor Components. Not only does the converted theme not use the settings from the VS theme, it also doesn't theme Razor Components.

The screen shot below compares the VS Code theme (left) with VS2022 (right) Screenshots razor-components

Here's the token info from vs:

semantic token type razorTagHelperElement
foreground  entity.name.class.element.taghelper
entity.name.class
variable.other.class.js
variable.other.class.ts
{ "foreground": "#34d5ff" }
bold    Color theme: razorTagHelperElement - true
italic, underline   Color theme: razorTagHelperElement - false
gracegtaylor commented 3 years ago

Hi @EdCharbeneau, thanks for sharing this issue! Can you let us know which theme you are converting in that screenshot? That would help us look into the highlighting. The initial iteration of the converter tool was scoped to work best with C# and C++ syntax, so Razor wasn't in scope.

EdCharbeneau commented 3 years ago

Here it is, thanks for looking into this. https://github.com/EdCharbeneau/CodeItLive-vstheme

gracegtaylor commented 3 years ago

Thanks for sharing that, @EdCharbeneau! We've looked into this and @ketttY has added some additional token mappings for Razor files. You'll be able to give it a try after it gets merged in!

ketttY commented 3 years ago

Hi @EdCharbeneau, thank you for your feedback! After looking into this issue, seems like the json file generated from VSCode command "Developer: Generate Color Theme from Current Settings" does not contain the semantic tokens that you have specified in your original theme json (see attached screenshot). Therefore the converter tool is not able to support it yet. However, with the linked PR, I have added more razor specific mappings for the textmate scopes, hopefully this can help improving the fidelity of the converted theme. Attached is a sample screenshot for a razor file and you are more than welcome to have a try and see if that meets your expectation. If you think this issue is still blocking you from publishing the theme, feel free to reopen this issue and our team can reevaluate it. Thanks again for your support! Missing semantic token: image With PR improvement: image