File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/commands Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+
4+ package software.aws.toolkits.jetbrains.services.cwc.commands
5+
6+ import com.intellij.openapi.actionSystem.AnActionEvent
7+ import com.intellij.openapi.actionSystem.CommonDataKeys
8+ import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection
9+ import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager
10+ import software.aws.toolkits.jetbrains.core.credentials.pinning.QConnection
11+
12+ class GenerateUnitTestsAction : CustomAction (EditorContextCommand .GenerateUnitTests ) {
13+ override fun update (e : AnActionEvent ) {
14+ val project = e.getData(CommonDataKeys .PROJECT ) ? : return
15+ val connection = ToolkitConnectionManager .getInstance(project).activeConnectionForFeature(QConnection .getInstance()) as ? AwsBearerTokenConnection
16+ e.presentation.isEnabledAndVisible = connection?.startUrl == " https://amzn.awsapps.com/start"
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments