-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
Allow Go To Definition to pull sources from Source Link enabled assemblies.
See also #24349
Background:
-
Embed document information into the PDB for types that don't otherwise have it
Process:
-
Given a symbol, get the metadata token for it - Given a DLL, find the implementation assembly
ref assemblies don't have pdbs, so need a "real" oneCan tell by an attribute in the DLL
- Might be in the nuget cache, so can maybe follow nuget naming conventions
- eg, if something is in
ref\*then we might just need to go to..\lib\* - There might be multiple, for different platforms
- We know the context you navigated from, and should use that knowledge to find the best one to load
- Ideally a Nuget API exists for this, since they already know all of this
- If there is one, make sure its async
- We should list the other contexts in the nav bar
- eg, if something is in
- Might be in some platform ref assembly somewhere
- With .net framework, could just hardcode a mapping. we just need the MVID from the implementation dlls
- When .NET Framework is serviced, the impl assemblies would get a new guid, but ref assemblies wouldn't change
- Need a database of all these links, from ref to lib, and some way to automate updating it
- For .NET Core, can probably ask the runtime/SDK to ship a list if they don't already
- Whats the story if someone is targeting .net core 3.1, but doesn't have it installed locally
- Provide mapping of reference assemblies to their implementations sdk#12360
- With .net framework, could just hardcode a mapping. we just need the MVID from the implementation dlls
-
Given the implementation assembly, find the PDBDebugger will provide this service (exposed over service broker) that gives us the PDB given some information we find in the implementation DLL (MVID)
-
Given the PDB and metadata token, find the source link URLSamuel worked of going from metadata token to source link url and document etc.Cherry-pick/cleanup Gtd - samuel #54337
-
We need to download the source from the URLDebugger will provide this service, taking into account their various caches
-
Put the source in a workspaceMiscellaneous workspace is fine to start with- Long term would like better support for references etc.
Possibly fine for everything, but probably need to create a project to put things inNew compilations will have embedded options and references, so should be straight forward- Dependencies might be already in our solution, otherwise can ask the debugger for them
- Metadata-as-source has the same issue so might have some ideas, or existing things to look at
- Nope! It has the same issue: Decompiler does not decode some assemblies... #58192
- We need to call Codex to let them have a go at finding things too.
-
PDB could be embedded. Source could be embeddedGo To Definition from source information in PDBs #57073Follow ups:[SourceLink] Ensure embedded source is shown with the right encoding #57350[SourceLink] Ensure source file found on disk matches compiled DLL #57351[SourceLink] Output window logging #57352- [SourceLink] Metadata As Source service should use solution snapshot instead of Workspace.CurrentSolution #57353
[SourceLink] Use PEReader to try to read pdbs #57417- Allow returning multiple file results
- Don't ignore checksum for SourceLink files, do smarter checks: Try with CRLF, then try with LF
- Add option for "Always check Microsoft and Nuget symbol servers in GTD"
Support Go To Implementation/Base: Go to Implementation/Base to include external references #58147- Support Find All References: Find All References to include external references #59568
- Support Go To All
- Investigate using Background Work Indicator for GTD/Source Link #59710
- Add option to always use known symbol servers for embedded and Source Link navigation #59712
- Better handle multiple definitions from Source Link in GTD #59713
Also:
- Need an LSP answer to this now, which may or may not be supported by the current implementation
Reactions are currently unavailable