@@ -43,7 +43,7 @@ export interface IRemoteService {
4343 getWorkspaceSSHDestination ( wsData : WorkspaceData ) : Promise < { destination : SSHDestination ; password ?: string } > ;
4444 showSSHPasswordModal ( wsData : WorkspaceData , password : string ) : Promise < void > ;
4545
46- updateRemoteSSHConfig ( ) : Promise < void > ;
46+ updateRemoteConfig ( ) : Promise < void > ;
4747 initializeRemoteExtensions ( ) : Promise < void > ;
4848}
4949
@@ -329,19 +329,41 @@ export class RemoteService extends Disposable implements IRemoteService {
329329 throw new Error ( 'SSH password modal dialog, Canceled' ) ;
330330 }
331331
332- async updateRemoteSSHConfig ( ) {
333- const remoteSSHconfig = vscode . workspace . getConfiguration ( 'remote.SSH' ) ;
334- const defaultExtConfigInfo = remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
335- const defaultExtensions = defaultExtConfigInfo ?. globalValue ?? [ ] ;
336- if ( ! defaultExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
337- defaultExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
338- await remoteSSHconfig . update ( 'defaultExtensions' , defaultExtensions , vscode . ConfigurationTarget . Global ) ;
339- }
340-
341- const currentConfigFile = remoteSSHconfig . get < string > ( 'configFile' ) ;
342- if ( currentConfigFile ?. includes ( 'gitpod_ssh_config' ) ) {
343- await remoteSSHconfig . update ( 'configFile' , undefined , vscode . ConfigurationTarget . Global ) ;
344- }
332+ async updateRemoteConfig ( ) {
333+ const remoteSSHconfig = vscode . workspace . getConfiguration ( 'remote.SSH' ) ;
334+ const defaultSSHExtConfigInfo =
335+ remoteSSHconfig . inspect < string [ ] > ( 'defaultExtensions' ) ;
336+ const defaultSSHExtensions = defaultSSHExtConfigInfo ?. globalValue ?? [ ] ;
337+ if ( ! defaultSSHExtensions . includes ( 'gitpod.gitpod-remote-ssh' ) ) {
338+ defaultSSHExtensions . unshift ( 'gitpod.gitpod-remote-ssh' ) ;
339+ await remoteSSHconfig . update (
340+ 'defaultExtensions' ,
341+ defaultSSHExtensions ,
342+ vscode . ConfigurationTarget . Global ,
343+ ) ;
344+ }
345+
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+ ) ;
357+ }
358+
359+ const currentConfigFile = remoteSSHconfig . get < string > ( 'configFile' ) ;
360+ if ( currentConfigFile ?. includes ( 'gitpod_ssh_config' ) ) {
361+ await remoteSSHconfig . update (
362+ 'configFile' ,
363+ undefined ,
364+ vscode . ConfigurationTarget . Global ,
365+ ) ;
366+ }
345367 }
346368
347369 async initializeRemoteExtensions ( ) {
@@ -379,9 +401,10 @@ export class RemoteService extends Disposable implements IRemoteService {
379401 throw e ;
380402 }
381403 this . telemetryService . sendUserFlowStatus ( 'synced' , flowData ) ;
382- } catch {
404+ } catch ( error ) {
383405 const msg = `Error while installing local extensions on remote.` ;
384406 this . logService . error ( msg ) ;
407+ this . logService . trace ( error ) ;
385408
386409 const status = 'failed' ;
387410 const seeLogs = 'See Logs' ;
0 commit comments