Skip to content

Commit

Permalink
add rider diff support
Browse files Browse the repository at this point in the history
fixes #77
  • Loading branch information
SimonCropp committed Apr 5, 2020
1 parent b160579 commit 437a446
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/DiffEngine/DiffTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public enum DiffTool
AraxisMerge,
P4Merge,
BeyondCompare,
Rider
}
}
1 change: 1 addition & 0 deletions src/DiffEngine/DiffTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal static List<ToolDefinition> Tools()
{
return new List<ToolDefinition>
{
Implementation.Rider(),
Implementation.VisualStudio(),
Implementation.VsCode(),
Implementation.TkDiff(),
Expand Down
20 changes: 20 additions & 0 deletions src/DiffEngine/Implementation/Rider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using DiffEngine;

static partial class Implementation
{
public static ToolDefinition Rider() => new ToolDefinition(
name: DiffTool.Rider,
url: "https://www.jetbrains.com/rider/",
supportsAutoRefresh: false,
isMdi: false,
supportsText: true,
buildArguments: (tempFile, targetFile) => $" diff \"{tempFile}\" \"{targetFile}\"",
windowsExePaths: new[]
{
@"%ProgramFiles%\JetBrains\JetBrains Rider *\bin\rider64.exe"
},
binaryExtensions: Array.Empty<string>(),
linuxExePaths: Array.Empty<string>(),
osxExePaths: Array.Empty<string>());
}
3 changes: 1 addition & 2 deletions src/DiffEngine/ProcessCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;

namespace DiffEngine
{
Expand Down
12 changes: 5 additions & 7 deletions src/DiffEngine/ToolDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using DiffEngine;

Expand Down Expand Up @@ -70,15 +71,12 @@ void FindExe(string[] exePaths)
{
foreach (var exePath in exePaths)
{
var expanded = Environment.ExpandEnvironmentVariables(exePath);
if (!File.Exists(expanded))
if (WildcardFileFinder.TryFind(exePath, out var result))
{
continue;
ExePath = result;
Exists = true;
return;
}

ExePath = expanded;
Exists = true;
return;
}
}
}

0 comments on commit 437a446

Please sign in to comment.