-
Notifications
You must be signed in to change notification settings - Fork 492
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 #6330
## Problem Code issues are grouped by severity and while this is useful in some cases, it can be hard to navigate. ## Solution Let the user decide how to group the issues. Grouping strategies to start off with: - Severity (existing behavior) - File Location (issues in the same file are grouped together)
- Loading branch information
Showing
15 changed files
with
388 additions
and
15 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/amazonq/.changes/next-release/Feature-f0d4f2ca-72c5-4434-8cf3-fcd742bf33d7.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": "/review: Code issues can be grouped by file location or severity" | ||
} |
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
45 changes: 45 additions & 0 deletions
45
packages/amazonq/test/unit/codewhisperer/ui/prompters.test.ts
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,45 @@ | ||
/*! | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { createQuickPickPrompterTester, QuickPickPrompterTester } from 'aws-core-vscode/test' | ||
import { | ||
CodeIssueGroupingStrategy, | ||
CodeIssueGroupingStrategyState, | ||
createCodeIssueGroupingStrategyPrompter, | ||
} from 'aws-core-vscode/codewhisperer' | ||
import sinon from 'sinon' | ||
import assert from 'assert' | ||
import vscode from 'vscode' | ||
|
||
const severity = { data: CodeIssueGroupingStrategy.Severity, label: 'Severity' } | ||
const fileLocation = { data: CodeIssueGroupingStrategy.FileLocation, label: 'File Location' } | ||
|
||
describe('createCodeIssueGroupingStrategyPrompter', function () { | ||
let tester: QuickPickPrompterTester<CodeIssueGroupingStrategy> | ||
|
||
beforeEach(function () { | ||
tester = createQuickPickPrompterTester(createCodeIssueGroupingStrategyPrompter()) | ||
}) | ||
|
||
afterEach(function () { | ||
sinon.restore() | ||
}) | ||
|
||
it('should list grouping strategies', async function () { | ||
tester.assertItems([severity, fileLocation]) | ||
tester.hide() | ||
await tester.result() | ||
}) | ||
|
||
it('should update state on selection', async function () { | ||
const originalState = CodeIssueGroupingStrategyState.instance.getState() | ||
assert.equal(originalState, CodeIssueGroupingStrategy.Severity) | ||
|
||
tester.selectItems(fileLocation) | ||
tester.addCallback(() => vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem')) | ||
|
||
await tester.result() | ||
assert.equal(CodeIssueGroupingStrategyState.instance.getState(), fileLocation.data) | ||
}) | ||
}) |
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
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
Oops, something went wrong.