Browse Source

Name the new file's author, and require the group depth

The file this branch adds takes the contributor's name rather than
AlphaSierraPapa, and three comments it added drop their en-GB spelling.

EndOpenGroups now requires its target depth: zero is the one value that closes
groups the caller does not own, which is the misattribution the depth argument
was added to prevent.

Assisted-by: Claude:claude-opus-5[1m]:Claude Code
pull/4029/head
Siegfried Pammer 3 weeks ago
parent
commit
ea28552655
  1. 5
      ICSharpCode.Decompiler/DebugSteps/Stepper.cs
  2. 6
      ILSpy.Tests/Views/DebugStepsTests.cs
  3. 2
      ILSpy/Languages/TypedILLanguage.cs

5
ICSharpCode.Decompiler/DebugSteps/Stepper.cs

@ -271,10 +271,11 @@ namespace ICSharpCode.Decompiler.DebugSteps @@ -271,10 +271,11 @@ namespace ICSharpCode.Decompiler.DebugSteps
/// The groups are kept even when empty: a group that recorded nothing before it was abandoned is
/// precisely the one worth seeing, and <see cref="EndGroup"/>'s removal path expects the group to
/// still be the last entry of its parent, which an unwind cannot guarantee.
/// Closing stops at <paramref name="targetDepth"/>: a group that was already open before the
/// Closing stops at <paramref name="targetDepth"/>, which every caller must state: a group that
/// was already open before the
/// unwinding code ran belongs to whoever opened it, not to the unwind.
/// </summary>
public void EndOpenGroups(int targetDepth = 0)
public void EndOpenGroups(int targetDepth)
{
while (groups.Count > targetDepth)
EndGroup(keepIfEmpty: true);

6
ILSpy.Tests/Views/DebugStepsTests.cs

@ -95,7 +95,7 @@ public class DebugStepsTests @@ -95,7 +95,7 @@ public class DebugStepsTests
// from the View into the VM. If `Steps` is populated, any view that binds to it (now
// or later) will render the correct content.
//
// Recording is what produces steps at all, and no view is realised to switch it on here.
// Recording is what produces steps at all, and no view is realized to switch it on here.
AppComposition.Current.GetExport<DebugStepsPaneModel>().SetRecordingEnabled(true);
var window = AppComposition.Current.GetExport<MainWindow>();
@ -128,7 +128,7 @@ public class DebugStepsTests @@ -128,7 +128,7 @@ public class DebugStepsTests
[AvaloniaTest]
public async Task CSharp_DebugSteps_Are_Grouped_By_Ast_Transform()
{
// Steps exist only while the pane asks for them, and nothing realises the pane's view here,
// Steps exist only while the pane asks for them, and nothing realizes the pane's view here,
// so this test asks the same way the view does.
AppComposition.Current.GetExport<DebugStepsPaneModel>().SetRecordingEnabled(true);
@ -347,7 +347,7 @@ public class DebugStepsTests @@ -347,7 +347,7 @@ public class DebugStepsTests
[AvaloniaTest]
public async Task CSharp_DebugSteps_Cover_IL_Transforms_And_Replay_Renders_ILAst()
{
// Recording the IL half is what an open pane switches on; nothing realises the pane's view
// Recording the IL half is what an open pane switches on; nothing realizes the pane's view
// here, so this test asks for it the same way the view does.
var debugStepsVm = AppComposition.Current.GetExport<DebugStepsPaneModel>();
debugStepsVm.SetRecordingEnabled(true);

2
ILSpy/Languages/TypedILLanguage.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2026 AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) 2026 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

Loading…
Cancel
Save