Skip to content

Commit fd56f56

Browse files
committed
comment
1 parent ec7881d commit fd56f56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/codewhisperer/service/recommendationHandler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export class RecommendationHandler {
390390

391391
// send Empty userDecision event if user receives no recommendations in this session at all.
392392
if (invocationResult === 'Succeeded' && nextToken === '') {
393+
// case 1: empty list of suggestion []
393394
if (session.recommendations.length === 0) {
394395
session.requestIdList.push(requestId)
395396
// Received an empty list of recommendations
@@ -403,7 +404,9 @@ export class RecommendationHandler {
403404
).language,
404405
session.requestContext.supplementalMetadata
405406
)
406-
} else if (!this.hasAtLeastOneValidSuggestion(typedPrefix)) {
407+
}
408+
// case 2: non empty list of suggestion but with (a) empty content or (b) non-matching typeahead
409+
else if (!this.hasAtLeastOneValidSuggestion(typedPrefix)) {
407410
this.reportUserDecisions(-1)
408411
}
409412
}

0 commit comments

Comments
 (0)