Skip to content

Commit 6a6e9b1

Browse files
Merge pull request #1 from Rathore25/code-review-tool
Code review tool
2 parents 98b1265 + 3ed1c1a commit 6a6e9b1

File tree

178 files changed

+23153
-5686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+23153
-5686
lines changed

package-lock.json

Lines changed: 9110 additions & 4826 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
4242
},
4343
"devDependencies": {
44-
"@aws-toolkits/telemetry": "^1.0.324",
44+
"@aws-toolkits/telemetry": "^1.0.326",
4545
"@playwright/browser-chromium": "^1.43.1",
4646
"@stylistic/eslint-plugin": "^2.11.0",
4747
"@types/he": "^1.2.3",
48+
"@types/jaro-winkler": "^0.2.4",
4849
"@types/vscode": "^1.68.0",
4950
"@types/vscode-webview": "^1.57.1",
5051
"@types/webpack-env": "^1.18.5",
@@ -74,6 +75,7 @@
7475
},
7576
"dependencies": {
7677
"@types/node": "^22.7.5",
78+
"jaro-winkler": "^0.2.8",
7779
"vscode-nls": "^5.2.0",
7880
"vscode-nls-dev": "^4.0.4"
7981
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2025-06-20",
3+
"version": "1.78.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Resolve missing chat options in Amazon Q chat interface."
8+
}
9+
]
10+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"date": "2025-06-25",
3+
"version": "1.79.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Added automatic system certificate detection and VSCode proxy settings support"
8+
},
9+
{
10+
"type": "Bug Fix",
11+
"description": "Improved Amazon Linux 2 support with better SageMaker environment detection"
12+
},
13+
{
14+
"type": "Feature",
15+
"description": "/transform: run all builds client-side"
16+
}
17+
]
18+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"date": "2025-07-01",
3+
"version": "1.80.0",
4+
"entries": []
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2025-07-02",
3+
"version": "1.81.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Stop auto inline completion when deleting code"
8+
}
9+
]
10+
}

packages/amazonq/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 1.81.0 2025-07-02
2+
3+
- **Bug Fix** Stop auto inline completion when deleting code
4+
5+
## 1.80.0 2025-07-01
6+
7+
- Miscellaneous non-user-facing changes
8+
9+
## 1.79.0 2025-06-25
10+
11+
- **Bug Fix** Added automatic system certificate detection and VSCode proxy settings support
12+
- **Bug Fix** Improved Amazon Linux 2 support with better SageMaker environment detection
13+
- **Feature** /transform: run all builds client-side
14+
15+
## 1.78.0 2025-06-20
16+
17+
- **Bug Fix** Resolve missing chat options in Amazon Q chat interface.
18+
119
## 1.77.0 2025-06-18
220

321
- Miscellaneous non-user-facing changes

