Skip to content

Commit 962ce70

Browse files
committed
cleanup
1 parent e20892d commit 962ce70

1 file changed

Lines changed: 30 additions & 20 deletions

File tree

src/DiffEngine/Tray/PiperClient.cs

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ public static Task SendDeleteAsync(
1414
}
1515

1616
static string BuildDeletePayload(string file) =>
17-
$@"{{
18-
""Type"":""Delete"",
19-
""File"":""{file.JsonEscape()}""
20-
}}
21-
";
17+
$$"""
18+
{
19+
"Type":"Delete",
20+
"File":"{{file.JsonEscape()}}"
21+
}
22+
23+
""";
2224

2325
public static void SendMove(
2426
string tempFile,
@@ -44,23 +46,29 @@ public static Task SendMoveAsync(
4446

4547
public static string BuildMovePayload(string tempFile, string targetFile, string? exe, string? arguments, bool canKill, int? processId)
4648
{
47-
var builder = new StringBuilder($@"{{
48-
""Type"":""Move"",
49-
""Temp"":""{tempFile.JsonEscape()}"",
50-
""Target"":""{targetFile.JsonEscape()}"",
51-
""CanKill"":{canKill.ToString().ToLower()}");
49+
var builder = new StringBuilder($$"""
50+
{
51+
"Type":"Move",
52+
"Temp":"{{tempFile.JsonEscape()}}",
53+
"Target":"{{targetFile.JsonEscape()}}",
54+
"CanKill":{{canKill.ToString().ToLower()}}
55+
""");
5256

5357
if (exe != null)
5458
{
55-
builder.Append($@",
56-
""Exe"":""{exe.JsonEscape()}"",
57-
""Arguments"":""{arguments!.JsonEscape()}""");
59+
builder.Append($"""
60+
,
61+
"Exe":"{exe.JsonEscape()}",
62+
"Arguments":"{arguments!.JsonEscape()}"
63+
""");
5864
}
5965

6066
if (processId != null)
6167
{
62-
builder.Append(@$",
63-
""ProcessId"":{processId}");
68+
builder.Append($"""
69+
,
70+
"ProcessId":{processId}
71+
""");
6472
}
6573

6674
builder.AppendLine();
@@ -93,13 +101,15 @@ static async Task SendAsync(string payload)
93101
}
94102

95103
static void HandleSendException(string payload, Exception exception) =>
96-
Trace.WriteLine($@"Failed to send payload to DiffEngineTray.
104+
Trace.WriteLine($"""
105+
Failed to send payload to DiffEngineTray.
97106
98-
Payload:
99-
{payload}
107+
Payload:
108+
{payload}
100109
101-
Exception:
102-
{exception}");
110+
Exception:
111+
{exception}
112+
""");
103113

104114
static void InnerSend(string payload)
105115
{

0 commit comments

Comments
 (0)