Skip to content

Commit 9bfeef0

Browse files
authored
Merge branch 'feature/auto-debug' into feature/loop-debug
2 parents 8dbc9a2 + 673364f commit 9bfeef0

File tree

31 files changed

+1546
-846
lines changed

31 files changed

+1546
-846
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
required: false
1313
default: prerelease
1414
push:
15-
branches: [master, feature/*]
15+
branches: [master, feature/*, release/*]
1616
# tags:
1717
# - v[0-9]+.[0-9]+.[0-9]+
1818

@@ -40,12 +40,16 @@ jobs:
4040
# run: echo 'TAG_NAME=prerelease' >> $GITHUB_ENV
4141
- if: github.event_name == 'workflow_dispatch'
4242
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
43-
- if: github.ref_name != 'master'
43+
- if: startsWith(github.ref_name, 'feature/')
4444
run: |
45-
TAG_NAME=${{ github.ref_name }}
46-
FEAT_NAME=$(echo $TAG_NAME | sed 's/feature\///')
45+
FEAT_NAME=$(echo ${{ github.ref_name }} | sed 's/feature\///')
4746
echo "FEAT_NAME=$FEAT_NAME" >> $GITHUB_ENV
4847
echo "TAG_NAME=pre-$FEAT_NAME" >> $GITHUB_ENV
48+
- if: startsWith(github.ref_name, 'release/')
49+
run: |
50+
RC_NAME=$(echo ${{ github.ref_name }} | sed 's/release\///')
51+
echo "FEAT_NAME=" >> $GITHUB_ENV
52+
echo "TAG_NAME=$RC_NAME" >> $GITHUB_ENV
4953
- if: github.ref_name == 'master'
5054
run: |
5155
echo "FEAT_NAME=" >> $GITHUB_ENV
@@ -105,10 +109,14 @@ jobs:
105109
- uses: actions/checkout@v4
106110
- uses: actions/download-artifact@v4
107111
- name: Delete existing prerelease
108-
# "prerelease" (main branch) or "pre-<feature>"
109-
if: "env.TAG_NAME == 'prerelease' || startsWith(env.TAG_NAME, 'pre-')"
112+
# "prerelease" (main branch), "pre-<feature>", or "rc-<date>"
113+
if: env.TAG_NAME == 'prerelease' || startsWith(env.TAG_NAME, 'pre-') || startsWith(env.TAG_NAME, 'rc-')
110114
run: |
111-
echo "SUBJECT=AWS IDE Extensions: ${FEAT_NAME:-${TAG_NAME}}" >> $GITHUB_ENV
115+
if [[ "$TAG_NAME" == rc-* ]]; then
116+
echo "SUBJECT=AWS IDE Extensions Release Candidate: ${TAG_NAME#rc-}" >> $GITHUB_ENV
117+
else
118+
echo "SUBJECT=AWS IDE Extensions: ${FEAT_NAME:-${TAG_NAME}}" >> $GITHUB_ENV
119+
fi
112120
gh release delete "$TAG_NAME" --cleanup-tag --yes || true
113121
# git push origin :"$TAG_NAME" || true
114122
- name: Publish Prerelease
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Setup Release Candidate
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commitId:
7+
description: 'Commit ID to create RC from'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
setup-rc:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ inputs.commitId }}
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
persist-credentials: true
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
cache: 'npm'
28+
29+
- name: Generate Branch Name
30+
id: branch-name
31+
run: |
32+
echo "BRANCH_NAME=release/rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
33+
34+
- name: Create RC Branch
35+
env:
36+
BRANCH_NAME: ${{ steps.branch-name.outputs.BRANCH_NAME }}
37+
run: |
38+
git config user.name "aws-toolkit-automation"
39+
git config user.email "<>"
40+
41+
# Create RC branch from specified commit
42+
git checkout -b $BRANCH_NAME
43+
44+
# Push RC branch
45+
git push origin $BRANCH_NAME

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"date": "2025-08-06",
3+
"version": "1.88.0",
4+
"entries": [
5+
{
6+
"type": "Feature",
7+
"description": "Amazon Q Chat provides error explanations and fixes when hovering or right-clicking on error indicators and messages"
8+
},
9+
{
10+
"type": "Feature",
11+
"description": "/transform: Show transformation history in Transformation Hub and allow users to resume jobs"
12+
}
13+
]
14+
}

packages/amazonq/.changes/next-release/Feature-dffec708-ae10-45d7-bcfd-b1c07a84de12.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/amazonq/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.88.0 2025-08-06
2+
3+
- **Feature** Amazon Q Chat provides error explanations and fixes when hovering or right-clicking on error indicators and messages
4+
- **Feature** /transform: Show transformation history in Transformation Hub and allow users to resume jobs
5+
16
## 1.87.0 2025-07-31
27

38
- Miscellaneous non-user-facing changes

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
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 software development.",
5-
"version": "1.88.0-SNAPSHOT",
5+
"version": "1.89.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

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

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { getLogger, setContext } from 'aws-core-vscode/shared'
6+
import { getContext, getLogger, setContext } from 'aws-core-vscode/shared'
77
import * as vscode from 'vscode'
8-
import { diffLines } from 'diff'
8+
import { applyPatch, diffLines } from 'diff'
99
import { LanguageClient } from 'vscode-languageclient'
1010
import { CodeWhispererSession } from '../sessionManager'
1111
import { LogInlineCompletionSessionResultsParams } from '@aws/language-server-runtimes/protocol'
1212
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol'
1313
import path from 'path'
1414
import { imageVerticalOffset } from './svgGenerator'
15-
import { AmazonQInlineCompletionItemProvider } from '../completion'
15+
import { EditSuggestionState } from '../editSuggestionState'
16+
import type { AmazonQInlineCompletionItemProvider } from '../completion'
1617
import { vsCodeState } from 'aws-core-vscode/codewhisperer'
1718

19+
const autoRejectEditCursorDistance = 25
20+
1821
export class EditDecorationManager {
1922
private imageDecorationType: vscode.TextEditorDecorationType
2023
private removedCodeDecorationType: vscode.TextEditorDecorationType
@@ -136,6 +139,7 @@ export class EditDecorationManager {
136139
await this.clearDecorations(editor)
137140

138141
await setContext('aws.amazonq.editSuggestionActive' as any, true)
142+
EditSuggestionState.setEditSuggestionActive(true)
139143

140144
this.acceptHandler = onAccept
141145
this.rejectHandler = onReject
@@ -166,6 +170,7 @@ export class EditDecorationManager {
166170
this.acceptHandler = undefined
167171
this.rejectHandler = undefined
168172
await setContext('aws.amazonq.editSuggestionActive' as any, false)
173+
EditSuggestionState.setEditSuggestionActive(false)
169174
}
170175

171176
/**
@@ -270,6 +275,28 @@ function getEndOfEditPosition(originalCode: string, newCode: string): vscode.Pos
270275
return editor ? editor.selection.active : new vscode.Position(0, 0)
271276
}
272277

278+
/**
279+
* Helper function to create discard telemetry params
280+
*/
281+
function createDiscardTelemetryParams(
282+
session: CodeWhispererSession,
283+
item: InlineCompletionItemWithReferences
284+
): LogInlineCompletionSessionResultsParams {
285+
return {
286+
sessionId: session.sessionId,
287+
completionSessionResult: {
288+
[item.itemId]: {
289+
seen: false,
290+
accepted: false,
291+
discarded: true,
292+
},
293+
},
294+
totalSessionDisplayTime: Date.now() - session.requestStartTime,
295+
firstCompletionDisplayLatency: session.firstCompletionDisplayLatency,
296+
isInlineEdit: true,
297+
}
298+
}
299+
273300
/**
274301
* Helper function to display SVG decorations
275302
*/
@@ -286,6 +313,54 @@ export async function displaySvgDecoration(
286313
) {
287314
const originalCode = editor.document.getText()
288315

316+
// Check if a completion suggestion is currently active - if so, discard edit suggestion
317+
if (inlineCompletionProvider && (await inlineCompletionProvider.isCompletionActive())) {
318+
// Emit DISCARD telemetry for edit suggestion that can't be shown due to active completion
319+
const params = createDiscardTelemetryParams(session, item)
320+
languageClient.sendNotification('aws/logInlineCompletionSessionResults', params)
321+
getLogger().info('Edit suggestion discarded due to active completion suggestion')
322+
return
323+
}
324+
325+
const isPatchValid = applyPatch(editor.document.getText(), item.insertText as string)
326+
if (!isPatchValid) {
327+
const params = createDiscardTelemetryParams(session, item)
328+
// TODO: this session is closed on flare side hence discarded is not emitted in flare
329+
languageClient.sendNotification('aws/logInlineCompletionSessionResults', params)
330+
return
331+
}
332+
const documentChangeListener = vscode.workspace.onDidChangeTextDocument((e) => {
333+
if (e.contentChanges.length <= 0) {
334+
return
335+
}
336+
if (e.document !== editor.document) {
337+
return
338+
}
339+
if (vsCodeState.isCodeWhispererEditing) {
340+
return
341+
}
342+
if (getContext('aws.amazonq.editSuggestionActive') === false) {
343+
return
344+
}
345+
346+
const isPatchValid = applyPatch(e.document.getText(), item.insertText as string)
347+
if (!isPatchValid) {
348+
void vscode.commands.executeCommand('aws.amazonq.inline.rejectEdit')
349+
}
350+
})
351+
const cursorChangeListener = vscode.window.onDidChangeTextEditorSelection((e) => {
352+
if (!EditSuggestionState.isEditSuggestionActive()) {
353+
return
354+
}
355+
if (e.textEditor !== editor) {
356+
return
357+
}
358+
const currentPosition = e.selections[0].active
359+
const distance = Math.abs(currentPosition.line - startLine)
360+
if (distance > autoRejectEditCursorDistance) {
361+
void vscode.commands.executeCommand('aws.amazonq.inline.rejectEdit')
362+
}
363+
})
289364
await decorationManager.displayEditSuggestion(
290365
editor,
291366
svgImage,
@@ -310,6 +385,8 @@ export async function displaySvgDecoration(
310385
editor.selection = new vscode.Selection(endPosition, endPosition)
311386

312387
await decorationManager.clearDecorations(editor)
388+
documentChangeListener.dispose()
389+
cursorChangeListener.dispose()
313390
const params: LogInlineCompletionSessionResultsParams = {
314391
sessionId: session.sessionId,
315392
completionSessionResult: {
@@ -343,6 +420,8 @@ export async function displaySvgDecoration(
343420
// Handle reject
344421
getLogger().info('Edit suggestion rejected')
345422
await decorationManager.clearDecorations(editor)
423+
documentChangeListener.dispose()
424+
cursorChangeListener.dispose()
346425
const params: LogInlineCompletionSessionResultsParams = {
347426
sessionId: session.sessionId,
348427
completionSessionResult: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ 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'
13+
import type { AmazonQInlineCompletionItemProvider } from '../completion'
1414

1515
export async function showEdits(
1616
item: InlineCompletionItemWithReferences,

0 commit comments

Comments
 (0)