diff --git a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs index ac820b0..4e50cc7 100644 --- a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs +++ b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs @@ -18,7 +18,8 @@ public class DebuggingService StartInfo = new ProcessStartInfo { FileName = @"C:\Users\Matthew\Downloads\netcoredbg-win64\netcoredbg\netcoredbg.exe", - Arguments = """ --interpreter=vscode -- "C:\Program Files\dotnet\dotnet.exe" "C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\artifacts\bin\WebApi\debug\WebApi.dll" """, RedirectStandardInput = true, + Arguments = """--interpreter=vscode""", + RedirectStandardInput = true, RedirectStandardOutput = true, UseShellExecute = false } @@ -31,11 +32,13 @@ public class DebuggingService { options.AdapterId = "coreclr"; options.ClientId = "vscode"; + options.ClientName = "Visual Studio Code"; options.LinesStartAt1 = true; options.ColumnsStartAt1 = true; options.SupportsVariableType = true; options.SupportsVariablePaging = true; options.SupportsRunInTerminalRequest = true; + options.Locale = "en-us"; options.PathFormat = PathFormat.Path; options .WithInput(process.StandardOutput.BaseStream) @@ -52,6 +55,11 @@ public class DebuggingService { Console.WriteLine($"Breakpoint hit: {breakpointEvent}"); }) + .OnRunInTerminal(async (arguments, token) => + { + Console.WriteLine("Run In Terminal"); + return new RunInTerminalResponse(); + }) .OnStopped(async (stoppedEvent, token) => { Console.WriteLine($"Notification received: {stoppedEvent}"); @@ -64,7 +72,6 @@ public class DebuggingService //.OnNotification(EventNames., ); }); - await client.Initialize(cancellationToken); var breakpointsResponse = await client.SetBreakpoints(new SetBreakpointsArguments { @@ -76,7 +83,10 @@ public class DebuggingService NoDebug = false, ExtensionData = new Dictionary { - //["program"] = @"""C:\Program Files\dotnet\dotnet.exe"" ""C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\artifacts\bin\WebApi\debug\WebApi.dll""", + ["name"] = "LaunchRequestName", + ["type"] = "coreclr", + ["program"] = @"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\artifacts\bin\WebApi\debug\WebApi.dll", + ["cwd"] = "" //["cwd"] = @"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\artifacts\bin\WebApi\debug", // working directory //["stopAtEntry"] = true, //["env"] = new Dictionary { { "ASPNETCORE_ENVIRONMENT", "Development" } } @@ -96,7 +106,7 @@ public class DebuggingService var variablesResponse = await client.RequestVariables(new VariablesArguments() {VariablesReference = scope.VariablesReference}, cancellationToken); var variable = variablesResponse.Variables!.Skip(1).First(); var variables2Response = await client.RequestVariables(new VariablesArguments() {VariablesReference = variable.VariablesReference}, cancellationToken); - var variable2 = variables2Response.Variables!.Single(); + var variable2 = variables2Response.Variables!.First(); var variables3Response = await client.RequestVariables(new VariablesArguments() {VariablesReference = variable2.VariablesReference}, cancellationToken); //var continueResponse = await client.RequestContinue(new ContinueArguments(){ThreadId = 1}, cancellationToken); //await Task.Delay(1000); diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index 2c75448..4fd6f1c 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -4,6 +4,7 @@ using System.Linq; using Godot; using Microsoft.Build.Locator; using SharpIDE.Application.Features.Analysis; +using SharpIDE.Application.Features.Debugging; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; namespace SharpIDE.Godot; @@ -25,6 +26,8 @@ public partial class IdeRoot : Control _fileDialog.FileSelected += OnFileSelected; _openSlnButton.Pressed += () => _fileDialog.Visible = true; //_fileDialog.Visible = true; + var test = new DebuggingService(); + _ = test.Test(); OnFileSelected(@"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\BlazorCodeBreaker.slnx"); }