microsoft / microsoft/vscode-cpptools
Some providers should be deregistered/re-registered when the related feature is disabled/enabled
@browntarik is already working on this.
Since Aug 18, 2023.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Right now, we're always registering our providers in client.ts, even if the associated feature is disabled by settings.
If multiple providers are registered, depending on the feature, VS Code may invoke multiple and merge their results. So, in most cases, having our provider registered will not interfere with other extensions providing the same feature. But enabling/disabling of the feature's UI entry-point can be an issue.
For example, if C_Cpp.formatting is set to disabled, we should deregister our provider(s). Otherwise, if the user right-clicks on the document, they are still provided with options to format the document, despite those commands being effectively disabled. Unregistering the provider(s) should cause the option to not be offered.
The repro I encountered is related to the formatting provider(s), but we should check if the same scenario can arise for other providers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.