Skip to content

Commit 5926459

Browse files
committed
fix(amazonq): skip matching with previous suggestions for EDITS
1 parent 74ac902 commit 5926459

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
266266
const prevItemMatchingPrefix = []
267267
for (const item of this.sessionManager.getActiveRecommendation()) {
268268
const text = typeof item.insertText === 'string' ? item.insertText : item.insertText.value
269-
if (text.startsWith(prefix) && position.isAfterOrEqual(prevStartPosition)) {
269+
// if item is an Edit suggestion, insertText is a diff instead of new code contents, skip the logic to check for prefix.
270+
if (text.startsWith(prefix) && position.isAfterOrEqual(prevStartPosition) && !item.isInlineEdit) {
270271
item.command = {
271272
command: 'aws.amazonq.acceptInline',
272273
title: 'On acceptance',

0 commit comments

Comments
 (0)