packages/amazonq/package.json

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
44
"description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
5-
"version": "1.78.0-SNAPSHOT",
5+
"version": "1.82.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],
@@ -835,6 +835,18 @@
835835
"command": "aws.amazonq.clearCache",
836836
"title": "%AWS.amazonq.clearCache%",
837837
"category": "%AWS.amazonq.title%"
838+
},
839+
{
840+
"command": "aws.amazonq.inline.acceptEdit",
841+
"title": "%aws.amazonq.inline.acceptEdit%"
842+
},
843+
{
844+
"command": "aws.amazonq.inline.rejectEdit",
845+
"title": "%aws.amazonq.inline.rejectEdit%"
846+
},
847+
{
848+
"command": "aws.amazonq.toggleNextEditPredictionPanel",
849+
"title": "%aws.amazonq.toggleNextEditPredictionPanel%"
838850
}
839851
],
840852
"keybindings": [
@@ -844,6 +856,18 @@
844856
"mac": "cmd+alt+i",
845857
"linux": "meta+alt+i"
846858
},
859+
{
860+
"command": "aws.amazonq.inline.debugAcceptEdit",
861+
"key": "ctrl+alt+a",
862+
"mac": "cmd+alt+a",
863+
"when": "editorTextFocus"
864+
},
865+
{
866+
"command": "aws.amazonq.inline.debugRejectEdit",
867+
"key": "ctrl+alt+r",
868+
"mac": "cmd+alt+r",
869+
"when": "editorTextFocus"
870+
},
847871
{
848872
"command": "aws.amazonq.explainCode",
849873
"win": "win+alt+e",
@@ -924,6 +948,16 @@
924948
"command": "aws.amazonq.inline.waitForUserDecisionRejectAll",
925949
"key": "escape",
926950
"when": "editorTextFocus && aws.codewhisperer.connected && amazonq.inline.codelensShortcutEnabled"
951+
},
952+
{
953+
"command": "aws.amazonq.inline.acceptEdit",
954+
"key": "tab",
955+
"when": "editorTextFocus && aws.amazonq.editSuggestionActive"
956+
},
957+
{
958+
"command": "aws.amazonq.inline.rejectEdit",
959+
"key": "escape",
960+
"when": "editorTextFocus && aws.amazonq.editSuggestionActive"
927961
}
928962
],
929963
"icons": {
@@ -1200,110 +1234,124 @@
12001234
"fontCharacter": "\\f1d0"
12011235
}
12021236
},
1203-
"aws-lambda-function": {
1237+
"aws-lambda-create-stack": {
12041238
"description": "AWS Contributed Icon",
12051239
"default": {
12061240
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12071241
"fontCharacter": "\\f1d1"
12081242
}
12091243
},
1210-
"aws-mynah-MynahIconBlack": {
1244+
"aws-lambda-create-stack-light": {
12111245
"description": "AWS Contributed Icon",
12121246
"default": {
12131247
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12141248
"fontCharacter": "\\f1d2"
12151249
}
12161250
},
1217-
"aws-mynah-MynahIconWhite": {
1251+
"aws-lambda-function": {
12181252
"description": "AWS Contributed Icon",
12191253
"default": {
12201254
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12211255
"fontCharacter": "\\f1d3"
12221256
}
12231257
},
1224-
"aws-mynah-logo": {
1258+
"aws-mynah-MynahIconBlack": {
12251259
"description": "AWS Contributed Icon",
12261260
"default": {
12271261
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12281262
"fontCharacter": "\\f1d4"
12291263
}
12301264
},
1231-
"aws-redshift-cluster": {
1265+
"aws-mynah-MynahIconWhite": {
12321266
"description": "AWS Contributed Icon",
12331267
"default": {
12341268
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12351269
"fontCharacter": "\\f1d5"
12361270
}
12371271
},
1238-
"aws-redshift-cluster-connected": {
1272+
"aws-mynah-logo": {
12391273
"description": "AWS Contributed Icon",
12401274
"default": {
12411275
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12421276
"fontCharacter": "\\f1d6"
12431277
}
12441278
},
1245-
"aws-redshift-database": {
1279+
"aws-redshift-cluster": {
12461280
"description": "AWS Contributed Icon",
12471281
"default": {
12481282
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12491283
"fontCharacter": "\\f1d7"
12501284
}
12511285
},
1252-
"aws-redshift-redshift-cluster-connected": {
1286+
"aws-redshift-cluster-connected": {
12531287
"description": "AWS Contributed Icon",
12541288
"default": {
12551289
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12561290
"fontCharacter": "\\f1d8"
12571291
}
12581292
},
1259-
"aws-redshift-schema": {
1293+
"aws-redshift-database": {
12601294
"description": "AWS Contributed Icon",
12611295
"default": {
12621296
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12631297
"fontCharacter": "\\f1d9"
12641298
}
12651299
},
1266-
"aws-redshift-table": {
1300+
"aws-redshift-redshift-cluster-connected": {
12671301
"description": "AWS Contributed Icon",
12681302
"default": {
12691303
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12701304
"fontCharacter": "\\f1da"
12711305
}
12721306
},
1273-
"aws-s3-bucket": {
1307+
"aws-redshift-schema": {
12741308
"description": "AWS Contributed Icon",
12751309
"default": {
12761310
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12771311
"fontCharacter": "\\f1db"
12781312
}
12791313
},
1280-
"aws-s3-create-bucket": {
1314+
"aws-redshift-table": {
12811315
"description": "AWS Contributed Icon",
12821316
"default": {
12831317
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12841318
"fontCharacter": "\\f1dc"
12851319
}
12861320
},
1287-
"aws-schemas-registry": {
1321+
"aws-s3-bucket": {
12881322
"description": "AWS Contributed Icon",
12891323
"default": {
12901324
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12911325
"fontCharacter": "\\f1dd"
12921326
}
12931327
},
1294-
"aws-schemas-schema": {
1328+
"aws-s3-create-bucket": {
12951329
"description": "AWS Contributed Icon",
12961330
"default": {
12971331
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12981332
"fontCharacter": "\\f1de"
12991333
}
13001334
},
1301-
"aws-stepfunctions-preview": {
1335+
"aws-schemas-registry": {
13021336
"description": "AWS Contributed Icon",
13031337
"default": {
13041338
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13051339
"fontCharacter": "\\f1df"
13061340
}
1341+
},
1342+
"aws-schemas-schema": {
1343+
"description": "AWS Contributed Icon",
1344+
"default": {
1345+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1346+
"fontCharacter": "\\f1e0"
1347+
}
1348+
},
1349+
"aws-stepfunctions-preview": {
1350+
"description": "AWS Contributed Icon",
1351+
"default": {
1352+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1353+
"fontCharacter": "\\f1e1"
1354+
}
13071355
}
13081356
},
13091357
"walkthroughs": [
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
// TODO: deprecate this file in favor of core/shared/utils/diffUtils
6+
import { applyPatch } from 'diff'
7+
8+
export type LineDiff =
9+
| { type: 'added'; content: string }
10+
| { type: 'removed'; content: string }
11+
| { type: 'modified'; before: string; after: string }
12+
13+
/**
14+
* Apply a unified diff to original code to generate modified code
15+
* @param originalCode The original code as a string
16+
* @param unifiedDiff The unified diff content
17+
* @returns The modified code after applying the diff
18+
*/
19+
export function applyUnifiedDiff(docText: string, unifiedDiff: string): string {
20+
try {
21+
// First try the standard diff package
22+
try {
23+
const result = applyPatch(docText, unifiedDiff)
24+
if (result !== false) {
25+
return result
26+
}
27+
} catch (error) {}
28+
29+
// Parse the unified diff to extract the changes
30+
const diffLines = unifiedDiff.split('\n')
31+
let result = docText
32+
33+
// Find all hunks in the diff
34+
const hunkStarts = diffLines
35+
.map((line, index) => (line.startsWith('@@ ') ? index : -1))
36+
.filter((index) => index !== -1)
37+
38+
// Process each hunk
39+
for (const hunkStart of hunkStarts) {
40+
// Parse the hunk header
41+
const hunkHeader = diffLines[hunkStart]
42+
const match = hunkHeader.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/)
43+
44+
if (!match) {
45+
continue
46+
}
47+
48+
const oldStart = parseInt(match[1])
49+
const oldLines = parseInt(match[2])
50+
51+
// Extract the content lines for this hunk
52+
let i = hunkStart + 1
53+
const contentLines = []
54+
while (i < diffLines.length && !diffLines[i].startsWith('@@')) {
55+
contentLines.push(diffLines[i])
56+
i++
57+
}
58+
59+
// Build the old and new text
60+
let oldText = ''
61+
let newText = ''
62+
63+
for (const line of contentLines) {
64+
if (line.startsWith('-')) {
65+
oldText += line.substring(1) + '\n'
66+
} else if (line.startsWith('+')) {
67+
newText += line.substring(1) + '\n'
68+
} else if (line.startsWith(' ')) {
69+
oldText += line.substring(1) + '\n'
70+
newText += line.substring(1) + '\n'
71+
}
72+
}
73+
74+
// Remove trailing newline if it was added
75+
oldText = oldText.replace(/\n$/, '')
76+
newText = newText.replace(/\n$/, '')
77+
78+
// Find the text to replace in the document
79+
const docLines = docText.split('\n')
80+
const startLine = oldStart - 1 // Convert to 0-based
81+
const endLine = startLine + oldLines
82+
83+
// Extract the text that should be replaced
84+
const textToReplace = docLines.slice(startLine, endLine).join('\n')
85+
86+
// Replace the text
87+
result = result.replace(textToReplace, newText)
88+
}
89+
return result
90+
} catch (error) {
91+
return docText // Return original text if all methods fail
92+
}
93+
}

0 commit comments

Comments
 (0)