Skip to content

Commit 7e67915

Browse files
committed
Make Deletes respect Build and AI detection
1 parent a616d91 commit 7e67915

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
public class DiffEngineTrayTest(ITestOutputHelper output) :
1+
#pragma warning disable CS0618 // Type or member is obsolete
2+
public class DiffEngineTrayTest(ITestOutputHelper output) :
23
XunitContextBase(output)
34
{
45
[Fact]
56
public void IsRunning() =>
67
Assert.False(DiffEngineTray.IsRunning);
7-
}
8+
}

src/DiffEngine/DiffRunner.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
namespace DiffEngine;
1+
#pragma warning disable CS0618 // Type or member is obsolete
2+
namespace DiffEngine;
23

34
/// <summary>
45
/// Manages diff tools processes.
@@ -109,6 +110,26 @@ public static LaunchResult Launch(ResolvedTool tool, string tempFile, string tar
109110
encoding);
110111
}
111112

113+
public static void AddDelete(string file)
114+
{
115+
if (Disabled)
116+
{
117+
return;
118+
}
119+
120+
DiffEngineTray.AddDelete(file);
121+
}
122+
123+
public static Task AddDeleteAsync(string file)
124+
{
125+
if (Disabled)
126+
{
127+
return Task.CompletedTask;
128+
}
129+
130+
return DiffEngineTray.AddDeleteAsync(file);
131+
}
132+
112133
public static Task<LaunchResult> LaunchAsync(ResolvedTool tool, string tempFile, string targetFile, Encoding? encoding = null)
113134
{
114135
GuardFiles(tempFile, targetFile);

src/DiffEngine/Tray/DiffEngineTray.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace DiffEngine;
22

3+
[Obsolete("Use DiffRunner")]
34
public static class DiffEngineTray
45
{
56
static DiffEngineTray()
@@ -72,4 +73,4 @@ public static Task AddMoveAsync(
7273

7374
return PiperClient.SendMoveAsync(tempFile, targetFile, exe, arguments, canKill, processId, cancel);
7475
}
75-
}
76+
}

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649;NU1608;NU1109</NoWarn>
5-
<Version>18.1.2</Version>
5+
<Version>18.2.0</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
88
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>

0 commit comments

Comments
 (0)