@@ -21,7 +21,7 @@ import { CommandManager } from './commandManager';
2121import { SignInCommand } from './commands/account' ;
2222import { ExportLogsCommand } from './commands/logs' ;
2323import { Configuration } from './configuration' ;
24- import { LocalSSHService } from './services/localSSHService ' ;
24+ import { RemoteService } from './services/remoteService ' ;
2525
2626// connect-web uses fetch api, so we need to polyfill it
2727if ( ! global . fetch ) {
@@ -38,13 +38,12 @@ const FIRST_INSTALL_KEY = 'gitpod-desktop.firstInstall';
3838let telemetryService : TelemetryService | undefined ;
3939let remoteSession : RemoteSession | undefined ;
4040let logger : vscode . LogOutputChannel | undefined ;
41- let hostService : HostService | undefined ;
4241
4342export async function activate ( context : vscode . ExtensionContext ) {
4443 const extensionId = context . extension . id ;
4544 const packageJSON = context . extension . packageJSON ;
4645
47- let remoteConnectionInfo : { remoteAuthority : string ; connectionInfo : SSHConnectionParams } | undefined ;
46+ let remoteConnectionInfo : { connectionInfo : SSHConnectionParams ; remoteUri : vscode . Uri ; sshDestStr : string } | undefined ;
4847 let success = false ;
4948 try {
5049 logger = vscode . window . createOutputChannel ( 'Gitpod' , { log : true } ) ;
@@ -76,22 +75,22 @@ export async function activate(context: vscode.ExtensionContext) {
7675 const authProvider = new GitpodAuthenticationProvider ( context , logger , telemetryService , notificationService ) ;
7776 context . subscriptions . push ( authProvider ) ;
7877
79- hostService = new HostService ( context , notificationService , logger ) ;
78+ const hostService = new HostService ( context , notificationService , logger ) ;
8079 context . subscriptions . push ( hostService ) ;
8180
8281 const sessionService = new SessionService ( hostService , logger ) ;
8382 context . subscriptions . push ( sessionService ) ;
8483
85- const localSSHService = new LocalSSHService ( context , hostService , telemetryService , sessionService , logger ) ;
86- context . subscriptions . push ( localSSHService ) ;
84+ const remoteService = new RemoteService ( context , hostService , telemetryService , sessionService , logger ) ;
85+ context . subscriptions . push ( remoteService ) ;
8786
8887 const experiments = new ExperimentalSettings ( packageJSON . configcatKey , packageJSON . version , context , sessionService , hostService , logger ) ;
8988 context . subscriptions . push ( experiments ) ;
9089
9190 const settingsSync = new SettingsSync ( commandManager , logger , telemetryService , notificationService ) ;
9291 context . subscriptions . push ( settingsSync ) ;
9392
94- const remoteConnector = new RemoteConnector ( context , sessionService , hostService , experiments , logger , telemetryService , notificationService , localSSHService ) ;
93+ const remoteConnector = new RemoteConnector ( context , sessionService , hostService , experiments , logger , telemetryService , notificationService , remoteService ) ;
9594 context . subscriptions . push ( remoteConnector ) ;
9695
9796 context . subscriptions . push ( vscode . window . registerUriHandler ( {
@@ -120,17 +119,17 @@ export async function activate(context: vscode.ExtensionContext) {
120119 if ( remoteConnectionInfo ) {
121120 commandManager . register ( { id : 'gitpod.api.autoTunnel' , execute : ( ) => remoteConnector . autoTunnelCommand } ) ;
122121
123- remoteSession = new RemoteSession ( remoteConnectionInfo . remoteAuthority , remoteConnectionInfo . connectionInfo , context , hostService ! , sessionService , settingsSync , experiments , logger ! , telemetryService ! , notificationService ) ;
122+ remoteSession = new RemoteSession ( remoteConnectionInfo . connectionInfo , context , hostService , sessionService , settingsSync , experiments , logger ! , telemetryService ! , notificationService ) ;
124123 await remoteSession . initialize ( ) ;
125124 }
126125 } ) ;
127126
128127 success = true ;
129128 } finally {
130129 const rawActivateProperties = {
131- gitpodHost : remoteConnectionInfo ?. connectionInfo . gitpodHost || hostService ?. gitpodHost || Configuration . getGitpodHost ( ) ,
130+ gitpodHost : remoteConnectionInfo ?. connectionInfo . gitpodHost || Configuration . getGitpodHost ( ) ,
132131 isRemoteSSH : String ( vscode . env . remoteName === 'ssh-remote' ) ,
133- remoteUri : vscode . workspace . workspaceFile ?. toString ( ) || vscode . workspace . workspaceFolders ?. [ 0 ] . uri . toString ( ) || '' ,
132+ remoteUri : remoteConnectionInfo ?. remoteUri ?. toString ( ) ,
134133 workspaceId : remoteConnectionInfo ?. connectionInfo . workspaceId || '' ,
135134 instanceId : remoteConnectionInfo ?. connectionInfo . instanceId || '' ,
136135 debugWorkspace : remoteConnectionInfo ? String ( ! ! remoteConnectionInfo . connectionInfo . debugWorkspace ) : '' ,
0 commit comments