Skip to content

Provide separate semantic token fallback scopes for each supported language#7829

Merged
Colengms merged 2 commits intomainfrom
dev/coleng/semantic_fallback_workaround
Jul 15, 2021
Merged

Provide separate semantic token fallback scopes for each supported language#7829
Colengms merged 2 commits intomainfrom
dev/coleng/semantic_fallback_workaround

Conversation

@Colengms
Copy link
Contributor

This addresses: #7773

The root cause of the issue is: microsoft/vscode#128565

Since fixing it in VS Code is not a high priority, this works around the issue by providing separate TextMate fallback scopes for all of our custom semantic tokens as well as standard semantic tokens. When/If the issue is addressed in VS Code, this change can be reverted. It should not cause a problem even if not reverted.

Copy link
Contributor

@sean-mcmanus sean-mcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the original non-language scopes still exist, such as entity.name.namespace ?

@Colengms
Copy link
Contributor Author

Colengms commented Jul 14, 2021

Should the original non-language scopes still exist, such as entity.name.namespace ?

I don't think so. It should work properly with the most-qualified name. A theme style is looked up first with the fully qualified scope, and the fallback process removes suffixes. For example, entity.name.namespace.cpp is searched for first. If no style is found, entity.name.namespace is tried, then entity.name, then entity.

@Colengms Colengms merged commit 90fb991 into main Jul 15, 2021
@Colengms Colengms deleted the dev/coleng/semantic_fallback_workaround branch July 15, 2021 00:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants