Skip to content

Commit 7f62ee4

Browse files
authored
fix(amazonq): skip matching with previous suggestions for EDITS
Merge pull request #7600 from atonaamz/nep-flare
2 parents 77472f5 + bea4abc commit 7f62ee4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
265265
const prefix = document.getText(new Range(prevStartPosition, position))
266266
const prevItemMatchingPrefix = []
267267
for (const item of this.sessionManager.getActiveRecommendation()) {
268+
// if item is an Edit suggestion, insertText is a diff instead of new code contents, skip the logic to check for prefix.
269+
if (item.isInlineEdit) {
270+
continue
271+
}
268272
const text = typeof item.insertText === 'string' ? item.insertText : item.insertText.value
269273
if (text.startsWith(prefix) && position.isAfterOrEqual(prevStartPosition)) {
270274
item.command = {

0 commit comments

Comments
 (0)