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

Decompilation does not support "collapse to definitions" #26436

Closed
CyrusNajmabadi opened this issue Apr 26, 2018 · 7 comments
Closed

Decompilation does not support "collapse to definitions" #26436

CyrusNajmabadi opened this issue Apr 26, 2018 · 7 comments
Labels
Milestone

Comments

@CyrusNajmabadi
Copy link
Member

For example, Decompile "ImmutableArray". Now try to collapse to definitions. The option is in the menu, but it has no effect. This makes decompile a pretty poor MAS replacement as it's super hard to actually get a sense of all the structure of the type.

What is also weird is that some things are collapsed in the decompile view. For example:

image

The attributes are collapsed. However:

  1. The comments are not collapsible.
  2. Class bodies and method bodies are not collapsible.

I actually have no idea what's going on, but it's not good :)

@CyrusNajmabadi
Copy link
Member Author

Also: disabling "navigate to external sources" has no effect. Even if i disable it, if i try to go back to ImmutableArray, it takes me back to this file.

@CyrusNajmabadi
Copy link
Member Author

Tagging @sharwell . This is related to: #26426

Namely that decompilation should not hijack MAS while the experience is so jarringly poor (comparatively).

@CyrusNajmabadi
Copy link
Member Author

Here is the experience i get with MAS:

image

I would love if we could be very close to that, just with actual decompiled code.

@siegfriedpammer
Copy link
Contributor

I just discovered the following difference between decompiler output and metadata output:

Decompiled view:
grafik

Metadata view:
grafik

Notice that metadata view uses normal one line comments for the documentation vs. the decompiler generates standard XML doc comments. Uncollapsing the region at the top, it can also be seen that multiple lines of single line comments are folded even in the decompiler view.

Question: Can we change the VS to fold XML doc comments as well? If so, where would I have to look at? XML docs are folded in normal user code, so what/where is the difference in MetadataAsSourceService? Any pointers in the right direction would be very welcome.

Another solution would be to change the decompiler to format the XML doc the same way it is done in metadata view.

@siegfriedpammer
Copy link
Contributor

Also: The MetadataAsSourceService might need some additonal work to properly fold method body blocks. It seems that it uses a stripped down version, which cannot deal with block statements and documentation comments. After that is fixed, it should be quite pleasant to look at the decompiled source code.

Any pointers in the right direction (area of Roslyn) would be much appreciated!

@siegfriedpammer
Copy link
Contributor

I think we'd either have to implement some more AbstractMetadataAsSourceStructureProviders specifically for the MetadataAsSource workspace to add the missing features (but this might alter the behavior of plain old metadata view), or we declare the decompiled sources as a different workspace?

Which solution is preferred?

@CyrusNajmabadi
Copy link
Member Author

Closing out as the experience is much improved.

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants