Skip to content

Commit d88329a

Browse files
authored
fix(codecatalyst): do not force-close Cloud9 devenv #3342
Problem: Since eb38055, Toolkit actively exits if the CC devenv is not a "vscode" devenv. But this is incorrect when running in the context of a Cloud9 devenv. NOTE: executeCommand('workbench.action.remote.close') has no effect in Cloud9, but this the code should be corrected anyway. Solution: Skip the condition in Cloud9.
1 parent 9447d1d commit d88329a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/codecatalyst/activation.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { DevEnvClient } from '../shared/clients/devenvClient'
1616
import { watchRestartingDevEnvs } from './reconnect'
1717
import { PromptSettings } from '../shared/settings'
1818
import { dontShow } from '../shared/localizedText'
19-
import { isCloud9 } from '../shared/extensionUtilities'
19+
import { getIdeProperties, isCloud9 } from '../shared/extensionUtilities'
2020
import { Commands } from '../shared/vscode/commands2'
2121
import { getCodeCatalystConfig } from '../shared/clients/codecatalystClient'
2222
import { getThisDevEnv } from './model'
@@ -66,9 +66,11 @@ export async function activate(ctx: ExtContext): Promise<void> {
6666
return undefined
6767
})
6868

69-
if (thisDevenv) {
69+
if (!thisDevenv) {
70+
getLogger().verbose('codecatalyst: not a devenv, getThisDevEnv() returned empty')
71+
} else {
7072
getLogger().info('codecatalyst: Dev Environment ides=%O', thisDevenv?.summary.ides)
71-
if (thisDevenv && !isDevenvVscode(thisDevenv.summary.ides)) {
73+
if (!isCloud9() && thisDevenv && !isDevenvVscode(thisDevenv.summary.ides)) {
7274
// Prevent Toolkit from reconnecting to a "non-vscode" devenv by actively closing it.
7375
// Can happen if devenv is switched to ides="cloud9", etc.
7476
vscode.commands.executeCommand('workbench.action.remote.close')
@@ -81,7 +83,8 @@ export async function activate(ctx: ExtContext): Promise<void> {
8183
if (await settings.isPromptEnabled('remoteConnected')) {
8284
const message = localize(
8385
'AWS.codecatalyst.connectedMessage',
84-
'Welcome to your Amazon CodeCatalyst Dev Environment. For more options and information, view Dev Environment settings (AWS Extension > CodeCatalyst).'
86+
'Welcome to your Amazon CodeCatalyst Dev Environment. For more options and information, view Dev Environment settings ({0} Extension > CodeCatalyst).',
87+
getIdeProperties().company
8588
)
8689
const openDevEnvSettings = localize('AWS.codecatalyst.openDevEnvSettings', 'Open Dev Environment Settings')
8790
vscode.window.showInformationMessage(message, dontShow, openDevEnvSettings).then(selection => {

0 commit comments

Comments
 (0)