Skip to content

Commit 6701ebd

Browse files
authored
feat(cloud9): hide CodeCatalyst in Cloud9 classic
1 parent e6ad1e2 commit 6701ebd

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/awsexplorer/activation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { submitFeedback } from '../feedback/vue/submitFeedback'
88
import { deleteCloudFormation } from '../lambda/commands/deleteCloudFormation'
99
import { CloudFormationStackNode } from '../lambda/explorer/cloudFormationNodes'
1010
import globals from '../shared/extensionGlobals'
11+
import { isCloud9 } from '../shared/extensionUtilities'
1112
import { ExtContext } from '../shared/extensions'
1213
import { getLogger } from '../shared/logger'
1314
import { RegionProvider } from '../shared/regions/regionProvider'
@@ -77,8 +78,8 @@ export async function activate(args: {
7778
)
7879

7980
const authProvider = CodeCatalystAuthenticationProvider.fromContext(args.context.extensionContext)
80-
const codecatalystNode = new CodeCatalystRootNode(authProvider)
81-
const nodes = [new AuthNode(Auth.instance), codecatalystNode, cdkNode, codewhispererNode]
81+
const codecatalystNode = isCloud9('classic') ? [] : [new CodeCatalystRootNode(authProvider)]
82+
const nodes = [new AuthNode(Auth.instance), ...codecatalystNode, cdkNode, codewhispererNode]
8283
const developerTools = createLocalExplorerView(nodes)
8384
args.context.extensionContext.subscriptions.push(developerTools)
8485

src/shared/extensionUtilities.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ function createCloud9Properties(company: string): IdeProperties {
9898
}
9999

100100
/**
101-
* Returns whether or not this is Cloud9
101+
* Decides if the current system is (the specified flavor of) Cloud9.
102102
*/
103-
export function isCloud9(): boolean {
104-
return getIdeType() === IDE.cloud9
103+
export function isCloud9(flavor: 'classic' | 'codecatalyst' | 'any' = 'any'): boolean {
104+
const cloud9 = getIdeType() === IDE.cloud9
105+
if (!cloud9 || flavor === 'any') {
106+
return cloud9
107+
}
108+
const codecat = getCodeCatalystDevEnvId() !== undefined
109+
return (flavor === 'classic' && !codecat) || (flavor === 'codecatalyst' && codecat)
105110
}
106111

107112
export function isCn(): boolean {

0 commit comments

Comments
 (0)