Skip to content

Some providers should be deregistered/re-registered when the related feature is disabled/enabled #11229

@Colengms

Description

@Colengms

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.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions