ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

add "Referenced Types" under References

Open fowl2 opened this issue 1 year ago • 6 comments

Problem

Seeing the types/members referenced in an assembly reference is cumbersome.

Solution

Add a "Referenced Types" child node to each reference which contains the referenced types, including exported/forwarded types.

Future enhancements:

  • C#-ify the names
  • other children eg. ManifestResource

image screenshot including forwarded/exported types

partially fixes https://github.com/icsharpcode/ILSpy/issues/2690. It looked like trying to add "analysis" for anything that's not IEntity was going to be a bad time.

fowl2 avatar Oct 05 '23 13:10 fowl2

Thank you for proposing this feature! It definitely looks interesting, some notes/comments from my side:

  • I am currently working on #3068 which will most likely require some refactoring in ILSpy's tree nodes, which will conflict with this feature. Until the refactoring is done, I won't be able to merge this.
  • The icon for exported types looks really strange, maybe we can come up with some better symbol.
  • I don't think any tree nodes should print their signature info in the tooltip, I'd prefer to do the same as we do for all other tree nodes of type definitions and members.
  • The tree node label (i.e., Text property) should use the appropriate methods of the currently selected Language implementation.

siegfriedpammer avatar Nov 04 '23 19:11 siegfriedpammer

Thank you for proposing this feature! It definitely looks interesting, some notes/comments from my side:

:)

I am currently working on Support reading raw metadata blobs and Portable PDBs #3068 which will most likely require some refactoring in ILSpy's tree nodes, which will conflict with this feature. Until the refactoring is done, I won't be able to merge this.

Sure.

The icon for exported types looks really strange, maybe we can come up with some better symbol.

Yeah. Maybe something like the "Type" icon with a "Shortcut" overlay? (not that I know how to implement that)

I don't think any tree nodes should print their signature info in the tooltip, I'd prefer to do the same as we do for all other tree nodes of type definitions and members.

I'm not 100% sure what you mean here, but I'll try to figure it out the next time I have a chance.

The tree node label (i.e., Text property) should use the appropriate methods of the currently selected Language implementation.

Do you mean completing the TODO inside CSharpLanguage::GetEntityName, or using a different method?

fowl2 avatar Nov 05 '23 03:11 fowl2

@fowl2 if you don't mind, I will be taking your branch and add the missing things, clean it up, etc. and push my changes here for further discussion...

siegfriedpammer avatar Jan 06 '24 12:01 siegfriedpammer

@siegfriedpammer sure, any way I can be help.

Have been looking into wether it would make sense to have an implementation of IMember, possibly unified with FakeMember etc. to get the correct language specific formatting and possibly the analysis features working, but I'm still thinking through any "fuzziness" with mismatches, etc.

fowl2 avatar Jan 08 '24 09:01 fowl2

Note: looking at the code, it seems it does not support showing nested type references.

siegfriedpammer avatar Jan 20 '24 16:01 siegfriedpammer

One problem with getting nice member signatures in the tree view is that we probably want to show all members even those from assemblies that are not resolvable. So probably Language.GetEntityName based on SRM is the best we can do, without creating yet another layer doing similar things.

siegfriedpammer avatar Jan 20 '24 19:01 siegfriedpammer

Thank you for proposing and implementing this feature. Sorry that it took so long to get this merged.

siegfriedpammer avatar Mar 16 '24 14:03 siegfriedpammer