-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(amazonq): grouping options for code issues (#5314)
- Loading branch information
Showing
6 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
.changes/next-release/feature-6565a79c-90f3-4d49-abb6-ca4d5c0ff679.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type" : "feature", | ||
"description" : "Amazon Q /review: Code issues can now be grouped by severity or file location." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...rvices/codewhisperer/codescan/actions/CodeWhispererCodeScanGroupingStrategyActionGroup.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.services.codewhisperer.codescan.actions | ||
|
||
import com.intellij.openapi.actionSystem.ActionGroup | ||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.ex.CheckboxAction | ||
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.CodeWhispererCodeScanManager | ||
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.utils.IssueGroupingStrategy | ||
|
||
class CodeWhispererCodeScanGroupingStrategyActionGroup : ActionGroup() { | ||
override fun getChildren(e: AnActionEvent?): Array<out AnAction> = IssueGroupingStrategy.entries.map { GroupByAction(it) }.toTypedArray() | ||
|
||
private class GroupByAction(private val groupingStrategy: IssueGroupingStrategy) : CheckboxAction() { | ||
override fun getActionUpdateThread() = ActionUpdateThread.BGT | ||
|
||
override fun isSelected(event: AnActionEvent): Boolean { | ||
val project = event.project ?: return false | ||
return CodeWhispererCodeScanManager.getInstance(project).getGroupingStrategySelected() == groupingStrategy | ||
} | ||
|
||
override fun setSelected(event: AnActionEvent, state: Boolean) { | ||
val project = event.project ?: return | ||
if (state) { | ||
CodeWhispererCodeScanManager.getInstance(project).setGroupingStrategySelected(groupingStrategy) | ||
} | ||
} | ||
|
||
override fun update(e: AnActionEvent) { | ||
super.update(e) | ||
e.presentation.text = groupingStrategy.displayName | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters