Skip to content

Commit d010c66

Browse files
authored
fix(amazonq): nep auto trigger should use file uri but filename is used (#1753)
1 parent 97db5d8 commit d010c66

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

server/aws-lsp-codewhisperer/src/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const editPredictionAutoTrigger = ({
5050
// 1. Check required conditions
5151
// 1.1 Recent Edit Detection [NEEDED]
5252
const hasRecentEdit = recentEdits?.hasRecentEditInLine(
53-
fileContext.filename,
53+
fileContext.fileUri,
5454
lineNum,
5555
config.recentEditThresholdMs,
5656
config.editAdjacentLineRange

server/aws-lsp-codewhisperer/src/language-server/inline-completion/tracker/codeEditTracker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,15 @@ export class RecentEditTracker implements Disposable {
536536
}
537537

538538
public hasRecentEditInLine(
539-
documentUri: string,
539+
documentUri: string | undefined,
540540
lineNum: number,
541541
timeThresholdMs: number = 20000,
542542
lineRange: number = 5
543543
): boolean {
544+
if (!documentUri) {
545+
return false
546+
}
547+
544548
// Check if we have snapshots for this document
545549
const snapshots = this.snapshots.get(documentUri)
546550
if (!snapshots || snapshots.length === 0) {

0 commit comments

Comments
 (0)