File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { RootNode } from '../../awsexplorer/localExplorer'
20
20
import { isCloud9 } from '../../shared/extensionUtilities'
21
21
import { AuthUtil } from '../util/authUtil'
22
22
import { getCodeCatalystDevEnvId } from '../../shared/vscode/env'
23
+ import { getIcon } from '../../shared/icons'
23
24
24
25
export class CodeWhispererNode implements RootNode {
25
26
private readonly isAvailable = getCodeCatalystDevEnvId ( ) === undefined
@@ -37,6 +38,14 @@ export class CodeWhispererNode implements RootNode {
37
38
constructor ( ) { }
38
39
39
40
public getTreeItem ( ) {
41
+ if ( ! this . isAvailable ) {
42
+ const item = new vscode . TreeItem ( 'CodeWhisperer (Preview)' )
43
+ item . description = 'Unavailable in Dev Environment'
44
+ item . iconPath = getIcon ( 'vscode-circle-slash' )
45
+
46
+ return item
47
+ }
48
+
40
49
if ( ! isCloud9 ( ) ) {
41
50
AuthUtil . instance . restore ( )
42
51
}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class AuthUtil {
44
44
45
45
public constructor ( public readonly auth = Auth . instance ) {
46
46
// codewhisperer uses sigv4 creds on C9
47
- if ( isCloud9 ( ) ) {
47
+ if ( isCloud9 ( ) || ! this . isAvailable ) {
48
48
return
49
49
}
50
50
@@ -71,7 +71,7 @@ export class AuthUtil {
71
71
72
72
// current active cwspr connection
73
73
public get conn ( ) {
74
- return this . secondaryAuth . activeConnection
74
+ return this . isAvailable ? this . secondaryAuth . activeConnection : undefined
75
75
}
76
76
77
77
public get isUsingSavedConnection ( ) {
Original file line number Diff line number Diff line change @@ -856,6 +856,7 @@ export const createIamItem = () =>
856
856
( {
857
857
label : codicon `${ getIcon ( 'vscode-key' ) } ${ localize ( 'aws.auth.iamItem.label' , 'Use IAM Credentials' ) } ` ,
858
858
data : 'iam' ,
859
+ onClick : ( ) => telemetry . ui_click . emit ( { elementId : 'connection_optionIAM' } ) ,
859
860
detail : 'Activates working with resources in the Explorer. Not supported by CodeWhisperer. Requires an access key ID and secret access key.' ,
860
861
} as DataQuickPickItem < 'iam' > )
861
862
You can’t perform that action at this time.
0 commit comments