mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
[html][json] fix some missing dispose registrations
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user