Files
godot-csharp-vscode/GodotDebugSession/GodotDebuggerStartInfo.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

51 lines
1.6 KiB
C#

using System.IO;
using Mono.Debugging.Soft;
namespace GodotDebugSession
{
public class GodotDebuggerStartInfo : SoftDebuggerStartInfo
{
public string GodotExecutablePath { get; }
public string[] ExecutableArguments { get; }
public ExecutionType ExecutionType { get; }
public IProcessOutputListener ProcessOutputListener { get; }
public GodotDebuggerStartInfo(ExecutionType executionType, string godotExecutablePath,
string[] executableArguments, IProcessOutputListener processOutputListener,
SoftDebuggerRemoteArgs softDebuggerConnectArgs) :
base(softDebuggerConnectArgs)
{
ExecutionType = executionType;
GodotExecutablePath = godotExecutablePath;
ExecutableArguments = executableArguments;
ProcessOutputListener = processOutputListener;
}
}
public enum ExecutionType
{
PlayInEditor,
Launch,
Attach
}
public interface IProcessOutputListener
{
void ReceiveStdOut(string data);
void ReceiveStdErr(string data);
}
public static class IProcessOutputListenerExtensions
{
public static TextWriter GetStdOutTextWriter(this IProcessOutputListener processOutputListener)
{
return new ActionTextWriter(processOutputListener.ReceiveStdOut);
}
public static TextWriter GetStdErrTextWriter(this IProcessOutputListener processOutputListener)
{
return new ActionTextWriter(processOutputListener.ReceiveStdErr);
}
}
}