Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If multiple registerDocumentSemanticTokensProvider matches the same score, which will be used? #145530

Closed
XadillaX opened this issue Mar 21, 2022 · 3 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@XadillaX
Copy link

XadillaX commented Mar 21, 2022

If two extensions both registerDocumentSemanticTokensProvider(), and the selector matches the same score, which one will be used?

Is there any way to use them both, or specify a certain one?

Related issue: microsoft/pylance-release#2495

@jrieken jrieken added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Mar 21, 2022
@jrieken
Copy link
Member

jrieken commented Mar 21, 2022

The tie breaker will be the order in which the corresponding extension has registered the provider: the last one will win. There is no support for multiple semantic token providers, we rarely see conflicts with this and ideally extensions have the ability to enable/disable their token provider if there are conflicts. Adding such a setting in VS Code itself isn't as simple as it sounds because providers are dynamic and we don't know under what circumstances a provider appears/disappears. That's why we consider we recommend to add settings to conflicting extensions which makes this a user-choice

@jrieken jrieken closed this as completed Mar 21, 2022
@jrieken
Copy link
Member

jrieken commented Mar 21, 2022

cc @alexdima

@XadillaX
Copy link
Author

My extension is to implement gyp's features. e.g. semantic highlighting.

And gyp is a type of python file. So python extension will do the semantic highlighting while my gyp one will loose effect.

I can't control the register order. Or is there any way to control the order?

@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants