Don't update webview options if they have not changed (#164202)

This commit is contained in:
Matt Bierner
2022-10-20 19:40:01 -07:00
committed by GitHub
parent d9baa5ec68
commit 93985c5dd6

View File

@@ -6,6 +6,7 @@
import { VSBuffer } from 'vs/base/common/buffer';
import { Emitter, Event } from 'vs/base/common/event';
import { Schemas } from 'vs/base/common/network';
import * as objects from 'vs/base/common/objects';
import { URI } from 'vs/base/common/uri';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { normalizeVersion, parseVersion } from 'vs/platform/extensions/common/extensionValidator';
@@ -116,7 +117,11 @@ export class ExtHostWebview implements vscode.Webview {
public set options(newOptions: vscode.WebviewOptions) {
this.assertNotDisposed();
this.#proxy.$setOptions(this.#handle, serializeWebviewOptions(this.#extension, this.#workspace, newOptions));
if (!objects.equals(this.#options, newOptions)) {
this.#proxy.$setOptions(this.#handle, serializeWebviewOptions(this.#extension, this.#workspace, newOptions));
}
this.#options = newOptions;
}