From 848f7dbd4c2dc9525bbf05428298fed3775a3d94 Mon Sep 17 00:00:00 2001 From: qqqys Date: Wed, 18 Mar 2026 15:28:22 +0800 Subject: [PATCH] fix(vscode-ide-companion): update URI handling for Windows paths --- packages/vscode-ide-companion/src/diff-manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vscode-ide-companion/src/diff-manager.ts b/packages/vscode-ide-companion/src/diff-manager.ts index 9a32769c1..8367517ab 100644 --- a/packages/vscode-ide-companion/src/diff-manager.ts +++ b/packages/vscode-ide-companion/src/diff-manager.ts @@ -192,17 +192,17 @@ export class DiffManager { return; } // Left side: old content using qwen-diff scheme - const leftDocUri = vscode.Uri.from({ + // Use Uri.file() to properly handle Windows paths (e.g., C:\Users\...) + // then change the scheme to our custom diff scheme + const leftDocUri = vscode.Uri.file(normalizedPath).with({ scheme: DIFF_SCHEME, - path: normalizedPath, query: `old&rand=${Math.random()}`, }); this.diffContentProvider.setContent(leftDocUri, oldContent); // Right side: new content using qwen-diff scheme - const rightDocUri = vscode.Uri.from({ + const rightDocUri = vscode.Uri.file(normalizedPath).with({ scheme: DIFF_SCHEME, - path: normalizedPath, query: `new&rand=${Math.random()}`, }); this.diffContentProvider.setContent(rightDocUri, newContent);