Skip to content

Commit 86a136b

Browse files
authored
fix: bug in skip edit for userWrittenCode (#1315)
1 parent c10819e commit 86a136b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/aws-lsp-codewhisperer/src/shared/userWrittenCodeTracker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class UserWrittenCodeTracker {
8989
public recordUsageCount(languageId: string) {
9090
const languageBucket = this.getLanguageBucket(languageId)
9191
languageBucket.invocationCount++
92-
this._lastQInvocationTime = Date.now()
92+
this._lastQInvocationTime = performance.now()
9393
}
9494

9595
public onQStartsMakingEdits() {
@@ -117,6 +117,7 @@ export class UserWrittenCodeTracker {
117117
if (performance.now() - this._lastQInvocationTime > RESET_Q_EDITING_THRESHOLD) {
118118
this._qIsMakingEdits = false
119119
}
120+
return
120121
}
121122
const languageBucket = this.getLanguageBucket(languageId)
122123
// if user copies code into the editor for more than 50 characters

0 commit comments

Comments
 (0)