ejball / XmlDocMarkdown

Generates Markdown from .NET XML documentation comments.
https://ejball.com/XmlDocMarkdown/
MIT License
101 stars 30 forks source link

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

Open SteveGilham opened 4 years ago

SteveGilham commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.