- Home /
How can I use VSCode as a diff/merge tool for Unity Collaborate?
Hello,
I'm trying to use Visual Studio Code as my Diff/Merge tool and I'm running into some issues regarding the arguments. I am currently running: Unity 2020.3.14f1
Right now, I go to Edit > Preferences > External Tools and change the Revision Control Diff/Merge setting to Custom Tool. I then proceed to browse to the location of my visual studio code installation: F:/Programs/Microsoft VS Code/Code.exe
Here is where the issue occurs. Awhile back, I had found that if I put #LEFT and #RIGHT as the arguments, Unity would replace them with the respective files (I had previously tried #ABSLEFT and #ABSRIGHT which didn't work).
So in the field: Two-way diff command line I would simply fill in: -d #LEFT #RIGHT
By doing so, I would click the View Diff button in Unity Collaborate and it would compare both files side-by-side (this feature is built-in to vscode).
My issue is that this no longer works. VSCode just opens up a new window but there is no files being compared like before. I'm not sure if the argument names have changed but anything I have tried did not work. How can I use VSCode as the diff/merge tool again for Unity?
I have been using these as references:
https://docs.unity3d.com/2020.1/Documentation/Manual/Preferences.html#External-Tools
https://docs.unity3d.com/2021.1/Documentation/ScriptReference/EditorUtility.SetCustomDiffTool.html
https://docs.unity3d.com/2020.3/Documentation/Manual/SmartMerge.html
As my references for what parameters to use.
Here is an image of the configuration that no longer works:
Answer by gjf · Jan 30 at 03:41 PM
I'm not near my dev box to try it, but from looking at the parameters used by SetCustomDiffTool
, it looks like you might not need the -d
.
Did you try that?
Thanks for your reply gjf,
Unfortunately, the -d parameter is required for vscode to recognize that you are comparing two files for differences. However, just as a precaution, I did try removing the specified parameter using just #LEFT and #RIGHT as well as changing them to: #ABSLEFT and #ABSRIGHT
Your answer
Follow this Question
Related Questions
Unity 5.6, Testrunner, Edit mode, how to run tests automatically on compile 1 Answer
Unity 5 not using my Resolution Settings 2 Answers
Error in Console, for Editor Settings, don't understand how to fix 1 Answer
External Script Editor 2 Answers
Why does my Skybox appear to be a very different color than what should be default? 1 Answer