Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompile base & derived types in place #3081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miloush
Copy link
Contributor

@miloush miloush commented Sep 9, 2023

Problem

The list of base and derived types in ILSpy does not show anything useful in the output. At least assembly name and list of base types would be helpful, but I don't see any reason why the whole type, which already provides this information, cannot be decompiled in place - it is a simple change in the code and users do not have to jump back and forth when going through and comparing the implementations.

Solution

  • This PR makes the base and derived type nodes decompile the respective types.
  • The parent nodes (BaseTypesTreeNode and DerivedTypesTreeNode) were calling all children to decompile. However, with increasing information in child nodes, it is not sustainable. They now explicitly list the children type names only, like they did before.
  • While trivial in base types, the derived types are loaded asynchronously and children are not available on first decompilation. I don't see any easy way to await/add continuation to the loading, but I did not deem the output of Derived Types node to be critical enough, so the output will be empty the first time. Open to ideas if that is not satisfactory.

App.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(EnsureLazyChildren));
for (int i = 0; i < Children.Count; i++)
{
// LazyChildren are async and will not be ready on first call, avoid foreach.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how avoiding foreach helps here, you still have a race condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants