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.
51 lines
1.6 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|