mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
[html][json] fix some missing dispose registrations
This commit is contained in:
parent
11e60ebeec
commit
4274ec05b8
|
@ -229,7 +229,7 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua
|
|||
|
||||
const regionCompletionRegExpr = /^(\s*)(<(!(-(-\s*(#\w*)?)?)?)?)?$/;
|
||||
const htmlSnippetCompletionRegExpr = /^(\s*)(<(h(t(m(l)?)?)?)?)?$/;
|
||||
languages.registerCompletionItemProvider(documentSelector, {
|
||||
toDispose.push(languages.registerCompletionItemProvider(documentSelector, {
|
||||
provideCompletionItems(doc, pos) {
|
||||
const results: CompletionItem[] = [];
|
||||
let lineUntilPos = doc.getText(new Range(new Position(pos.line, 0), pos));
|
||||
|
@ -278,7 +278,7 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua
|
|||
}
|
||||
return results;
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
const promptForLinkedEditingKey = 'html.promptForLinkedEditing';
|
||||
if (extensions.getExtension('formulahendry.auto-rename-tag') !== undefined && (context.globalState.get(promptForLinkedEditingKey) !== false)) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue