diff --git a/src/vs/base/browser/ui/iconLabel/iconLabel.ts b/src/vs/base/browser/ui/iconLabel/iconLabel.ts index 30b4246b9cf8ace5e82bafe16771118e314cf4fe..425f657432ca5ede3d2e2c201b3f8ecb34e49628 100644 --- a/src/vs/base/browser/ui/iconLabel/iconLabel.ts +++ b/src/vs/base/browser/ui/iconLabel/iconLabel.ts @@ -163,11 +163,18 @@ export class IconLabel extends Disposable { class Label { + private label: string | string[] | undefined = undefined; private singleLabel: HTMLElement | undefined = undefined; constructor(private container: HTMLElement) { } setLabel(label: string | string[], options?: IIconLabelValueOptions): void { + if (this.label === label) { + return; + } + + this.label = label; + if (typeof label === 'string') { if (!this.singleLabel) { this.container.innerHTML = ''; @@ -217,11 +224,18 @@ function splitMatches(labels: string[], separator: string, matches: IMatch[] | u class LabelWithHighlights { + private label: string | string[] | undefined = undefined; private singleLabel: HighlightedLabel | undefined = undefined; constructor(private container: HTMLElement, private supportCodicons: boolean) { } setLabel(label: string | string[], options?: IIconLabelValueOptions): void { + if (this.label === label) { + return; + } + + this.label = label; + if (typeof label === 'string') { if (!this.singleLabel) { this.container.innerHTML = '';