vscode-code-review icon indicating copy to clipboard operation
vscode-code-review copied to clipboard

[bug] Reviews created on Windows store file paths incompatible with Linux

Open haybatov opened this issue 3 years ago • 3 comments

Reviews created on Windows store file paths incompatible with WSL2

Description

When the code reviews created in Windows are opened on the Windows subsystem for Linux (Ubuntu), a double-click on a review item results in a error "Cannot not open file: '/home/user/repo/\app\path\file.ext': File does not exist"

Yes, the error message contains double negation, but this is a secondary issue.

Reproduction

  1. Open VS Code on Windows and make some code review comments on separate files. Commit the code review file.
  2. Open VS Code and access files on WSL2 (Ubuntu was used) and click on any of the code review comments.
  3. Observe the error

Error message


Cannot not open file: '/home/user/repo/\app\path\file.ext': File does not exist

🌍 Your Environment

VS Code on Windows 10 for creating code review items. VS Code on Windows 11 accessing files on WSL for viewing code review items.

Workaround

Replacing backslashes with slashes in the code review CSV file allows to open the files on VS Code.

haybatov avatar Dec 12 '21 09:12 haybatov

We presumably the same bug in the following context:

  1. Creating a code review comment in Windows 10 -> code-review.csv is created
  2. Trying to open the project under MacOS with that code-review.csv: No comments are found When manually replacing all '' by '/" and all alle \n\r => \n MacOS understands the csv and loads the comments correctly. Unfortunately, Win10 doesn't understand the comments then anymore...

Should be a parsing error then. Would be great to get a fix ;)!

nvf33 avatar Apr 13 '22 15:04 nvf33

Temporary, you can open the csv on VS Code and switch the "End of line Sequence" of the file by clicking on the LF / CRLF:

image

Mac: should be "LF" Windows: should be "CRLF"

Jakartoine avatar Aug 17 '22 10:08 Jakartoine

Thanks for your comment. Unfortunately I won't find time within the next weeks or even month to investigate this further. Also, I can't really test it as I am working with a mac. Long story short: I would be happy to receive a pull request for review. 🙂

d-koppenhagen avatar Aug 17 '22 20:08 d-koppenhagen