Merge pull request #2457 from qqqys/fix/vscode_file_path

fix(vscode-ide-companion): update URI handling for Windows paths
This commit is contained in:
qqqys 2026-03-18 21:45:41 +08:00 committed by GitHub
commit de0f09c459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);