Skip to content

Commit 53ed216

Browse files
authored
Merge branch 'master' into reRoute
2 parents 7ad832b + 14242d6 commit 53ed216

File tree

126 files changed

+18769
-5361
lines changed

Some content is hidden

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

126 files changed

+18769
-5361
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
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",
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+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2025-07-07",
3+
"version": "1.82.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Prompt re-authenticate if auto trigger failed with expired token"
8+
}
9+
]
10+
}

packages/amazonq/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 1.82.0 2025-07-07
2+
3+
- **Bug Fix** Prompt re-authenticate if auto trigger failed with expired token
4+
5+
## 1.81.0 2025-07-02
6+
7+
- **Bug Fix** Stop auto inline completion when deleting code
8+
9+
## 1.80.0 2025-07-01
10+
11+
- Miscellaneous non-user-facing changes
12+
113
## 1.79.0 2025-06-25
214

315
- **Bug Fix** Added automatic system certificate detection and VSCode proxy settings support

packages/amazonq/package.json

Lines changed: 30 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.80.0-SNAPSHOT",
5+
"version": "1.83.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],
@@ -1227,110 +1227,124 @@
12271227
"fontCharacter": "\\f1d0"
12281228
}
12291229
},
1230-
"aws-lambda-function": {
1230+
"aws-lambda-create-stack": {
12311231
"description": "AWS Contributed Icon",
12321232
"default": {
12331233
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12341234
"fontCharacter": "\\f1d1"
12351235
}
12361236
},
1237-
"aws-mynah-MynahIconBlack": {
1237+
"aws-lambda-create-stack-light": {
12381238
"description": "AWS Contributed Icon",
12391239
"default": {
12401240
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12411241
"fontCharacter": "\\f1d2"
12421242
}
12431243
},
1244-
"aws-mynah-MynahIconWhite": {
1244+
"aws-lambda-function": {
12451245
"description": "AWS Contributed Icon",
12461246
"default": {
12471247
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12481248
"fontCharacter": "\\f1d3"
12491249
}
12501250
},
1251-
"aws-mynah-logo": {
1251+
"aws-mynah-MynahIconBlack": {
12521252
"description": "AWS Contributed Icon",
12531253
"default": {
12541254
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12551255
"fontCharacter": "\\f1d4"
12561256
}
12571257
},
1258-
"aws-redshift-cluster": {
1258+
"aws-mynah-MynahIconWhite": {
12591259
"description": "AWS Contributed Icon",
12601260
"default": {
12611261
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12621262
"fontCharacter": "\\f1d5"
12631263
}
12641264
},
1265-
"aws-redshift-cluster-connected": {
1265+
"aws-mynah-logo": {
12661266
"description": "AWS Contributed Icon",
12671267
"default": {
12681268
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12691269
"fontCharacter": "\\f1d6"
12701270
}
12711271
},
1272-
"aws-redshift-database": {
1272+
"aws-redshift-cluster": {
12731273
"description": "AWS Contributed Icon",
12741274
"default": {
12751275
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12761276
"fontCharacter": "\\f1d7"
12771277
}
12781278
},
1279-
"aws-redshift-redshift-cluster-connected": {
1279+
"aws-redshift-cluster-connected": {
12801280
"description": "AWS Contributed Icon",
12811281
"default": {
12821282
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12831283
"fontCharacter": "\\f1d8"
12841284
}
12851285
},
1286-
"aws-redshift-schema": {
1286+
"aws-redshift-database": {
12871287
"description": "AWS Contributed Icon",
12881288
"default": {
12891289
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12901290
"fontCharacter": "\\f1d9"
12911291
}
12921292
},
1293-
"aws-redshift-table": {
1293+
"aws-redshift-redshift-cluster-connected": {
12941294
"description": "AWS Contributed Icon",
12951295
"default": {
12961296
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12971297
"fontCharacter": "\\f1da"
12981298
}
12991299
},
1300-
"aws-s3-bucket": {
1300+
"aws-redshift-schema": {
13011301
"description": "AWS Contributed Icon",
13021302
"default": {
13031303
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13041304
"fontCharacter": "\\f1db"
13051305
}
13061306
},
1307-
"aws-s3-create-bucket": {
1307+
"aws-redshift-table": {
13081308
"description": "AWS Contributed Icon",
13091309
"default": {
13101310
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13111311
"fontCharacter": "\\f1dc"
13121312
}
13131313
},
1314-
"aws-schemas-registry": {
1314+
"aws-s3-bucket": {
13151315
"description": "AWS Contributed Icon",
13161316
"default": {
13171317
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13181318
"fontCharacter": "\\f1dd"
13191319
}
13201320
},
1321-
"aws-schemas-schema": {
1321+
"aws-s3-create-bucket": {
13221322
"description": "AWS Contributed Icon",
13231323
"default": {
13241324
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13251325
"fontCharacter": "\\f1de"
13261326
}
13271327
},
1328-
"aws-stepfunctions-preview": {
1328+
"aws-schemas-registry": {
13291329
"description": "AWS Contributed Icon",
13301330
"default": {
13311331
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13321332
"fontCharacter": "\\f1df"
13331333
}
1334+
},
1335+
"aws-schemas-schema": {
1336+
"description": "AWS Contributed Icon",
1337+
"default": {
1338+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1339+
"fontCharacter": "\\f1e0"
1340+
}
1341+
},
1342+
"aws-stepfunctions-preview": {
1343+
"description": "AWS Contributed Icon",
1344+
"default": {
1345+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1346+
"fontCharacter": "\\f1e1"
1347+
}
13341348
}
13351349
},
13361350
"walkthroughs": [

packages/amazonq/src/app/inline/EditRendering/diffUtils.ts

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,13 @@ export type LineDiff =
1616
* @param unifiedDiff The unified diff content
1717
* @returns The modified code after applying the diff
1818
*/
19-
export function applyUnifiedDiff(
20-
docText: string,
21-
unifiedDiff: string
22-
): { appliedCode: string; addedCharacterCount: number; deletedCharacterCount: number } {
19+
export function applyUnifiedDiff(docText: string, unifiedDiff: string): string {
2320
try {
24-
const { addedCharacterCount, deletedCharacterCount } = getAddedAndDeletedCharCount(unifiedDiff)
2521
// First try the standard diff package
2622
try {
2723
const result = applyPatch(docText, unifiedDiff)
2824
if (result !== false) {
29-
return {
30-
appliedCode: result,
31-
addedCharacterCount: addedCharacterCount,
32-
deletedCharacterCount: deletedCharacterCount,
33-
}
25+
return result
3426
}
3527
} catch (error) {}
3628

@@ -94,49 +86,8 @@ export function applyUnifiedDiff(
9486
// Replace the text
9587
result = result.replace(textToReplace, newText)
9688
}
97-
return {
98-
appliedCode: result,
99-
addedCharacterCount: addedCharacterCount,
100-
deletedCharacterCount: deletedCharacterCount,
101-
}
89+
return result
10290
} catch (error) {
103-
return {
104-
appliedCode: docText, // Return original text if all methods fail
105-
addedCharacterCount: 0,
106-
deletedCharacterCount: 0,
107-
}
108-
}
109-
}
110-
111-
export function getAddedAndDeletedCharCount(diff: string): {
112-
addedCharacterCount: number
113-
deletedCharacterCount: number
114-
} {
115-
let addedCharacterCount = 0
116-
let deletedCharacterCount = 0
117-
let i = 0
118-
const lines = diff.split('\n')
119-
while (i < lines.length) {
120-
const line = lines[i]
121-
if (line.startsWith('+') && !line.startsWith('+++')) {
122-
addedCharacterCount += line.length - 1
123-
} else if (line.startsWith('-') && !line.startsWith('---')) {
124-
const removedLine = line.substring(1)
125-
deletedCharacterCount += removedLine.length
126-
127-
// Check if this is a modified line rather than a pure deletion
128-
const nextLine = lines[i + 1]
129-
if (nextLine && nextLine.startsWith('+') && !nextLine.startsWith('+++') && nextLine.includes(removedLine)) {
130-
// This is a modified line, not a pure deletion
131-
// We've already counted the deletion, so we'll just increment i to skip the next line
132-
// since we'll process the addition on the next iteration
133-
i += 1
134-
}
135-
}
136-
i += 1
137-
}
138-
return {
139-
addedCharacterCount,
140-
deletedCharacterCount,
91+
return docText // Return original text if all methods fail
14192
}
14293
}

packages/amazonq/src/app/inline/EditRendering/displayImage.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { LogInlineCompletionSessionResultsParams } from '@aws/language-server-ru
1212
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol'
1313
import path from 'path'
1414
import { imageVerticalOffset } from './svgGenerator'
15+
import { AmazonQInlineCompletionItemProvider } from '../completion'
1516

1617
export class EditDecorationManager {
1718
private imageDecorationType: vscode.TextEditorDecorationType
@@ -280,16 +281,15 @@ export async function displaySvgDecoration(
280281
session: CodeWhispererSession,
281282
languageClient: LanguageClient,
282283
item: InlineCompletionItemWithReferences,
283-
addedCharacterCount: number,
284-
deletedCharacterCount: number
284+
inlineCompletionProvider?: AmazonQInlineCompletionItemProvider
285285
) {
286286
const originalCode = editor.document.getText()
287287

288288
decorationManager.displayEditSuggestion(
289289
editor,
290290
svgImage,
291291
startLine,
292-
() => {
292+
async () => {
293293
// Handle accept
294294
getLogger().info('Edit suggestion accepted')
295295

@@ -315,10 +315,20 @@ export async function displaySvgDecoration(
315315
},
316316
totalSessionDisplayTime: Date.now() - session.requestStartTime,
317317
firstCompletionDisplayLatency: session.firstCompletionDisplayLatency,
318-
addedCharacterCount: addedCharacterCount,
319-
deletedCharacterCount: deletedCharacterCount,
320318
}
321319
languageClient.sendNotification('aws/logInlineCompletionSessionResults', params)
320+
if (inlineCompletionProvider) {
321+
await inlineCompletionProvider.provideInlineCompletionItems(
322+
editor.document,
323+
endPosition,
324+
{
325+
triggerKind: vscode.InlineCompletionTriggerKind.Automatic,
326+
selectedCompletionInfo: undefined,
327+
},
328+
new vscode.CancellationTokenSource().token,
329+
{ emitTelemetry: false, showUi: false }
330+
)
331+
}
322332
},
323333
() => {
324334
// Handle reject
@@ -333,8 +343,6 @@ export async function displaySvgDecoration(
333343
discarded: false,
334344
},
335345
},
336-
// addedCharacterCount: addedCharacterCount,
337-
// deletedCharacterCount: deletedCharacterCount,
338346
}
339347
languageClient.sendNotification('aws/logInlineCompletionSessionResults', params)
340348
},

packages/amazonq/src/app/inline/EditRendering/imageRenderer.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import { getLogger } from 'aws-core-vscode/shared'
1010
import { LanguageClient } from 'vscode-languageclient'
1111
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol'
1212
import { CodeWhispererSession } from '../sessionManager'
13+
import { AmazonQInlineCompletionItemProvider } from '../completion'
1314

1415
export async function showEdits(
1516
item: InlineCompletionItemWithReferences,
1617
editor: vscode.TextEditor | undefined,
1718
session: CodeWhispererSession,
18-
languageClient: LanguageClient
19+
languageClient: LanguageClient,
20+
inlineCompletionProvider?: AmazonQInlineCompletionItemProvider
1921
) {
2022
if (!editor) {
2123
return
@@ -24,14 +26,8 @@ export async function showEdits(
2426
const svgGenerationService = new SvgGenerationService()
2527
// Generate your SVG image with the file contents
2628
const currentFile = editor.document.uri.fsPath
27-
const {
28-
svgImage,
29-
startLine,
30-
newCode,
31-
origionalCodeHighlightRange,
32-
addedCharacterCount,
33-
deletedCharacterCount,
34-
} = await svgGenerationService.generateDiffSvg(currentFile, item.insertText as string)
29+
const { svgImage, startLine, newCode, origionalCodeHighlightRange } =
30+
await svgGenerationService.generateDiffSvg(currentFile, item.insertText as string)
3531

3632
if (svgImage) {
3733
// display the SVG image
@@ -44,8 +40,7 @@ export async function showEdits(
4440
session,
4541
languageClient,
4642
item,
47-
addedCharacterCount,
48-
deletedCharacterCount
43+
inlineCompletionProvider
4944
)
5045
} else {
5146
getLogger('nextEditPrediction').error('SVG image generation returned an empty result.')

0 commit comments

Comments
 (0)