From 78c865d70d4e7f754dcf65cb9a195a93851ad42f Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 31 May 2021 17:14:49 +0200 Subject: [PATCH] polish remote menu control actions --- .../contrib/remote/browser/remoteIndicator.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts index 25d6af4812e..ca9f0826531 100644 --- a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts +++ b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts @@ -414,12 +414,14 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr } } + items.push({ + type: 'separator' + }); + + let entriesBeforeConfig = items.length; + if (RemoteStatusIndicator.SHOW_CLOSE_REMOTE_COMMAND_ID) { if (this.remoteAuthority) { - if (items.length) { - items.push({ type: 'separator' }); - } - items.push({ type: 'item', id: RemoteStatusIndicator.CLOSE_REMOTE_COMMAND_ID, @@ -434,28 +436,27 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr }); } } else if (this.virtualWorkspaceScheme) { - if (items.length) { - items.push({ type: 'separator' }); - } - items.push({ type: 'item', id: RemoteStatusIndicator.CLOSE_REMOTE_COMMAND_ID, - label: nls.localize('closeRemoteWindow.title', 'Close Remote') + label: nls.localize('closeVirtualWorkspace.title', 'Close Remote Workspace') }); } } - if (!this.remoteAuthority && this.extensionGalleryService.isEnabled()) { - items.push({ - type: 'separator' - }); + if (!this.remoteAuthority && !this.virtualWorkspaceScheme && this.extensionGalleryService.isEnabled()) { items.push({ id: RemoteStatusIndicator.INSTALL_REMOTE_EXTENSIONS_ID, - label: nls.localize('installRemotes', "Install Additional Remote Development Extensions..."), + label: nls.localize('installRemotes', "Install Additional Remote Extensions..."), + alwaysShow: true }); } + + if (items.length === entriesBeforeConfig) { + items.pop(); // remove the separator again + } + return items; };