-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing code generated for XML elements in documentation comments #47
Comments
Unfortunately the algorithm breaks down when there's more than one way to create the given tree. It works so well in general because usually there's only a single method that can create a node of the desired type, so there's no ambiguity. However Xml factory methods were added later, and they have a few convenience methods, so the algorithm just chooses the first one that works, and that explains the results above. We'd need some heuristics to fine tune this behavior and provide hints to the algorithm on a case-by-case basis. |
See here for details: RoslynQuoter/src/Quoter/Quoter.cs Line 897 in d2fd4be
I'm not sure how to add such a heuristic, perhaps we can have "factoryMethodsToPrefer", so we can disambiguate here: RoslynQuoter/src/Quoter/Quoter.cs Line 1069 in d2fd4be
|
Consider a member with XML documentation comment:
The relevant section of code generated for the XML comment is:
Notice how the code first creates an
<example>
element and then overwrites both tags with the right name. That's not technically wrong, but it's certainly a confusing way to create the tree.Ideally, RoslynQuoter should use a specific factory method, when one is available (in this case,
XmlSummaryElement
). Though always using the genericXmlElement
method would be fine too.The text was updated successfully, but these errors were encountered: