Remote menu not showing when browsing marketplace (#151199)

Remote menu not showing when browsing marketplace #151198
pull/151432/head
Martin Aeschlimann 2022-06-07 15:40:32 +02:00 committed by GitHub
parent e3a8e502ad
commit 3e8d82d2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 4 deletions

View File

@ -306,7 +306,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
}
return;
}
// show when in a virtual workspace
// Show when in a virtual workspace
if (this.virtualWorkspaceLocation) {
// Workspace with label: indicate editing source
const workspaceLabel = this.labelService.getHostLabel(this.virtualWorkspaceLocation.scheme, this.virtualWorkspaceLocation.authority);
@ -330,8 +330,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
return;
}
}
// Remote actions: offer menu
if (this.getRemoteMenuActions().length > 0) {
// Show when there are commands other than the 'install additional remote extensions' command.
if (this.hasRemoteMenuCommands(true)) {
this.renderRemoteStatusIndicator(`$(remote)`, nls.localize('noHost.tooltip', "Open a Remote Window"));
return;
}
@ -343,7 +343,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
private renderRemoteStatusIndicator(text: string, tooltip?: string | IMarkdownString, command?: string, showProgress?: boolean): void {
const name = nls.localize('remoteHost', "Remote Host");
if (typeof command !== 'string' && this.getRemoteMenuActions().length > 0) {
if (typeof command !== 'string' && (this.hasRemoteMenuCommands(false))) {
command = RemoteStatusIndicator.REMOTE_ACTIONS_COMMAND_ID;
}
@ -493,4 +493,15 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
quickPick.show();
}
private hasRemoteMenuCommands(ignoreInstallAdditional: boolean): boolean {
if (this.remoteAuthority !== undefined || this.virtualWorkspaceLocation !== undefined) {
if (RemoteStatusIndicator.SHOW_CLOSE_REMOTE_COMMAND_ID) {
return true;
}
} else if (!ignoreInstallAdditional && this.extensionGalleryService.isEnabled()) {
return true;
}
return this.getRemoteMenuActions().length > 0;
}
}