Enable Go To Definition (F12) should go to source if source symbols are available
Right now, source code integration for framework sources (or any other source-indexed PDB) is clunky. You have to be in a debug session for it to pull down the source.
If you're not in a debug session and use Go To Definition/Ctrl-Click/F12 on a Type/Method/Property, it'll take you to the object browser, or a code view that shows just the signatures.
I propose that VS check for a source PDB in the symbol path first, then if available, use the source code directly. This would be an option, of course, so people can retain the current behavior. It would also presumably cache failed PDB lookups for a period of time to prevent repeated slow lookups. There may also be a way to "force" VS to check for/dl PDBs for the current solution. Bonus: if newer source-enabled PDBs are present, it should replace the existing one.
Overall, this would make it easier to navigate through the source while in the editing context. One could set breakpoints and have them be hit as expected.
4 comments
-
Ivan Akcheurov commented
BTW this feature works in ReSharper 2017:
you need to set the symbol server in VS options,
then press F12 on a method defined externally
and Resharper downloads sources and navigates to the method definition. -
Ivan Akcheurov commented
1) When a user clicks "Go To Definition" on a Type/Method/Property
2) that has its sources on a Symbol Server (like SymbolSource or ProGet),
3) then it should download and navigate to the corresponding line in the sources. -
Christiaan Rakowski commented
There is an extension called Ref12, which can navigate you to the right place on the referencesource.microsoft.com website for .NET Framework code.
I have only used it with C# myself, but it mentions also supporting VB.
You can find it in the VS Marketplace: https://marketplace.visualstudio.com/items?itemName=SchabseSLaks.Ref12 -
Cameron Taggart commented
I'm the author of SourceLink and I'd really like to see this happen. I have a SourceLink.SymbolStore library in progress that would enable this. It just needs a Visual Studio extension that would enable it. I've recommended this to the Visual F# PowerTools team. https://github.com/fsprojects/VisualFSharpPowerTools/issues/201#issuecomment-39053873