Skip to content

Commit 586c477

Browse files
Merge master into feature/code-diff
2 parents d6db6ee + 334d349 commit 586c477

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,18 @@ export function registerMessageListeners(
683683
)
684684

685685
languageClient.onNotification(openFileDiffNotificationType.method, async (params: OpenFileDiffParams) => {
686-
const currentFileUri = vscode.Uri.parse(params.originalFileUri)
686+
// Handle both file:// URIs and raw file paths, ensuring proper Windows path handling
687+
let currentFileUri: vscode.Uri
688+
689+
// Check if it's already a proper file:// URI
690+
if (params.originalFileUri.startsWith('file://')) {
691+
currentFileUri = vscode.Uri.parse(params.originalFileUri)
692+
} else {
693+
// Decode URL-encoded characters and treat as file path
694+
const decodedPath = decodeURIComponent(params.originalFileUri)
695+
currentFileUri = vscode.Uri.file(decodedPath)
696+
}
697+
687698
const originalContent = params.originalFileContent ?? ''
688699
const fileName = path.basename(currentFileUri.fsPath)
689700

0 commit comments

Comments
 (0)