forked from aws/aws-toolkit-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(amazonq): add button to view diff in IDE (aws#5338)
Add `Accept Diff` & `View Diff` button to Amazon Q for auto generated code. https://github.com/user-attachments/assets/2bd6cf19-0649-4355-8ac5-7eb87bfe27fb ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Showing
29 changed files
with
754 additions
and
64 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/amazonq/.changes/next-release/Feature-3ebcda93-ca02-4682-b475-dead26e94900.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": "Add buttons to code blocks to view and accept diffs." | ||
} |
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
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,24 @@ | ||
/*! | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* Converts an array of key-value pairs into a Map object. | ||
* | ||
* @param {[unknown, unknown][]} arr - An array of tuples, where each tuple represents a key-value pair. | ||
* @returns {Map<unknown, unknown>} A new Map object created from the input array. | ||
* If the conversion fails, an empty Map is returned. | ||
* | ||
* @example | ||
* const array = [['key1', 'value1'], ['key2', 'value2']]; | ||
* const map = tryNewMap(array); | ||
* // map is now a Map object with entries: { 'key1' => 'value1', 'key2' => 'value2' } | ||
*/ | ||
export function tryNewMap(arr: [unknown, unknown][]) { | ||
try { | ||
return new Map(arr) | ||
} catch (error) { | ||
return new Map() | ||
} | ||
} |
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.