Allow use of Visual Studio command line arguments (#31)

* Allow debug command line args
This commit is contained in:
Alexei Stukov
2022-09-01 23:48:15 +03:00
committed by GitHub
parent f286e2942d
commit f858c841d7
3 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ using Mono.Debugging.VisualStudio;
using System;
using System.Net;
using System.Runtime.InteropServices;
using VSLangProj;
namespace GodotAddinVS.Debugging
{
@@ -103,6 +104,13 @@ namespace GodotAddinVS.Debugging
var startArgs = new SoftDebuggerListenArgs(_baseProject.Name, IPAddress.Loopback, port) {MaxConnectionAttempts = 3};
var startInfo = new GodotStartInfo(startArgs, null, _baseProject) {WorkingDirectory = GodotPackage.Instance.GodotSolutionEventsListener?.SolutionDir};
try
{
if (_baseProject.ConfigurationManager.ActiveConfiguration.Object is ProjectConfigurationProperties props)
startInfo.StartArguments = props.StartArguments;
} catch(Exception){}
var session = new GodotDebuggerSession();
var launcher = new MonoDebuggerLauncher(new Progress<string>());

View File

@@ -136,7 +136,7 @@ namespace GodotAddinVS.Debugging
var processStartInfo = new ProcessStartInfo(GetGodotExecutablePath())
{
Arguments = $"--path {workingDir} --remote-debug {host}:{remoteDebugPort}", // TODO: Doesn't work with 4.0dev. Should be tcp://host:port which doesn't work in 3.2...
Arguments = $"--path {workingDir} --remote-debug {host}:{remoteDebugPort} {godotStartInfo.StartArguments}", // TODO: Doesn't work with 4.0dev. Should be tcp://host:port which doesn't work in 3.2...
WorkingDirectory = workingDir,
RedirectStandardOutput = true,
RedirectStandardError = true,

View File

@@ -6,6 +6,7 @@ namespace GodotAddinVS.Debugging
{
internal class GodotStartInfo : StartInfo
{
public string StartArguments;
public GodotStartInfo(SoftDebuggerStartArgs args, DebuggingOptions options, Project startupProject) :
base(args, options, startupProject)
{