Skip to content

Commit 6353756

Browse files
authored
Show remote indicator if there are installableExtensions in an empty window. (microsoft#186456)
* Show remote indicator if there are installableExtensions * Prevent start entry item from showing before init
1 parent 0078c49 commit 6353756

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/vs/workbench/contrib/remote/browser/remoteIndicator.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ interface RemoteExtensionMetadata {
8181
supportedPlatforms?: PlatformName[];
8282
}
8383

84+
export const showRemoteStartEntry = new RawContextKey<boolean>('showRemoteStartEntry', false);
8485
export class RemoteStatusIndicator extends Disposable implements IWorkbenchContribution {
8586

8687
private static readonly REMOTE_ACTIONS_COMMAND_ID = 'workbench.action.remote.showMenu';
@@ -340,6 +341,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
340341
}
341342

342343
this.remoteMetadataInitialized = true;
344+
showRemoteStartEntry.bindTo(this.contextKeyService).set(true);
345+
this.updateRemoteStatusIndicator();
343346
}
344347

345348
private updateVirtualWorkspaceLocation() {
@@ -548,8 +551,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
548551
}
549552
}
550553

551-
// Show when there are commands other than the 'install additional remote extensions' command.
552-
if (this.hasRemoteMenuCommands(true)) {
554+
// Show when there are commands or installable remote extensions.
555+
if (this.hasRemoteMenuCommands(true) || this.remoteExtensionMetadata.some(ext => !ext.installed && ext.isPlatformCompatible)) {
553556
this.renderRemoteStatusIndicator(`$(remote)`, nls.localize('noHost.tooltip', "Open a Remote Window"));
554557
return;
555558
}
@@ -570,7 +573,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
570573
text,
571574
showProgress,
572575
tooltip,
573-
command: command ?? this.hasRemoteMenuCommands(false) ? RemoteStatusIndicator.REMOTE_ACTIONS_COMMAND_ID : undefined
576+
command: command ?? (this.hasRemoteMenuCommands(false) || this.remoteExtensionMetadata.some(ext => !ext.installed && ext.isPlatformCompatible)) ? RemoteStatusIndicator.REMOTE_ACTIONS_COMMAND_ID : undefined
574577
};
575578

576579
if (this.remoteStatusEntry) {

src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const startEntries: GettingStartedStartEntryContent = [
146146
id: 'topLevelRemoteOpen',
147147
title: localize('gettingStarted.topLevelRemoteOpen.title', "Connect to..."),
148148
description: localize('gettingStarted.topLevelRemoteOpen.description', "Connect to remote development workspaces."),
149-
when: '!isWeb',
149+
when: '!isWeb && showRemoteStartEntry',
150150
icon: Codicon.remote,
151151
content: {
152152
type: 'startEntry',

0 commit comments

Comments
 (0)