Skip to content

Commit 5050e67

Browse files
laura-codessroger-zhanggfloralphrhamiltlaileni-aws
committed
Merge master into feature/ui-e2e-tests (#7680)
- Resolve conflicts and push to this PR branch. - **Do not squash-merge** this PR. Use the "Create a merge commit" option to do a regular merge. To perform the merge from the command line, you could do something like the following (where "origin" is the name of the remote in your local git repo): ``` git stash git fetch --all git checkout origin/feature/ui-e2e-tests git merge origin/master git commit git push origin HEAD:refs/heads/autoMerge/feature/ui-e2e-tests ``` --------- Co-authored-by: Roger Zhang <[email protected]> Co-authored-by: 🥩 Flora <[email protected]> Co-authored-by: Reed Hamilton <[email protected]> Co-authored-by: Laxman Reddy <[email protected]> Co-authored-by: Roger Zhang <[email protected]> Co-authored-by: Jacob Chung <[email protected]> Co-authored-by: aws-asolidu <[email protected]> Co-authored-by: Newton Der <[email protected]> Co-authored-by: Newton Der <[email protected]> Co-authored-by: aws-toolkit-automation <> Co-authored-by: laura-codess <[email protected]> Co-authored-by: Tyrone Smith <[email protected]> Co-authored-by: Aidan Ton <[email protected]> Co-authored-by: abhraina-aws <[email protected]> Co-authored-by: atontb <[email protected]> Co-authored-by: Nitish <[email protected]> Co-authored-by: Nitish Kumar Singh <[email protected]> Co-authored-by: Blake Lazarine <[email protected]> Co-authored-by: mkovelam <[email protected]> Co-authored-by: BlakeLazarine <[email protected]> Co-authored-by: Will Lo <[email protected]> Co-authored-by: Na Yue <[email protected]> Co-authored-by: Lei Gao <[email protected]> Co-authored-by: tsmithsz <[email protected]> Co-authored-by: Reed Hamilton <[email protected]> Co-authored-by: surajrdy-aws <[email protected]> Co-authored-by: Boyu <[email protected]> Co-authored-by: Dung Dong <[email protected]>
1 parent 0609767 commit 5050e67

File tree

22 files changed

+279
-136
lines changed

22 files changed

+279
-136
lines changed

package-lock.json

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

packages/amazonq/CHANGELOG.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
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-
6-
## 1.87.0 2025-07-31
7-
8-
- Miscellaneous non-user-facing changes
9-
10-
## 1.86.0 2025-07-30
11-
12-
- **Bug Fix** Let Enter invoke auto completion more consistently
13-
- **Bug Fix** Faster and more responsive inline completion UX
14-
- **Bug Fix** Use documentChangeEvent as auto trigger condition
15-
161
## 1.85.0 2025-07-19
172

183
- Miscellaneous non-user-facing changes

packages/amazonq/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
4-
"description": "The most capable generative AIpowered assistant for software development.",
5-
"version": "1.89.0-SNAPSHOT",
4+
"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.86.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { diffWordsWithSpace, diffLines } from 'diff'
6+
import { diffWordsWithSpace } from 'diff'
77
import * as vscode from 'vscode'
88
import { ToolkitError, getLogger } from 'aws-core-vscode/shared'
99
import { diffUtilities } from 'aws-core-vscode/shared'

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

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export class InlineCompletionManager implements Disposable {
112112
) => {
113113
try {
114114
vsCodeState.isCodeWhispererEditing = true
115-
const startLine = position.line
116115
// TODO: also log the seen state for other suggestions in session
117116
// Calculate timing metrics before diagnostic delay
118117
const totalSessionDisplayTime = performance.now() - requestStartTime
@@ -121,11 +120,6 @@ export class InlineCompletionManager implements Disposable {
121120
this.sessionManager.getActiveSession()?.diagnosticsBeforeAccept,
122121
getDiagnosticsOfCurrentFile()
123122
)
124-
// try remove the extra } ) ' " if there is a new reported problem
125-
// the extra } will cause syntax error
126-
if (diagnosticDiff.added.length > 0) {
127-
await handleExtraBrackets(editor, editor.selection.active, position)
128-
}
129123
const params: LogInlineCompletionSessionResultsParams = {
130124
sessionId: sessionId,
131125
completionSessionResult: {
@@ -170,22 +164,16 @@ export class InlineCompletionManager implements Disposable {
170164
const onInlineRejection = async () => {
171165
try {
172166
vsCodeState.isCodeWhispererEditing = true
173-
const session = this.sessionManager.getActiveSession()
174-
if (session === undefined) {
175-
return
176-
}
177-
const requestStartTime = session.requestStartTime
178-
const totalSessionDisplayTime = performance.now() - requestStartTime
179167
await commands.executeCommand('editor.action.inlineSuggest.hide')
180168
// TODO: also log the seen state for other suggestions in session
181169
this.disposable.dispose()
182170
this.disposable = languages.registerInlineCompletionItemProvider(
183171
CodeWhispererConstants.platformLanguageIds,
184172
this.inlineCompletionProvider
185173
)
186-
const sessionId = session.sessionId
174+
const sessionId = this.sessionManager.getActiveSession()?.sessionId
187175
const itemId = this.sessionManager.getActiveRecommendation()[0]?.itemId
188-
if (!itemId) {
176+
if (!sessionId || !itemId) {
189177
return
190178
}
191179
const params: LogInlineCompletionSessionResultsParams = {
@@ -197,8 +185,6 @@ export class InlineCompletionManager implements Disposable {
197185
discarded: false,
198186
},
199187
},
200-
firstCompletionDisplayLatency: session.firstCompletionDisplayLatency,
201-
totalSessionDisplayTime: totalSessionDisplayTime,
202188
}
203189
this.languageClient.sendNotification(this.logSessionResultMessageName, params)
204190
// clear session manager states once rejected
@@ -311,16 +297,21 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
311297
return []
312298
}
313299

314-
// there is a bug in VS Code, when hitting Enter, the context.triggerKind is Invoke (0)
315-
// when hitting other keystrokes, the context.triggerKind is Automatic (1)
316-
// we only mark option + C as manual trigger
317-
// this is a workaround since the inlineSuggest.trigger command take no params
318-
const isAutoTrigger = performance.now() - vsCodeState.lastManualTriggerTime > 50
300+
const isAutoTrigger = context.triggerKind === InlineCompletionTriggerKind.Automatic
319301
if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) {
320302
// return early when suggestions are disabled with auto trigger
321303
return []
322304
}
323305

306+
// yield event loop to let the document listen catch updates
307+
await sleep(1)
308+
// prevent user deletion invoking auto trigger
309+
// this is a best effort estimate of deletion
310+
if (this.documentEventListener.isLastEventDeletion(document.uri.fsPath)) {
311+
getLogger().debug('Skip auto trigger when deleting code')
312+
return []
313+
}
314+
324315
// yield event loop to let the document listen catch updates
325316
await sleep(1)
326317

@@ -411,8 +402,8 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
411402
},
412403
token,
413404
isAutoTrigger,
414-
this.documentEventListener,
415-
getAllRecommendationsOptions
405+
getAllRecommendationsOptions,
406+
this.documentEventListener.getLastDocumentChangeEvent(document.uri.fsPath)?.event
416407
)
417408
// get active item from session for displaying
418409
const items = this.sessionManager.getActiveRecommendation()

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import * as vscode from 'vscode'
56
import {
67
InlineCompletionListWithReferences,
78
InlineCompletionWithReferencesParams,
89
inlineCompletionWithReferencesRequestType,
910
TextDocumentContentChangeEvent,
10-
editCompletionRequestType,
1111
} from '@aws/language-server-runtimes/protocol'
1212
import { CancellationToken, InlineCompletionContext, Position, TextDocument } from 'vscode'
1313
import { LanguageClient } from 'vscode-languageclient'
@@ -68,8 +68,8 @@ export class RecommendationService {
6868
context: InlineCompletionContext,
6969
token: CancellationToken,
7070
isAutoTrigger: boolean,
71-
documentEventListener: DocumentEventListener,
72-
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true }
71+
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true },
72+
documentChangeEvent?: vscode.TextDocumentChangeEvent
7373
) {
7474
const documentChangeEvent = documentEventListener?.getLastDocumentChangeEvent(document.uri.fsPath)?.event
7575

@@ -84,15 +84,13 @@ export class RecommendationService {
8484
contentChanges: documentChangeEvent.contentChanges.map((x) => x as TextDocumentContentChangeEvent),
8585
}
8686
: undefined
87-
const openTabs = await getOpenFilesInWindow()
8887
let request: InlineCompletionWithReferencesParams = {
8988
textDocument: {
9089
uri: document.uri.toString(),
9190
},
9291
position,
9392
context,
9493
documentChangeParams: documentChangeParams,
95-
openTabFilepaths: openTabs,
9694
}
9795
if (options.editsStreakToken) {
9896
request = { ...request, partialResultToken: options.editsStreakToken }
@@ -201,7 +199,6 @@ export class RecommendationService {
201199

202200
const isInlineEdit = result.items.some((item) => item.isInlineEdit)
203201

204-
// TODO: question, is it possible that the first request returns empty suggestion but has non-empty next token?
205202
if (result.partialResultToken) {
206203
if (!isInlineEdit) {
207204
// If the suggestion is COMPLETIONS and there are more results to fetch, handle them in the background

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,6 @@ export class SessionManager {
134134
}
135135
}
136136

137-
public checkInlineSuggestionVisibility() {
138-
if (this.activeSession) {
139-
this.activeSession.displayed = true
140-
this.activeSession.lastVisibleTime = performance.now()
141-
}
142-
}
143-
144137
private clearReferenceInlineHintsAndImportHints() {
145138
ReferenceInlineProvider.instance.removeInlineReference()
146139
ImportAdderProvider.instance.clear()

packages/amazonq/src/extension.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,6 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
132132
await activateAmazonqLsp(context)
133133
}
134134

135-
// Activate AutoDebug feature at extension level
136-
try {
137-
const autoDebugFeature = await activateAutoDebug(context)
138-
context.subscriptions.push(autoDebugFeature)
139-
} catch (error) {
140-
getLogger().error('Failed to activate AutoDebug feature at extension level: %s', error)
141-
}
142-
143135
// Generic extension commands
144136
registerGenericCommands(context, amazonQContextPrefix)
145137

packages/amazonq/src/lsp/client.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,12 @@ export async function startLanguageServer(
182182
reroute: true,
183183
modelSelection: true,
184184
workspaceFilePath: vscode.workspace.workspaceFile?.fsPath,
185-
codeReviewInChat: codeReviewInChat,
186-
// feature flag for displaying findings found not through CodeReview in the Code Issues Panel
187-
displayFindings: true,
185+
codeReviewInChat: false,
188186
},
189187
window: {
190188
notifications: true,
191189
showSaveFileDialog: true,
192-
showLogs: isSageMaker() ? false : true,
190+
showLogs: true,
193191
},
194192
textDocument: {
195193
inlineCompletionWithReferences: textDocSection,
@@ -365,10 +363,6 @@ async function onLanguageServerReady(
365363
await vscode.commands.executeCommand('editor.action.inlineSuggest.showNext')
366364
sessionManager.onNextSuggestion()
367365
}),
368-
// this is a workaround since handleDidShowCompletionItem is not public API
369-
Commands.register('aws.amazonq.checkInlineSuggestionVisibility', async () => {
370-
sessionManager.checkInlineSuggestionVisibility()
371-
}),
372366
Commands.register({ id: 'aws.amazonq.invokeInlineCompletion', autoconnect: true }, async () => {
373367
vsCodeState.lastManualTriggerTime = performance.now()
374368
await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger')

packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ describe('RecommendationService', () => {
163163
position: mockPosition,
164164
context: mockContext,
165165
documentChangeParams: undefined,
166-
openTabFilepaths: [],
167166
})
168167

169168
// Verify session management
@@ -213,7 +212,6 @@ describe('RecommendationService', () => {
213212
position: mockPosition,
214213
context: mockContext,
215214
documentChangeParams: undefined,
216-
openTabFilepaths: [],
217215
}
218216
const secondRequestArgs = completionCalls[1].args[1]
219217
assert.deepStrictEqual(firstRequestArgs, expectedRequestArgs)

0 commit comments

Comments
 (0)