When I CTRL + Click on something it does not go to the source code but infers headers from metadata. I would like to also be able to go to the source code sometimes. Is that possible?
Try Ctrl shift F or Shift F12
The problem is that Unity’s built-in generation of Visual Studio solutions doesn’t appear to create projects for assemblies that are in external packages.
Did you get around that somehow?
Rider supports this by default, resharper adds this to visual studios.
No; I have VSCode open and pointing to the my package cache folder so I can do Find in Files when I need to look at the source, but it’s definitely not good enough.
Good to know; odd that this isn’t something that VSTU handles, though.
Another not-good-enough-but-better-than-nothing-and-still-free solution:
Install ILspy – https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.ILSpy ; it adds a right-click menu option that you can can you to go to decompiled source.
Yeah ILSpy probably best free solution. I’ve tried it and it works ok but I had to go back. I can’t live without the Rider/Resharper decompile functionality anymore.
Yep I’m switched from many years of VS to Ruder half year ago, It’s definitely better.
Is the lack of packages assemblies in Visual Studio (without Resharper) a bug? Should I report it to somebody? And if so – Microsoft, or Unity?
I think you could consider it a missing feature, not a bug. It certainly would be nice to be able to double click a package source file and open the assembly as an actual project.
I wouldn’t say it’s a bug exactly, but a consequence of how Unity does packages. They’re not part of the VS solution. They’re loaded as DLLs. The source code happens to be available in the PackageCache folder and Unity loads the files from there when asked, but VS doesn’t have any way to know to go look there.
Resharper adds a feature to VS that lets you give it extra places outside of the solution to look for sources. It would be nice if VS had this as a core feature but it doesn’t for now.
Unity might be able to address this by changing how they load packages into the solution. I’m not sure if there’s a feasible fix there.
There’s also Visual Studio Tools for Unity. That may be able to add support to VS if there’s an available extension point. Resharper obviously achieves it somehow, but I’m not sure whether they’ve used an easy extension point or re-implemented the whole go to source feature.