Skip to content

Commit 0c5ac5f

Browse files
authored
codewhisperer: update completion type Line/Block aggregation (#3635)
## Problem As per our sci team's request, update session level CompletionType. ### Before * Block if there is a Block completion present in the session, otherwise Line ### After * Only check the 'first' completion, if it's Block, then the session is Block otherwise Line
1 parent d5d6142 commit 0c5ac5f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/codewhisperer/service/recommendationHandler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ export class RecommendationHandler {
202202
TelemetryHelper.instance.triggerType = triggerType
203203
TelemetryHelper.instance.CodeWhispererAutomatedtriggerType =
204204
autoTriggerType === undefined ? 'KeyStrokeCount' : autoTriggerType
205-
if (
206-
recommendation.length > 0 &&
207-
recommendation[0].content.search(CodeWhispererConstants.lineBreak) !== -1
208-
) {
209-
completionType = 'Block'
205+
if (page === 0 && recommendation.length > 0) {
206+
completionType =
207+
recommendation[0].content.search(CodeWhispererConstants.lineBreak) !== -1 ? 'Block' : 'Line'
210208
}
211209
TelemetryHelper.instance.completionType = completionType
212210
requestId = resp?.$response && resp?.$response?.requestId

0 commit comments

Comments
 (0)