SLaks/Ref12

Support http://www.symbolsource.org

Opened this issue · 10 comments

http://www.symbolsource.org/Public is a public reference provider for open source software.
It would be great if the extension could look up the source in it, if it fails to find it on the Microsoft reference source server.

Yes; I want to do something like that.

However, I'll need some way to map a DLL on disk to the right project, and an HTML page that I can open with the symbol ID (as a doc comment ID or RQName) and redirect to actual source somewhere (GitHub?)

I don't think this is doable without some server-side architecture that does not yet exist.

For my existing extensibility (which may need to be modified to make this more possible), see https://github.com/SLaks/Ref12/blob/master/Ref12/Services/ReferenceSourceProvider.cs#L15

Alternatively, I could download the full symbol files on-demand, and open them in VS when you hit F12.
However, I would still need to figure out where to go from there.
I don't think there is any way to find the right NuGet / CodePlex project & tag?

I don't know yet, this was just off the top of my head, need to do some digging.
This is what R# does when you press F12 -- tries to grab from MS reference server, if fails, Symbolsource, otherwise decompiles.

What do you mean by "go from there", how to navigate to the correct method that was invoked?

Yes.
Once I get the line number & filename from symbols, how/where do I display them?

I suppose just open the file with DTE, and navigate to the line :)
Too naive?

What from?
Do you mean to download the individual source files from SymbolSource? (do they host source or just symbols?)

The problem with that approach is that it would be completely impossible to jump elsewhere in the target project (as opposed to opening on GitHub, which has a nice file browser)

Also, ideally, I'd like to keep PDB logic server-side, so that addin itself would never actually download PDBs (for perf).
In other words, create an index file (like a.html) mapping symbol IDs to source files for an HTML redirector.

See http://blog.slaks.net/2014-02-24/dissecting-the-new-net-reference-source-browser/

Symbol Source hosts both PDBs and the source files for projects. My estimate for a workflow is:

  1. Locate the DLL where the symbol is declared.
  2. If the symbol is declared in a packages folder alongside the solution, assume it is part of a NuGet package and get the package name from the directory name packages/{PackageNameAndVersion}. Use this information to try and locate the appropriate source package in Symbol Source (NuGet may provide a command out of the box to do this for you).
  3. Otherwise, assume the source is located in the Microsoft Reference Source.

I think my SourceLink.SymbolSource package can help out here. I just announced it. I'm happy to make a more C# friendly interface if you open and issue and propose an interface that you want.