Clarify purpose of superType
under semanticTokenTypes
#145312
Labels
feature-request
Request for new features or functionality
semantic-tokens
Semantic tokens issues
verification-needed
Verification of issue is requested
verified
Verification succeeded
Milestone
I am not sure if this should be filed as a bug or a feature, so to begin I'd like docs to be updated to clarify what
superType
is meant to be used for and what implications do the values have.Currently the docs seem very vague on this topic:
https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#custom-token-types-and-modifiers
vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts
Lines 42 to 47 in 94c9ea4
My assumption was that
superType
would be used as an alternative/fallback token type if the theme doesn't support the custom token type.In the example above I expected VSCode to use e.g.
hcl-blockType
if the theme supports it ortype
if it doesn't. Instead it just always assigns the custom types regardless of whether themes support it or not.Instead I had to reverse engineer the token type mapping to TM scopes from here
vscode/src/vs/platform/theme/common/tokenClassificationRegistry.ts
Lines 541 to 582 in 02e8bd1
and then re-declare this mapping within
semanticTokenScope
to achieve this.If this is not how it was meant to work - what is the purpose of that field? If this is how it's meant to work - I guess we can turn this into a bug.
This may be related to #103109 although I feel like I may be asking/expecting the exact opposite - that is for VSCode to figure out what the right token to use, and both extensions and themes to stay as simple as possible.
The text was updated successfully, but these errors were encountered: