File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,11 @@ import { Commands } from '../../shared/vscode/commands2'
19
19
import { RootNode } from '../../awsexplorer/localExplorer'
20
20
import { isCloud9 } from '../../shared/extensionUtilities'
21
21
import { AuthUtil } from '../util/authUtil'
22
+ import { getCodeCatalystDevEnvId } from '../../shared/vscode/env'
22
23
23
24
export class CodeWhispererNode implements RootNode {
25
+ private readonly isAvailable = getCodeCatalystDevEnvId ( ) === undefined
26
+
24
27
public readonly id = 'codewhisperer'
25
28
public readonly resource = this
26
29
private readonly onDidChangeChildrenEmitter = new vscode . EventEmitter < void > ( )
@@ -70,6 +73,10 @@ export class CodeWhispererNode implements RootNode {
70
73
}
71
74
72
75
public getChildren ( ) {
76
+ if ( ! this . isAvailable ) {
77
+ return [ ]
78
+ }
79
+
73
80
const termsAccepted = globals . context . globalState . get < boolean > ( CodeWhispererConstants . termsAcceptedKey )
74
81
const autoTriggerEnabled =
75
82
globals . context . globalState . get < boolean > ( CodeWhispererConstants . autoTriggerEnabledKey ) || false
Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ import { Commands } from '../../shared/vscode/commands2'
23
23
import { isCloud9 } from '../../shared/extensionUtilities'
24
24
import { TelemetryHelper } from './telemetryHelper'
25
25
import { CancellationError } from '../../shared/utilities/timeoutUtils'
26
+ import { getCodeCatalystDevEnvId } from '../../shared/vscode/env'
26
27
27
28
export const awsBuilderIdSsoProfile = createBuilderIdProfile ( )
28
29
// No connections are valid within C9
29
30
const isValidCodeWhispererConnection = ( conn : Connection ) : conn is SsoConnection =>
30
31
! isCloud9 ( ) && conn . type === 'sso' && codewhispererScopes . every ( s => conn . scopes ?. includes ( s ) )
31
32
32
33
export class AuthUtil {
34
+ private readonly isAvailable = getCodeCatalystDevEnvId ( ) === undefined
33
35
static #instance: AuthUtil
34
36
35
37
private usingEnterpriseSSO : boolean = false
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ import { AwsResourceManager } from './dynamicResources/awsResourceManager'
62
62
import globals , { initialize } from './shared/extensionGlobals'
63
63
import { join } from 'path'
64
64
import { Experiments , Settings } from './shared/settings'
65
- import { isReleaseVersion } from './shared/vscode/env'
65
+ import { getCodeCatalystDevEnvId , isReleaseVersion } from './shared/vscode/env'
66
66
import { Commands , registerErrorHandler } from './shared/vscode/commands2'
67
67
import { isUserCancelledError , ToolkitError } from './shared/errors'
68
68
import { Logging } from './shared/logger/commands'
@@ -215,7 +215,9 @@ export async function activate(context: vscode.ExtensionContext) {
215
215
216
216
await activateS3 ( extContext )
217
217
218
- await activateCodeWhisperer ( extContext )
218
+ if ( getCodeCatalystDevEnvId ( ) === undefined ) {
219
+ await activateCodeWhisperer ( extContext )
220
+ }
219
221
220
222
await activateEcr ( context )
221
223
You can’t perform that action at this time.
0 commit comments