Skip to content

Commit d047fa0

Browse files
Merge branch 'master' into diagnostics
2 parents 416d5b7 + 01850cd commit d047fa0

File tree

91 files changed

+13879
-5876
lines changed

Some content is hidden

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

91 files changed

+13879
-5876
lines changed

package-lock.json

Lines changed: 9113 additions & 5507 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q /test, /doc, and /dev capabilities integrated into Agentic coding."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Removal",
3+
"description": "Deprecate \"amazon q is generating...\" UI for inline suggestion"
4+
}

packages/amazonq/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.82.0 2025-07-07
2+
3+
- **Bug Fix** Prompt re-authenticate if auto trigger failed with expired token
4+
15
## 1.81.0 2025-07-02
26

37
- **Bug Fix** Stop auto inline completion when deleting code

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 building, operating, and transforming software, with advanced capabilities for managing data and AI",
5-
"version": "1.82.0-SNAPSHOT",
5+
"version": "1.83.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,19 @@ export class EditDecorationManager {
122122
/**
123123
* Displays an edit suggestion as an SVG image in the editor and highlights removed code
124124
*/
125-
public displayEditSuggestion(
125+
public async displayEditSuggestion(
126126
editor: vscode.TextEditor,
127127
svgImage: vscode.Uri,
128128
startLine: number,
129-
onAccept: () => void,
130-
onReject: () => void,
129+
onAccept: () => Promise<void>,
130+
onReject: () => Promise<void>,
131131
originalCode: string,
132132
newCode: string,
133133
originalCodeHighlightRanges: Array<{ line: number; start: number; end: number }>
134-
): void {
135-
this.clearDecorations(editor)
134+
): Promise<void> {
135+
await this.clearDecorations(editor)
136136

137-
void setContext('aws.amazonq.editSuggestionActive' as any, true)
137+
await setContext('aws.amazonq.editSuggestionActive' as any, true)
138138

139139
this.acceptHandler = onAccept
140140
this.rejectHandler = onReject
@@ -157,14 +157,14 @@ export class EditDecorationManager {
157157
/**
158158
* Clears all edit suggestion decorations
159159
*/
160-
public clearDecorations(editor: vscode.TextEditor): void {
160+
public async clearDecorations(editor: vscode.TextEditor): Promise<void> {
161161
editor.setDecorations(this.imageDecorationType, [])
162162
editor.setDecorations(this.removedCodeDecorationType, [])
163163
this.currentImageDecoration = undefined
164164
this.currentRemovedCodeDecorations = []
165165
this.acceptHandler = undefined
166166
this.rejectHandler = undefined
167-
void setContext('aws.amazonq.editSuggestionActive' as any, false)
167+
await setContext('aws.amazonq.editSuggestionActive' as any, false)
168168
}
169169

170170
/**
@@ -285,7 +285,7 @@ export async function displaySvgDecoration(
285285
) {
286286
const originalCode = editor.document.getText()
287287

288-
decorationManager.displayEditSuggestion(
288+
await decorationManager.displayEditSuggestion(
289289
editor,
290290
svgImage,
291291
startLine,
@@ -303,7 +303,7 @@ export async function displaySvgDecoration(
303303
// Move cursor to end of the actual changed content
304304
editor.selection = new vscode.Selection(endPosition, endPosition)
305305

306-
decorationManager.clearDecorations(editor)
306+
await decorationManager.clearDecorations(editor)
307307
const params: LogInlineCompletionSessionResultsParams = {
308308
sessionId: session.sessionId,
309309
completionSessionResult: {
@@ -326,14 +326,14 @@ export async function displaySvgDecoration(
326326
selectedCompletionInfo: undefined,
327327
},
328328
new vscode.CancellationTokenSource().token,
329-
{ emitTelemetry: false, showUi: false }
329+
{ emitTelemetry: false, showUi: false, editsStreakToken: session.editsStreakPartialResultToken }
330330
)
331331
}
332332
},
333-
() => {
333+
async () => {
334334
// Handle reject
335335
getLogger().info('Edit suggestion rejected')
336-
decorationManager.clearDecorations(editor)
336+
await decorationManager.clearDecorations(editor)
337337
const params: LogInlineCompletionSessionResultsParams = {
338338
sessionId: session.sessionId,
339339
completionSessionResult: {

packages/amazonq/src/app/inline/completion.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
getDiagnosticsOfCurrentFile,
4040
toIdeDiagnostics,
4141
} from 'aws-core-vscode/codewhisperer'
42-
import { InlineGeneratingMessage } from './inlineGeneratingMessage'
4342
import { LineTracker } from './stateTracker/lineTracker'
4443
import { InlineTutorialAnnotation } from './tutorials/inlineTutorialAnnotation'
4544
import { TelemetryHelper } from './telemetryHelper'
@@ -58,7 +57,7 @@ export class InlineCompletionManager implements Disposable {
5857
private sessionManager: SessionManager
5958
private recommendationService: RecommendationService
6059
private lineTracker: LineTracker
61-
private incomingGeneratingMessage: InlineGeneratingMessage
60+
6261
private inlineTutorialAnnotation: InlineTutorialAnnotation
6362
private readonly logSessionResultMessageName = 'aws/logInlineCompletionSessionResults'
6463
private documentChangeListener: Disposable
@@ -73,12 +72,7 @@ export class InlineCompletionManager implements Disposable {
7372
this.languageClient = languageClient
7473
this.sessionManager = sessionManager
7574
this.lineTracker = lineTracker
76-
this.incomingGeneratingMessage = new InlineGeneratingMessage(this.lineTracker)
77-
this.recommendationService = new RecommendationService(
78-
this.sessionManager,
79-
this.incomingGeneratingMessage,
80-
cursorUpdateRecorder
81-
)
75+
this.recommendationService = new RecommendationService(this.sessionManager, cursorUpdateRecorder)
8276
this.inlineTutorialAnnotation = inlineTutorialAnnotation
8377
this.inlineCompletionProvider = new AmazonQInlineCompletionItemProvider(
8478
languageClient,
@@ -108,7 +102,6 @@ export class InlineCompletionManager implements Disposable {
108102
public dispose(): void {
109103
if (this.disposable) {
110104
this.disposable.dispose()
111-
this.incomingGeneratingMessage.dispose()
112105
this.lineTracker.dispose()
113106
}
114107
if (this.documentChangeListener) {
@@ -277,6 +270,10 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
277270
const prefix = document.getText(new Range(prevStartPosition, position))
278271
const prevItemMatchingPrefix = []
279272
for (const item of this.sessionManager.getActiveRecommendation()) {
273+
// if item is an Edit suggestion, insertText is a diff instead of new code contents, skip the logic to check for prefix.
274+
if (item.isInlineEdit) {
275+
continue
276+
}
280277
const text = typeof item.insertText === 'string' ? item.insertText : item.insertText.value
281278
if (text.startsWith(prefix) && position.isAfterOrEqual(prevStartPosition)) {
282279
item.command = {
@@ -331,6 +328,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
331328
position,
332329
context,
333330
token,
331+
isAutoTrigger,
334332
getAllRecommendationsOptions
335333
)
336334
// get active item from session for displaying

packages/amazonq/src/app/inline/inlineGeneratingMessage.ts

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

0 commit comments

Comments
 (0)