refactor debugger additionalproperties
This commit is contained in:
@@ -75,12 +75,10 @@ public class DebuggingService
|
|||||||
debugProtocolHost.RegisterEventType<StoppedEvent>(async void (@event) =>
|
debugProtocolHost.RegisterEventType<StoppedEvent>(async void (@event) =>
|
||||||
{
|
{
|
||||||
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); // The VS Code Debug Protocol throws if you try to send a request from the dispatcher thread
|
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); // The VS Code Debug Protocol throws if you try to send a request from the dispatcher thread
|
||||||
//Dictionary<string, JToken>? test = @event.AdditionalProperties;
|
var additionalProperties = @event.AdditionalProperties;
|
||||||
var prop = @event.GetType().GetProperty("AdditionalProperties", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
||||||
// source, line, column
|
// source, line, column
|
||||||
var dict = prop?.GetValue(@event) as Dictionary<string, JToken>;
|
var filePath = additionalProperties?["source"]?["path"]!.Value<string>()!;
|
||||||
var filePath = dict?["source"]?["path"]!.Value<string>()!;
|
var line = (additionalProperties?["line"]?.Value<int>()!).Value;
|
||||||
var line = (dict?["line"]?.Value<int>()!).Value;
|
|
||||||
var executionStopInfo = new ExecutionStopInfo { FilePath = filePath, Line = line, ThreadId = @event.ThreadId!.Value };
|
var executionStopInfo = new ExecutionStopInfo { FilePath = filePath, Line = line, ThreadId = @event.ThreadId!.Value };
|
||||||
GlobalEvents.Instance.DebuggerExecutionStopped.InvokeParallelFireAndForget(executionStopInfo);
|
GlobalEvents.Instance.DebuggerExecutionStopped.InvokeParallelFireAndForget(executionStopInfo);
|
||||||
if (@event.Reason is StoppedEvent.ReasonValue.Exception)
|
if (@event.Reason is StoppedEvent.ReasonValue.Exception)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<Publicize Include="Microsoft.CodeAnalysis.Razor.SemanticTokens" />
|
<Publicize Include="Microsoft.CodeAnalysis.Razor.SemanticTokens" />
|
||||||
<Publicize Include="Microsoft.CodeAnalysis.Workspaces" />
|
<Publicize Include="Microsoft.CodeAnalysis.Workspaces" />
|
||||||
<Publicize Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
|
<Publicize Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
|
||||||
|
<Publicize Include="Microsoft.VisualStudio.Shared.VSCodeDebugProtocol" IncludeCompilerGeneratedMembers="false" />
|
||||||
<DoNotPublicize Include="Microsoft.CodeAnalysis.Workspaces:System.Linq.RoslynEnumerableExtensions" />
|
<DoNotPublicize Include="Microsoft.CodeAnalysis.Workspaces:System.Linq.RoslynEnumerableExtensions" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user