@@ -26,7 +26,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
26
26
import { infoIcon } from 'vs/workbench/contrib/extensions/browser/extensionsIcons' ;
27
27
import { IOpenerService } from 'vs/platform/opener/common/opener' ;
28
28
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' ;
30
30
31
31
const STATUSBAR_REMOTEINDICATOR_CONTRIBUTION = 'statusBar/remoteIndicator' ;
32
32
@@ -58,6 +58,7 @@ interface RemoteExtensionMetadata {
58
58
startConnectLabel : string ;
59
59
startCommand : string ;
60
60
priority : number ;
61
+ supportedPlatforms ?: PlatformName [ ] ;
61
62
}
62
63
63
64
export class RemoteStartEntry extends Disposable implements IWorkbenchContribution {
@@ -97,7 +98,6 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
97
98
startConnectLabel : remoteExtensionTips . startEntry ?. startConnectLabel ?? '' ,
98
99
startCommand : remoteExtensionTips . startEntry ?. startCommand ?? '' ,
99
100
priority : remoteExtensionTips . startEntry ?. priority ?? 10
100
-
101
101
} ] : [ ] ;
102
102
}
103
103
else {
@@ -113,7 +113,8 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
113
113
helpLink : value . startEntry ?. helpLink ?? '' ,
114
114
startConnectLabel : value . startEntry ?. startConnectLabel ?? '' ,
115
115
startCommand : value . startEntry ?. startCommand ?? '' ,
116
- priority : value . startEntry ?. priority ?? 10
116
+ priority : value . startEntry ?. priority ?? 10 ,
117
+ supportedPlatforms : value . supportedPlatforms
117
118
} ;
118
119
} ) ;
119
120
@@ -195,15 +196,18 @@ export class RemoteStartEntry extends Disposable implements IWorkbenchContributi
195
196
if ( this . _isInitialized ) {
196
197
return ;
197
198
}
198
-
199
+ const currentPlatform = PlatformToString ( platform ) ;
199
200
for ( let i = 0 ; i < this . remoteExtensionMetadata . length ; i ++ ) {
200
201
const extensionId = this . remoteExtensionMetadata [ i ] . id ;
201
-
202
+ const supportedPlatforms = this . remoteExtensionMetadata [ i ] . supportedPlatforms ;
202
203
// Update compatibility
203
204
const galleryExtension = ( await this . extensionGalleryService . getExtensions ( [ { id : extensionId } ] , CancellationToken . None ) ) [ 0 ] ;
204
205
if ( ! await this . extensionManagementService . canInstall ( galleryExtension ) ) {
205
206
this . remoteExtensionMetadata [ i ] . isPlatformCompatible = false ;
206
207
}
208
+ else if ( supportedPlatforms && ! supportedPlatforms . includes ( currentPlatform ) ) {
209
+ this . remoteExtensionMetadata [ i ] . isPlatformCompatible = false ;
210
+ }
207
211
else {
208
212
this . remoteExtensionMetadata [ i ] . isPlatformCompatible = true ;
209
213
this . remoteExtensionMetadata [ i ] . dependencies = galleryExtension . properties . extensionPack ?? [ ] ;
0 commit comments