Skip to content

Commit acaaf30

Browse files
authored
Merge branch 'aws:master' into code-review-tool
2 parents daa3ffe + d81c0a6 commit acaaf30

Some content is hidden

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

51 files changed

+5502
-152
lines changed

package-lock.json

Lines changed: 5 additions & 6 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+
}

packages/amazonq/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.81.0 2025-07-02
2+
3+
- **Bug Fix** Stop auto inline completion when deleting code
4+
5+
## 1.80.0 2025-07-01
6+
7+
- Miscellaneous non-user-facing changes
8+
19
## 1.79.0 2025-06-25
210

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

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
5+
import * as vscode from 'vscode'
66
import {
77
CancellationToken,
88
InlineCompletionContext,
@@ -40,11 +40,14 @@ import { InlineGeneratingMessage } from './inlineGeneratingMessage'
4040
import { LineTracker } from './stateTracker/lineTracker'
4141
import { InlineTutorialAnnotation } from './tutorials/inlineTutorialAnnotation'
4242
import { TelemetryHelper } from './telemetryHelper'
43-
import { Experiments, getLogger } from 'aws-core-vscode/shared'
43+
import { Experiments, getLogger, sleep } from 'aws-core-vscode/shared'
4444
import { debounce, messageUtils } from 'aws-core-vscode/utils'
4545
import { showEdits } from './EditRendering/imageRenderer'
4646
import { ICursorUpdateRecorder } from './cursorUpdateManager'
4747

48+
let lastDocumentDeleteEvent: vscode.TextDocumentChangeEvent | undefined = undefined
49+
let lastDocumentDeleteTime = 0
50+
4851
export class InlineCompletionManager implements Disposable {
4952
private disposable: Disposable
5053
private inlineCompletionProvider: AmazonQInlineCompletionItemProvider
@@ -55,6 +58,7 @@ export class InlineCompletionManager implements Disposable {
5558
private incomingGeneratingMessage: InlineGeneratingMessage
5659
private inlineTutorialAnnotation: InlineTutorialAnnotation
5760
private readonly logSessionResultMessageName = 'aws/logInlineCompletionSessionResults'
61+
private documentChangeListener: Disposable
5862

5963
constructor(
6064
languageClient: LanguageClient,
@@ -79,6 +83,13 @@ export class InlineCompletionManager implements Disposable {
7983
this.sessionManager,
8084
this.inlineTutorialAnnotation
8185
)
86+
87+
this.documentChangeListener = vscode.workspace.onDidChangeTextDocument((e) => {
88+
if (e.contentChanges.length === 1 && e.contentChanges[0].text === '') {
89+
lastDocumentDeleteEvent = e
90+
lastDocumentDeleteTime = performance.now()
91+
}
92+
})
8293
this.disposable = languages.registerInlineCompletionItemProvider(
8394
CodeWhispererConstants.platformLanguageIds,
8495
this.inlineCompletionProvider
@@ -97,6 +108,9 @@ export class InlineCompletionManager implements Disposable {
97108
this.incomingGeneratingMessage.dispose()
98109
this.lineTracker.dispose()
99110
}
111+
if (this.documentChangeListener) {
112+
this.documentChangeListener.dispose()
113+
}
100114
}
101115

102116
public registerInlineCompletion() {
@@ -221,6 +235,16 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
221235
getLogger().info('Recommendations already active, returning empty')
222236
return []
223237
}
238+
// yield event loop to let the document listen catch updates
239+
await sleep(1)
240+
// prevent user deletion invoking auto trigger
241+
// this is a best effort estimate of deletion
242+
const timeDiff = Math.abs(performance.now() - lastDocumentDeleteTime)
243+
if (timeDiff < 500 && lastDocumentDeleteEvent && lastDocumentDeleteEvent.document.uri === document.uri) {
244+
getLogger().debug('Skip auto trigger when deleting code')
245+
return []
246+
}
247+
224248
let logstr = `GenerateCompletion metadata:\\n`
225249
try {
226250
const t0 = performance.now()

0 commit comments

Comments
 (0)