@@ -33,8 +33,8 @@ import { VscodeRemoteConnection, ensureDependencies } from '../shared/remoteSess
33
33
import { VscodeRemoteSshConfig , sshLogFileLocation } from '../shared/vscodeRemoteSshConfig'
34
34
35
35
export type DevEnvironmentId = Pick < DevEnvironment , 'id' | 'org' | 'project' >
36
- export const hostNamePrefix = 'aws-devenv-'
37
- export const connectScriptPrefix = 'codecatalyst_connect'
36
+ // export const hostNamePrefix = 'aws-devenv-'
37
+ // export const connectScriptPrefix = 'codecatalyst_connect'
38
38
39
39
export const docs = {
40
40
vscode : {
@@ -142,10 +142,6 @@ export function bearerTokenCacheLocation(devenvId: string): string {
142
142
return path . join ( globals . context . globalStorageUri . fsPath , `codecatalyst.${ devenvId } .token` )
143
143
}
144
144
145
- export function getHostNameFromEnv ( env : DevEnvironmentId ) : string {
146
- return `${ hostNamePrefix } ${ env . id } `
147
- }
148
-
149
145
export interface ConnectedDevEnv {
150
146
readonly summary : DevEnvironment
151
147
readonly devenvClient : DevEnvClient
@@ -209,7 +205,8 @@ export async function prepareDevEnvConnection(
209
205
{ topic, timeout } : { topic ?: string ; timeout ?: Timeout } = { }
210
206
) : Promise < DevEnvConnection > {
211
207
const { ssm, vsc, ssh } = ( await ensureDependencies ( ) ) . unwrap ( )
212
- const sshConfig = new VscodeRemoteSshConfig ( ssh , hostNamePrefix , connectScriptPrefix )
208
+ const hostNamePrefix = 'aws-devenv-'
209
+ const sshConfig = new VscodeRemoteSshConfig ( ssh , hostNamePrefix , 'codecatalyst_connect' )
213
210
const config = await sshConfig . ensureValid ( )
214
211
215
212
if ( config . isErr ( ) ) {
@@ -225,7 +222,7 @@ export async function prepareDevEnvConnection(
225
222
projectName : project . name ,
226
223
} )
227
224
228
- const hostname = getHostNameFromEnv ( { id , org , project } )
225
+ const hostname = ` ${ hostNamePrefix } ${ id } `
229
226
const logPrefix = topic ? `codecatalyst ${ topic } (${ id } )` : `codecatalyst (${ id } )`
230
227
const logger = ( data : string ) => getLogger ( ) . verbose ( `${ logPrefix } : ${ data } ` )
231
228
const envProvider = createCodeCatalystEnvProvider ( client , ssm , runningDevEnv )
@@ -263,7 +260,7 @@ export async function openDevEnv(
263
260
const repo = env . devenv . repositories . length == 1 ? env . devenv . repositories [ 0 ] . repositoryName : undefined
264
261
targetPath = repo ? `/projects/${ repo } ` : '/projects'
265
262
}
266
- await startVscodeRemote ( env . SessionProcess , getHostNameFromEnv ( env . devenv ) , targetPath , env . vscPath )
263
+ await startVscodeRemote ( env . SessionProcess , env . hostname , targetPath , env . vscPath )
267
264
}
268
265
269
266
// The "codecatalyst_connect" metric should really be splt into two parts:
0 commit comments