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