Skip to content

Commit

Permalink
fix: remove suggested registries on deactivation
Browse files Browse the repository at this point in the history
The suggested registries extension adds registries but never adds the disposable
subscription, so registries stay around even if you disable the extension. This
just adds the subscription.

There's a good argument to be made that suggested registries should be registered
more like commands or menu contributions, and since they'd be handled once by the
extension loader this bug could never happen again. That would require a breaking
API change and a much bigger PR though, so not sure it's worth it; either way I
think it's best for this change to go ahead and fix the immediate bug.

Fixes #3909.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
  • Loading branch information
deboer-tim committed Oct 2, 2023
1 parent f531978 commit 84f3bb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/registries/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export async function activate(extensionContext: extensionApi.ExtensionContext):
registry.icon = await base64EncodeFile(iconLocation);
}

// Suggest it to the registry
extensionApi.registry.suggestRegistry(registry);
// Suggest it to the registry and add to subscriptions
const disposable = extensionApi.registry.suggestRegistry(registry);
extensionContext.subscriptions.push(disposable);
}
}

Expand Down

0 comments on commit 84f3bb6

Please sign in to comment.