XmlDocMarkdown icon indicating copy to clipboard operation
XmlDocMarkdown copied to clipboard

`--source` option hard-codes ".cs" in the file paths

Open SteveGilham opened this issue 5 years ago • 2 comments

Feeding xmldocmd an F# project results in source links like

* [WhatIfExtension.cs](https://github.com/SteveGilham/altcover/tree/master/AltCover/WhatIfExtension.cs)

This one is, fortuitously correct in guessing the file name w/o extension, but it seems that the algorithm used to generate the path is simply to take [TypeName].cs, making an assumption of language as well as coding style; when the information required to do it correctly should be present in the associated .pdb files.

I've not yet started reading the code (to see what happens with partial classes), nor trying this with other languages like VB or C++/CLI.

SteveGilham avatar Jun 01 '20 09:06 SteveGilham

This is do-able using System.Reflection.Metadata, with the limitation that interfaces, enums and similar items without executable code don't have representation in the .pdb files.

SteveGilham avatar Jun 07 '20 13:06 SteveGilham

Proof of concept (within its limitations) of the System.Reflection.Metadata approach here; doesn't have any of the administrivia yet to make a PR.

SteveGilham avatar Jun 08 '20 18:06 SteveGilham