-
Notifications
You must be signed in to change notification settings - Fork 273
feat(amazonq): Enable one-click collection of logs from chat #5923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
04cfd8a
563986f
22b6735
244cffa
4594a25
48d6e14
97b0bd7
aa0072a
7e8addd
8d9284d
5925e9b
9e29e32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||||||
// SPDX-License-Identifier: Apache-2.0 | ||||||
|
||||||
package software.aws.toolkits.jetbrains.services.amazonq | ||||||
|
||||||
import com.intellij.openapi.actionSystem.ActionManager | ||||||
import com.intellij.openapi.actionSystem.ActionPlaces | ||||||
import com.intellij.openapi.actionSystem.ActionUiKind | ||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||||||
import com.intellij.openapi.actionSystem.AnActionEvent | ||||||
import com.intellij.openapi.actionSystem.CommonDataKeys | ||||||
import com.intellij.openapi.actionSystem.impl.SimpleDataContext | ||||||
import com.intellij.openapi.project.DumbAwareAction | ||||||
import com.intellij.openapi.project.Project | ||||||
import com.intellij.openapi.util.IconLoader | ||||||
import com.intellij.ui.ColorUtil | ||||||
import com.intellij.ui.JBColor | ||||||
import com.intellij.util.IconUtil | ||||||
import com.intellij.util.ui.UIUtil | ||||||
import software.aws.toolkits.jetbrains.utils.notifyInfo | ||||||
import software.aws.toolkits.resources.AmazonQBundle | ||||||
import software.aws.toolkits.resources.AmazonQBundle.message | ||||||
|
||||||
class GetAmazonQLogsAction : DumbAwareAction( | ||||||
AmazonQBundle.message("amazonq.getLogs.tooltip.text") | ||||||
|
||||||
) { | ||||||
|
||||||
override fun update(e: AnActionEvent) { | ||||||
super.update(e) | ||||||
manodnyab marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
val baseIcon = IconLoader.getIcon("/icons/file.svg", GetAmazonQLogsAction::class.java) | ||||||
|
||||||
e.presentation.icon = if (!JBColor.isBright()) { | ||||||
baseIcon | ||||||
} else { | ||||||
IconUtil.colorize(baseIcon, ColorUtil.brighter(UIUtil.getLabelForeground(), 2)) | ||||||
} | ||||||
} | ||||||
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT | ||||||
override fun actionPerformed(e: AnActionEvent) { | ||||||
val project = e.project ?: return | ||||||
showLogCollectionWarningGetLogs(project) | ||||||
} | ||||||
|
||||||
companion object { | ||||||
Check warning on line 44 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
|
||||||
|
||||||
fun showLogCollectionWarningGetLogs(project: Project) { | ||||||
try { | ||||||
val action = ActionManager.getInstance().getAction("CollectZippedLogs") | ||||||
val datacontxt = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() | ||||||
|
val datacontxt = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() | |
val dataContext = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is technically internal so we should have a test
Check warning on line 50 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
GitHub Actions / Qodana Community for JVM
Method can only be overridden
Method 'actionPerformed(com.intellij.openapi.actionSystem.@org.jetbrains.annotations.NotNull AnActionEvent)' can only be overridden
Uh oh!
There was an error while loading. Please reload this page.