[html][json] fix some missing dispose registrations

This commit is contained in:
Martin Aeschlimann
2022-03-02 11:57:04 +01:00
parent 11e60ebeec
commit 4274ec05b8
2 changed files with 6 additions and 6 deletions

View File

@@ -124,13 +124,13 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua
let isClientReady = false;
commands.registerCommand('json.clearCache', async () => {
toDispose.push(commands.registerCommand('json.clearCache', async () => {
if (isClientReady && runtime.schemaRequests.clearCache) {
const cachedSchemas = await runtime.schemaRequests.clearCache();
await client.sendNotification(SchemaContentChangeNotification.type, cachedSchemas);
}
window.showInformationMessage(localize('json.clearCache.completed', "JSON schema cache cleared."));
});
}));
// Options to control the language client
const clientOptions: LanguageClientOptions = {
@@ -306,9 +306,9 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations(context));
extensions.onDidChange(_ => {
toDispose.push(extensions.onDidChange(_ => {
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations(context));
});
}));
// manually register / deregister format provider based on the `json.format.enable` setting avoiding issues with late registration. See #71652.
updateFormatterRegistration();