Skip to content

Commit bcd9125

Browse files
committed
docstr
1 parent fd81f2e commit bcd9125

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,18 @@ export class RecommendationService {
122122
})
123123
const t0 = performance.now()
124124

125-
// yield event loop to let the document listen catch updates
125+
// Yield event loop to let the document listen catch updates
126126
await sleep(1)
127-
// prevent user deletion invoking auto trigger
128-
// this is a best effort estimate of deletion
127+
// Best effort estimate of deletion
129128
const isTriggerByDeletion = documentEventListener.isLastEventDeletion(document.uri.fsPath)
130129

131130
const ps: Promise<InlineCompletionListWithReferences>[] = []
131+
/**
132+
* IsTriggerByDeletion is to prevent user deletion invoking Completions.
133+
* PartialResultToken is not a hack for now since only Edits suggestion use partialResultToken across different calls of [getAllRecommendations],
134+
* Completions use PartialResultToken with single 1 call of [getAllRecommendations].
135+
* Edits leverage partialResultToken to achieve EditStreak such that clients can pull all continuous suggestions generated by the model within 1 EOS block.
136+
*/
132137
if (!isTriggerByDeletion && !request.partialResultToken) {
133138
const completionPromise: Promise<InlineCompletionListWithReferences> = languageClient.sendRequest(
134139
inlineCompletionWithReferencesRequestType.method,

0 commit comments

Comments
 (0)