IntentArchitect / Support

A repository dedicated to handling issues and support queries
3 stars 0 forks source link

Changing the Diff Tool Executable does not change the diff tool that is launched when reviewing changes in the SF #26

Closed stephanjohnson closed 1 year ago

stephanjohnson commented 1 year ago

What happened?

I am currently using Visual Studio Code Insiders as my daily driver and wanted to change the default diff tool that Intent Architect uses when reviewing changes in the software factory. I updated the Diff Tool Executable path to %LOCALAPPDATA%\Programs\Microsoft VS Code Insiders\Code - Insiders.exe which matches the path to VSCode Insiders.

Intent Architect is still launching %LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe. I have restarted Intent Architect with no change in the expected behavior.

image

What version of Intent Architect are you using?

4.0.0

Additional information

No response

JonathanLydall commented 1 year ago

Hi @stephanjohnson,

Unless the Diff Tool Arguments field is also set, then the Diff Tool Executable is ignored, the arguments which work for VS Code are:

-r --diff %CURRENT_FILE% %CHANGED_FILE%

As this is not obvious, I've done a quick improvement to Intent for version 4.0.2 where this dialogue will now show an error if you press save with either of the fields being set without the other also being set.

stephanjohnson commented 1 year ago

When I add the above Diff Tool Arguments I get the following error when attempting to open a file from the SF:

An error occurred while trying to launch the diff tool:

{
  "error": {
    "errno": -4058,
    "code": "ENOENT",
    "syscall": "spawn %LOCALAPPDATA%\\Programs\\Microsoft VS Code Insiders\\Code - Insiders.exe",
    "path": "%LOCALAPPDATA%\\Programs\\Microsoft VS Code Insiders\\Code - Insiders.exe",
    "spawnargs": [
      "-r",
      "--diff",
      "C:\\Users\\StephanJohnson\\AppData\\Local\\Temp\\intent\\empty.cs",
      "C:\\Users\\StephanJohnson\\AppData\\Local\\Temp\\intent\\Platform.Tenant\\Platform.Tenant.Domain\\Entities\\NewClass.cs"
    ]
  },
  "command": "%LOCALAPPDATA%\\Programs\\Microsoft VS Code Insiders\\Code - Insiders.exe",
  "args": [
    "-r",
    "--diff",
    "C:\\Users\\StephanJohnson\\AppData\\Local\\Temp\\intent\\empty.cs",
    "C:\\Users\\StephanJohnson\\AppData\\Local\\Temp\\intent\\Platform.Tenant\\Platform.Tenant.Domain\\Entities\\NewClass.cs"
  ],
  "options": {
    "detached": true,
    "stdio": "ignore",
    "shell": false,
    "cwd": "C:\\Users\\STEPHA~1\\AppData\\Local\\Temp"
  }
}

I'll wait for 4.0.2 and try again.

PS: I did double check and %LOCALAPPDATA%\Programs\Microsoft VS Code Insiders\Code - Insiders.exe does correctly launch my copy of VS Code Insiders.

JonathanLydall commented 1 year ago

Hi @stephanjohnson, turns out environment variables weren't being expanded either, this is now also fixed for 4.0.2.

stephanjohnson commented 1 year ago

Great @JonathanLydall, I'll wait for 4.0.2 😃

stephanjohnson commented 1 year ago

@JonathanLydall just some feedback, I've updated to 4.0.2, and this issue has been resolved. Intent Architect now correctly launches Code Insiders