Conversation
Removing assemblies one at a time cleaned up the tabs that showed them, but clearing the whole list did not: Clear() raises a Reset whose OldItems is null, and the handler pruned the history and returned before the loop that empties the main tab and closes the orphaned ones. The last decompiled member stayed on screen over an empty list. Sorting had to be fixed first. It rebuilt the collection through Clear() plus AddRange, so it raised the same Reset and dropped the whole navigation history as a side effect - and once Reset closes tabs, it would have closed all of those too. It now reorders in place, and a Move is ignored where a removal would be handled, because a sort removes nothing. Assisted-by: Claude:claude-opus-5:Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clearing the assembly list left the last decompiled member on screen over an empty list.
Removing the same assemblies one at a time cleaned up correctly, which is what made it look
intermittent.
AssemblyList.Clear()raises aReset, whoseOldItemsis null, andDockWorkspace.OnAssemblyListChangedpruned the history and returned before the loop thatcancels the in-flight decompile, empties the main tab and closes the orphaned ones.
Resetnowfalls through to that loop with
removed == nullstanding for "all of them", mirroring whatPruneHistoryAfterAssemblyListChange(null)already meant.Sorting had to be fixed first
AssemblyList.Sortrebuilt the collection throughClear()plusAddRange, so it raised thesame
Resetfor an operation that removes nothing - which already dropped the entireBack/Forward history as a side effect, and once
Resetcloses tabs would have closed every opentab as well.
It now reorders in place with
ObservableCollection.Move. AMovecarries the moved entry inOldItems, so both consumers -AssemblyTreeModel.OnActiveAssemblyListCollectionChangedandDockWorkspace.OnAssemblyListChanged- now ignore it explicitly; otherwise the new events wouldread as removals and re-create the same bug from the other direction.
Tests
AssemblyListResetTests, both written first and confirmed red against the current behaviour:clearing the list empties the decompiled view, and sorting it keeps the navigation history.
ILSpy.Tests: 1268 tests, no failures.Prepared by an AI agent (Claude, claude-opus-5, via Claude Code) and reviewed by @siegfriedpammer.
🤖 Generated with Claude Code