How do I use Visual Studio code as an external compare tool?
Here's the local and remote compare arguments that I used
--diff "${file1Path}" "${file2Path}"
It says that it can't find the given file
C:\Users\ADMINI~1\AppData\Local\Temp\2\RTC__KEuIMxGEeqjcIQjEDE_rA\my-file-name.xml
Investigating, I find that the folder RTC__KE... doesn't exist.
I am on a Windows 2012 server.
I have Eclipse and the RTC plugin.
When I set the external compare tool to Beyond Compare, it works fine.
One answer
What is happening here is that Eclipse creates temporary files and deletes them when VSCode has finished using them, the problem is that VSCode releases the file too soon, before it's displayed. I think it is an architectural problem with the file watcher used in VSCode.
Can you try running vscode with parameter "--disable-extensions" and see if that makes a difference?
Comments
Shashikant Padur
JAZZ DEVELOPER Jul 23 '20, 4:28 a.m.I tried this on MacOS and it works for the very first launch of VS code. Next time it showed and error informing that it cannot open file. If I close VS Code, again it will work for the first launch. I am wondering if there is an issue with VS Code.
Fullchee Zhang
Jul 23 '20, 10:15 a.m.It doesn't seem to work for the first launch of VS Code for me.
Kirk Vogen
Dec 08 '20, 12:17 p.m.It seems to be working for me. I added the
--wait
parameter as well. The documentation says: Wait for the files to be closed before returning. It does seem to work without the--wait
parameter, though. Here is my Remote Compare Arguments entry: