@@ -331,8 +331,7 @@ export class RemoteService extends Disposable implements IRemoteService {
331
331
332
332
async updateRemoteConfig ( ) {
333
333
const remoteSSHconfig = vscode . workspace . getConfiguration ( 'remote.SSH' ) ;
334
- const defaultSSHExtConfigInfo =
335
- remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
334
+ const defaultSSHExtConfigInfo = remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
336
335
const defaultSSHExtensions = defaultSSHExtConfigInfo ?. globalValue ?? [ ] ;
337
336
if ( ! defaultSSHExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
338
337
defaultSSHExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
@@ -343,17 +342,19 @@ export class RemoteService extends Disposable implements IRemoteService {
343
342
) ;
344
343
}
345
344
346
- const remoteDevContainerConfig =
347
- vscode . workspace . getConfiguration ( 'dev.containers' ) ;
348
- const defaultDevContainerExtConfigInfo = remoteDevContainerConfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
349
- const defaultDevContainerExtensions = defaultDevContainerExtConfigInfo ?. globalValue ?? [ ] ;
350
- if ( ! defaultDevContainerExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
351
- defaultDevContainerExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
352
- await remoteDevContainerConfig . update (
353
- 'defaultExtensions' ,
354
- defaultDevContainerExtensions ,
355
- vscode . ConfigurationTarget . Global ,
356
- ) ;
345
+ const msVscodeRemoteContainersExt = vscode . extensions . getExtension ( 'ms-vscode-remote.remote-containers' ) ;
346
+ if ( msVscodeRemoteContainersExt ) {
347
+ const remoteDevContainerConfig = vscode . workspace . getConfiguration ( 'dev.containers' ) ;
348
+ const defaultDevContainerExtConfigInfo = remoteDevContainerConfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
349
+ const defaultDevContainerExtensions = defaultDevContainerExtConfigInfo ?. globalValue ?? [ ] ;
350
+ if ( ! defaultDevContainerExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
351
+ defaultDevContainerExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
352
+ await remoteDevContainerConfig . update (
353
+ 'defaultExtensions' ,
354
+ defaultDevContainerExtensions ,
355
+ vscode . ConfigurationTarget . Global ,
356
+ ) ;
357
+ }
357
358
}
358
359
359
360
const currentConfigFile = remoteSSHconfig . get < string > ( 'configFile' ) ;
0 commit comments