Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7343511
migrate process env proxy settings to proxyUtil.ts
samgst-amazon Jun 23, 2025
7b6252f
remove env merging from createServerOptions
samgst-amazon Jun 23, 2025
ebfbc66
No need to set CA certs when SSL verification is disabled
samgst-amazon Jun 23, 2025
771fae8
fix(stepfunctions): Add document URI check for save telemetry and ena…
l0minous Jun 24, 2025
f1dc9b8
feat(amazonq): enable client-side build (#7226)
dhasani23 Jun 24, 2025
3e41c83
changelog
samgst-amazon Jun 24, 2025
696e143
missing await
samgst-amazon Jun 24, 2025
eaf969c
fix(amazonq): migrate process.env proxy setting handling to proxyUtil.ts
samgst-amazon Jun 24, 2025
f5cf3bd
fix(amazonq): fix for amazon q app initialization failure on sagemaker
ashishrp-aws Jun 25, 2025
b3ad9a8
Merge branch 'aws:master' into fix/sagemaker
ashishrp-aws Jun 25, 2025
cac600f
fix(amazonq): minor text update (#7554)
dhasani23 Jun 25, 2025
053a5bd
fix(amazonq): fix to move isSagemaker to env
ashishrp-aws Jun 25, 2025
1ab1ad2
Merge pull request #7551 from ashishrp-aws/fix/sagemaker
ashishrp-aws Jun 25, 2025
05c57ff
Release 1.79.0
Jun 25, 2025
787a3bc
Release 3.67.0
Jun 25, 2025
926b86a
Update version to snapshot version: 3.68.0-SNAPSHOT
Jun 25, 2025
fd252bb
Update version to snapshot version: 1.80.0-SNAPSHOT
Jun 25, 2025
46766be
Merge release into master
Jun 25, 2025
00d7c13
fix(amazonq): Re-enable experimental proxy support
tsmithsz Jun 25, 2025
0b76f7f
Merge pull request #7556 from tsmithsz/fix-amazonq-proxy
tsmithsz Jun 25, 2025
e07833d
refactor(stepfunctions): migrate to sdkv3 (#7560)
Jun 27, 2025
dfa7e51
fix(amazonq): Remove incompatible Node 18 flag
tsmithsz Jun 27, 2025
9616260
Merge pull request #7568 from tsmithsz/remove-flag
tsmithsz Jun 27, 2025
9bd9d99
feat(amazonq): Add next edit suggestion (#7555)
floralph Jun 30, 2025
271f592
fix(amazonq): update cursor tracking based on autotrigger setting
floralph Jun 30, 2025
699e00e
fix(amazonq): handling of CodeSuggestionState in tests
floralph Jun 30, 2025
bfdb0eb
Merge pull request #7585 from aws/floralph/cursor-manager-track-autot…
floralph Jun 30, 2025
cc16aa6
Merge master into feature/stepfunctions-execution
Jun 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
702 changes: 690 additions & 12 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@playwright/browser-chromium": "^1.43.1",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/he": "^1.2.3",
"@types/jaro-winkler": "^0.2.4",
"@types/vscode": "^1.68.0",
"@types/vscode-webview": "^1.57.1",
"@types/webpack-env": "^1.18.5",
Expand Down Expand Up @@ -74,6 +75,7 @@
},
"dependencies": {
"@types/node": "^22.7.5",
"jaro-winkler": "^0.2.8",
"vscode-nls": "^5.2.0",
"vscode-nls-dev": "^4.0.4"
}
Expand Down
18 changes: 18 additions & 0 deletions packages/amazonq/.changes/1.79.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"date": "2025-06-25",
"version": "1.79.0",
"entries": [
{
"type": "Bug Fix",
"description": "Added automatic system certificate detection and VSCode proxy settings support"
},
{
"type": "Bug Fix",
"description": "Improved Amazon Linux 2 support with better SageMaker environment detection"
},
{
"type": "Feature",
"description": "/transform: run all builds client-side"
}
]
}
6 changes: 6 additions & 0 deletions packages/amazonq/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.79.0 2025-06-25

- **Bug Fix** Added automatic system certificate detection and VSCode proxy settings support
- **Bug Fix** Improved Amazon Linux 2 support with better SageMaker environment detection
- **Feature** /transform: run all builds client-side

## 1.78.0 2025-06-20

- **Bug Fix** Resolve missing chat options in Amazon Q chat interface.
Expand Down
36 changes: 35 additions & 1 deletion packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "amazon-q-vscode",
"displayName": "Amazon Q",
"description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
"version": "1.79.0-SNAPSHOT",
"version": "1.80.0-SNAPSHOT",
"extensionKind": [
"workspace"
],
Expand Down Expand Up @@ -828,6 +828,18 @@
"command": "aws.amazonq.clearCache",
"title": "%AWS.amazonq.clearCache%",
"category": "%AWS.amazonq.title%"
},
{
"command": "aws.amazonq.inline.acceptEdit",
"title": "%aws.amazonq.inline.acceptEdit%"
},
{
"command": "aws.amazonq.inline.rejectEdit",
"title": "%aws.amazonq.inline.rejectEdit%"
},
{
"command": "aws.amazonq.toggleNextEditPredictionPanel",
"title": "%aws.amazonq.toggleNextEditPredictionPanel%"
}
],
"keybindings": [
Expand All @@ -837,6 +849,18 @@
"mac": "cmd+alt+i",
"linux": "meta+alt+i"
},
{
"command": "aws.amazonq.inline.debugAcceptEdit",
"key": "ctrl+alt+a",
"mac": "cmd+alt+a",
"when": "editorTextFocus"
},
{
"command": "aws.amazonq.inline.debugRejectEdit",
"key": "ctrl+alt+r",
"mac": "cmd+alt+r",
"when": "editorTextFocus"
},
{
"command": "aws.amazonq.explainCode",
"win": "win+alt+e",
Expand Down Expand Up @@ -917,6 +941,16 @@
"command": "aws.amazonq.inline.waitForUserDecisionRejectAll",
"key": "escape",
"when": "editorTextFocus && aws.codewhisperer.connected && amazonq.inline.codelensShortcutEnabled"
},
{
"command": "aws.amazonq.inline.acceptEdit",
"key": "tab",
"when": "editorTextFocus && aws.amazonq.editSuggestionActive"
},
{
"command": "aws.amazonq.inline.rejectEdit",
"key": "escape",
"when": "editorTextFocus && aws.amazonq.editSuggestionActive"
}
],
"icons": {
Expand Down
142 changes: 142 additions & 0 deletions packages/amazonq/src/app/inline/EditRendering/diffUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*!
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO: deprecate this file in favor of core/shared/utils/diffUtils
import { applyPatch } from 'diff'

export type LineDiff =
| { type: 'added'; content: string }
| { type: 'removed'; content: string }
| { type: 'modified'; before: string; after: string }

/**
* Apply a unified diff to original code to generate modified code
* @param originalCode The original code as a string
* @param unifiedDiff The unified diff content
* @returns The modified code after applying the diff
*/
export function applyUnifiedDiff(
docText: string,
unifiedDiff: string
): { appliedCode: string; addedCharacterCount: number; deletedCharacterCount: number } {
try {
const { addedCharacterCount, deletedCharacterCount } = getAddedAndDeletedCharCount(unifiedDiff)
// First try the standard diff package
try {
const result = applyPatch(docText, unifiedDiff)
if (result !== false) {
return {
appliedCode: result,
addedCharacterCount: addedCharacterCount,
deletedCharacterCount: deletedCharacterCount,
}
}
} catch (error) {}

// Parse the unified diff to extract the changes
const diffLines = unifiedDiff.split('\n')
let result = docText

// Find all hunks in the diff
const hunkStarts = diffLines
.map((line, index) => (line.startsWith('@@ ') ? index : -1))
.filter((index) => index !== -1)

// Process each hunk
for (const hunkStart of hunkStarts) {
// Parse the hunk header
const hunkHeader = diffLines[hunkStart]
const match = hunkHeader.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/)

if (!match) {
continue
}

const oldStart = parseInt(match[1])
const oldLines = parseInt(match[2])

// Extract the content lines for this hunk
let i = hunkStart + 1
const contentLines = []
while (i < diffLines.length && !diffLines[i].startsWith('@@')) {
contentLines.push(diffLines[i])
i++
}

// Build the old and new text
let oldText = ''
let newText = ''

for (const line of contentLines) {
if (line.startsWith('-')) {
oldText += line.substring(1) + '\n'
} else if (line.startsWith('+')) {
newText += line.substring(1) + '\n'
} else if (line.startsWith(' ')) {
oldText += line.substring(1) + '\n'
newText += line.substring(1) + '\n'
}
}

// Remove trailing newline if it was added
oldText = oldText.replace(/\n$/, '')
newText = newText.replace(/\n$/, '')

// Find the text to replace in the document
const docLines = docText.split('\n')
const startLine = oldStart - 1 // Convert to 0-based
const endLine = startLine + oldLines

// Extract the text that should be replaced
const textToReplace = docLines.slice(startLine, endLine).join('\n')

// Replace the text
result = result.replace(textToReplace, newText)
}
return {
appliedCode: result,
addedCharacterCount: addedCharacterCount,
deletedCharacterCount: deletedCharacterCount,
}
} catch (error) {
return {
appliedCode: docText, // Return original text if all methods fail
addedCharacterCount: 0,
deletedCharacterCount: 0,
}
}
}

export function getAddedAndDeletedCharCount(diff: string): {
addedCharacterCount: number
deletedCharacterCount: number
} {
let addedCharacterCount = 0
let deletedCharacterCount = 0
let i = 0
const lines = diff.split('\n')
while (i < lines.length) {
const line = lines[i]
if (line.startsWith('+') && !line.startsWith('+++')) {
addedCharacterCount += line.length - 1
} else if (line.startsWith('-') && !line.startsWith('---')) {
const removedLine = line.substring(1)
deletedCharacterCount += removedLine.length

// Check if this is a modified line rather than a pure deletion
const nextLine = lines[i + 1]
if (nextLine && nextLine.startsWith('+') && !nextLine.startsWith('+++') && nextLine.includes(removedLine)) {
// This is a modified line, not a pure deletion
// We've already counted the deletion, so we'll just increment i to skip the next line
// since we'll process the addition on the next iteration
i += 1
}
}
i += 1
}
return {
addedCharacterCount,
deletedCharacterCount,
}
}
Loading
Loading