cecil icon indicating copy to clipboard operation
cecil copied to clipboard

Add support for generating the method and generic method comment signature with nested types

Open hiihellox10 opened this issue 3 years ago • 6 comments

Hi @jbevain, current when a method or generic method with a nested type argument and that is defined in a generic class, the DocCommentId can't generate the comment signature of the method correctly. I created a few test methods with some special arguments for generate test XML documentation and make the DocCommentId can generate the same comment signature.

I don't have the specifications document of XML documentation that I now just found a basic introduction in Microsoft Docs but the introduction hasn't described the rules of the generic method. Although the comment signature of the generic method looks like has been fixed and maybe it's not a standard implementation. If you have the specifications document could you share them with me?

hiihellox10 avatar Apr 21 '21 06:04 hiihellox10

Hey @hiihellox10, thanks for the PR! Hey @joelmartinez, I know you depend on this, could you review?

jbevain avatar Apr 23 '21 23:04 jbevain

Oh, also ... just for the sake of referencing, this is a fix to #606

joelmartinez avatar Apr 26 '21 21:04 joelmartinez

If you have the specifications document could you share them with me?

The spec Roslyn uses can be found here, and the implementation is here and here.

Note that different compilers (e.g. Roslyn vs MSVC) and doc processing tools (e.g. whatever MS uses for the docs that ship with the framework) can differ in their documentation ID syntax, so there may be more than one "correct" ID for a given type/member. ex: https://github.com/dotnet/roslyn/issues/52599

saucecontrol avatar May 05 '21 19:05 saucecontrol

@saucecontrol "whatever ms uses for the docs" is mdoc (which uses cecil's implementation). This is the reason that @hiihellox10 and I are working on this issue 🤣

Thanks for that link though, that was helpful. I think that reading through it (albeit briefly) the changes here seem to match the specs.

joelmartinez avatar May 05 '21 20:05 joelmartinez

Well that is fascinating. I happened to find this PR while looking up the source for GenericInstanceType to make sure I was navigating it correctly while re-working my own doc tool to allow for multiple doc ID syntaxes to account for these differences. Small world. 🤣

saucecontrol avatar May 05 '21 21:05 saucecontrol

Hi @jbevain @joelmartinez, could you please help review this PR? Also, the CI is awaiting an approval.

hiihellox10 avatar May 11 '21 08:05 hiihellox10