@@ -331,8 +331,7 @@ export class RemoteService extends Disposable implements IRemoteService {
331331
332332 async updateRemoteConfig ( ) {
333333 const remoteSSHconfig = vscode . workspace . getConfiguration ( 'remote.SSH' ) ;
334- const defaultSSHExtConfigInfo =
335- remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
334+ const defaultSSHExtConfigInfo = remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
336335 const defaultSSHExtensions = defaultSSHExtConfigInfo ?. globalValue ?? [ ] ;
337336 if ( ! defaultSSHExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
338337 defaultSSHExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
@@ -343,17 +342,19 @@ export class RemoteService extends Disposable implements IRemoteService {
343342 ) ;
344343 }
345344
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+ }
357358 }
358359
359360 const currentConfigFile = remoteSSHconfig . get < string > ( 'configFile' ) ;
0 commit comments