diff --git a/src/vs/workbench/api/common/extHostLanguages.ts b/src/vs/workbench/api/common/extHostLanguages.ts index 6025f37075b..9fcf2ee479c 100644 --- a/src/vs/workbench/api/common/extHostLanguages.ts +++ b/src/vs/workbench/api/common/extHostLanguages.ts @@ -98,6 +98,7 @@ export class ExtHostLanguages implements ExtHostLanguagesShape { command: undefined, text: '', detail: '', + busy: false }; let soonHandle: IDisposable | undefined; @@ -115,7 +116,8 @@ export class ExtHostLanguages implements ExtHostLanguagesShape { detail: data.detail ?? '', severity: data.severity === LanguageStatusSeverity.Error ? Severity.Error : data.severity === LanguageStatusSeverity.Warning ? Severity.Warning : Severity.Info, command: data.command && this._commands.toInternal(data.command, commandDisposables), - accessibilityInfo: data.accessibilityInformation + accessibilityInfo: data.accessibilityInformation, + busy: data.busy }); }, 0); }; @@ -178,6 +180,13 @@ export class ExtHostLanguages implements ExtHostLanguagesShape { set command(value) { data.command = value; updateAsync(); + }, + get busy() { + return data.busy; + }, + set busy(value: boolean) { + data.busy = value; + updateAsync(); } }; updateAsync(); diff --git a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts index 41967cf8bf7..a52b8b898b9 100644 --- a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts +++ b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts @@ -160,18 +160,20 @@ class EditorStatusContribution implements IWorkbenchContribution { const showSeverity = first.severity >= Severity.Warning; const text = EditorStatusContribution._severityToComboCodicon(first.severity); + let isOneBusy = false; const ariaLabels: string[] = []; const element = document.createElement('div'); for (const status of model.combined) { element.appendChild(this._renderStatus(status, showSeverity, this._renderDisposables)); ariaLabels.push(this._asAriaLabel(status)); + isOneBusy = isOneBusy || status.busy; } const props: IStatusbarEntry = { name: localize('langStatus.name', "Editor Language Status"), ariaLabel: localize('langStatus.aria', "Editor Language Status: {0}", ariaLabels.join(', next: ')), tooltip: element, command: ShowTooltipCommand, - text, + text: isOneBusy ? `${text}\u00A0\u00A0$(sync~spin)` : text, }; if (!this._combinedEntry) { this._combinedEntry = this._statusBarService.addEntry(props, EditorStatusContribution._id, StatusbarAlignment.RIGHT, { id: 'status.editor.mode', alignment: StatusbarAlignment.LEFT, compact: true }); @@ -219,7 +221,7 @@ class EditorStatusContribution implements IWorkbenchContribution { const label = document.createElement('span'); label.classList.add('label'); - dom.append(label, ...renderLabelWithIcons(status.label)); + dom.append(label, ...renderLabelWithIcons(status.busy ? `$(sync~spin)\u00A0\u00A0${status.label}` : status.label)); left.appendChild(label); const detail = document.createElement('span'); @@ -311,7 +313,7 @@ class EditorStatusContribution implements IWorkbenchContribution { return { name: localize('name.pattern', '{0} (Language Status)', item.name), - text: item.label, + text: item.busy ? `${item.label}\u00A0\u00A0$(sync~spin)` : item.label, ariaLabel: item.accessibilityInfo?.label ?? item.label, role: item.accessibilityInfo?.role, tooltip: item.command?.tooltip || new MarkdownString(item.detail, true), diff --git a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts index e9899764933..ec5ac2c7f15 100644 --- a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts +++ b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts @@ -23,6 +23,7 @@ export interface ILanguageStatus { readonly severity: Severity; readonly label: string; readonly detail: string; + readonly busy: boolean; readonly source: string; readonly command: Command | undefined; readonly accessibilityInfo: IAccessibilityInformation | undefined; diff --git a/src/vscode-dts/vscode.proposed.languageStatus.d.ts b/src/vscode-dts/vscode.proposed.languageStatus.d.ts index 0249626162b..9de4ed5309e 100644 --- a/src/vscode-dts/vscode.proposed.languageStatus.d.ts +++ b/src/vscode-dts/vscode.proposed.languageStatus.d.ts @@ -18,6 +18,7 @@ declare module 'vscode' { selector: DocumentSelector; // todo@jrieken replace with boolean ala needsAttention severity: LanguageStatusSeverity; + busy: boolean; name: string | undefined; text: string; detail?: string;