Skip to content

Commit 0e8a9fe

Browse files
committed
fix(amazonq): diff not appearing for new files
1 parent 61805b7 commit 0e8a9fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/amazonq/src/lsp/chat/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export function registerMessageListeners(
452452
activeFileContext: { filePath: params.originalFileUri },
453453
focusAreaContext: { selectionInsideExtendedCodeBlock: entireDocumentSelection },
454454
},
455-
code: params.fileContent,
455+
code: params.fileContent ?? '',
456456
},
457457
amazonQDiffScheme,
458458
true

packages/core/src/amazonq/commons/controllers/contentController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class EditorContentController {
161161
const { filePath, selection } = extractFileAndCodeSelectionFromMessage(message)
162162

163163
try {
164-
if (filePath && message?.code?.trim().length > 0 && selection) {
164+
if (filePath && message?.code !== undefined && selection) {
165165
const originalFileUri = vscode.Uri.file(filePath)
166166
const uri = await createTempFileForDiff(originalFileUri, message, selection, scheme)
167167

0 commit comments

Comments
 (0)