Files
godot-csharp-vscode/GodotDebugSession/ActionTextWriter.cs
Raul Santos 16aabde8c5 Use executableArguments when launching the Godot process
Re-implements launching the Godot process with MedallionShell
and provides the executableArguments to the command.

MedallionShell handles the escaping of the arguments.
2021-07-23 12:37:18 +02:00

33 lines
686 B
C#

using System;
using System.IO;
using System.Text;
namespace GodotDebugSession
{
public class ActionTextWriter : TextWriter
{
private readonly StringBuilder buffer = new StringBuilder();
private Action<string> Writer { get; }
public ActionTextWriter(Action<string> writer)
{
Writer = writer;
}
public override Encoding Encoding => Encoding.UTF8;
public override void Write(char value)
{
if (value == '\n')
{
Writer(buffer.ToString());
buffer.Clear();
return;
}
buffer.Append(value);
}
}
}