mirror of
https://github.com/godotengine/godot-csharp-vscode.git
synced 2025-12-31 21:48:32 +03:00
Re-implements launching the Godot process with MedallionShell and provides the executableArguments to the command. MedallionShell handles the escaping of the arguments.
33 lines
686 B
C#
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);
|
|
}
|
|
}
|
|
}
|