-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugProtocolClientExtensions.cs
35 lines (30 loc) · 1.29 KB
/
DebugProtocolClientExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Microsoft.VisualStudio.Shared.VSCodeDebugProtocol;
using Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Exception = System.Exception;
namespace Onec.DebugAdapter.Extensions
{
internal static class DebugProtocolClientExtensions
{
internal static void SendOutput(this DebugProtocolClient client, string message)
=> client.SendOutputEvent(message, OutputEvent.CategoryValue.Stdout);
internal static void SendError(this DebugProtocolClient client, Exception ex)
=> client.SendError(ex.Message);
internal static void SendError(this DebugProtocolClient client, string message, Exception ex)
=> client.SendError($"{message}: {ex}");
internal static void SendError(this DebugProtocolClient client, string message)
=> client.SendOutputEvent(message, OutputEvent.CategoryValue.Stderr);
internal static void SendOutputEvent(this DebugProtocolClient client, string message, OutputEvent.CategoryValue category)
{
client.SendEvent(new OutputEvent()
{
Category = category,
Output = message
});
}
}
}