Skip to content

Commit 2e80d6d

Browse files
bhavyausBhavya Udayashankar
andauthored
Entry label changes and additional platform compatibility checks for remote start entry items (microsoft#182242)
Entry label changes and additional platform compatibility checks Co-authored-by: Bhavya Udayashankar <[email protected]>
1 parent 9b6b547 commit 2e80d6d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
2626
import { infoIcon } from 'vs/workbench/contrib/extensions/browser/extensionsIcons';
2727
import { IOpenerService } from 'vs/platform/opener/common/opener';
2828
import { URI } from 'vs/base/common/uri';
29-
import { isWeb } from 'vs/base/common/platform';
29+
import { PlatformName, PlatformToString, isWeb, platform } from 'vs/base/common/platform';
3030

3131
const STATUSBAR_REMOTEINDICATOR_CONTRIBUTION = 'statusBar/remoteIndicator';
3232

@@ -58,6 +58,7 @@ interface RemoteExtensionMetadata {
5858
startConnectLabel: string;
5959
startCommand: string;
6060
priority: number;
61+
supportedPlatforms?: PlatformName[];
6162
}
6263

6364
export class RemoteStartEntry extends Disposable implements IWorkbenchContribution {
@@ -97,7 +98,6 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
9798
startConnectLabel: remoteExtensionTips.startEntry?.startConnectLabel ?? '',
9899
startCommand: remoteExtensionTips.startEntry?.startCommand ?? '',
99100
priority: remoteExtensionTips.startEntry?.priority ?? 10
100-
101101
}] : [];
102102
}
103103
else {
@@ -113,7 +113,8 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
113113
helpLink: value.startEntry?.helpLink ?? '',
114114
startConnectLabel: value.startEntry?.startConnectLabel ?? '',
115115
startCommand: value.startEntry?.startCommand ?? '',
116-
priority: value.startEntry?.priority ?? 10
116+
priority: value.startEntry?.priority ?? 10,
117+
supportedPlatforms: value.supportedPlatforms
117118
};
118119
});
119120

@@ -195,15 +196,18 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
195196
if (this._isInitialized) {
196197
return;
197198
}
198-
199+
const currentPlatform = PlatformToString(platform);
199200
for (let i = 0; i < this.remoteExtensionMetadata.length; i++) {
200201
const extensionId = this.remoteExtensionMetadata[i].id;
201-
202+
const supportedPlatforms = this.remoteExtensionMetadata[i].supportedPlatforms;
202203
// Update compatibility
203204
const galleryExtension = (await this.extensionGalleryService.getExtensions([{ id: extensionId }], CancellationToken.None))[0];
204205
if (!await this.extensionManagementService.canInstall(galleryExtension)) {
205206
this.remoteExtensionMetadata[i].isPlatformCompatible = false;
206207
}
208+
else if (supportedPlatforms && !supportedPlatforms.includes(currentPlatform)) {
209+
this.remoteExtensionMetadata[i].isPlatformCompatible = false;
210+
}
207211
else {
208212
this.remoteExtensionMetadata[i].isPlatformCompatible = true;
209213
this.remoteExtensionMetadata[i].dependencies = galleryExtension.properties.extensionPack ?? [];

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ export const startEntries: GettingStartedStartEntryContent = [
154154
}
155155
},
156156
{
157-
id: 'topLevelConnectToTunnel',
158-
title: localize('gettingStarted.topLevelConnectToTunnel.title', "Connect via Remote Tunnel"),
159-
description: localize('gettingStarted.topLevelConnectToTunnel.description', "Connect to a remote machine via Tunnel"),
157+
id: 'topLevelOpenTunnel',
158+
title: localize('gettingStarted.topLevelOpenTunnel.title', "Open Tunnel..."),
159+
description: localize('gettingStarted.topLevelOpenTunnel.description', "Connect to a remote machine through a Tunnel"),
160160
when: 'isWeb && config.workbench.remote.experimental.showStartListEntry',
161161
icon: Codicon.remote,
162162
content: {

0 commit comments

Comments
 (0)