readthedocs / sphinxcontrib-dotnetdomain

A Sphinx domain for .NET languages
MIT License
15 stars 17 forks source link

"Parsing signature failed" warning when type has C# indexers #51

Closed agjohnson closed 8 years ago

agjohnson commented 8 years ago

C# has a feature where you can define custom indexers for a type. Indexers allow instances of a class or struct to be indexed just like arrays. Indexers resemble properties except that their accessors take parameters.

When I run autoapi on a type that defines an indexer I get the following warning:

WARNING: Parsing signature failed: "ClassLibrary3.TagHelperAttributeList.Item[System.String]"

Here is the type:

    public class TagHelperAttributeList
    {
        /// <summary>
        /// Gets the first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.Name"/> matching
        /// <paramref name="name"/>. When setting, replaces the first matching
        /// <see cref="TagHelperAttribute"/> with the specified <paramref name="value"/> and removes any additional
        /// matching <see cref="TagHelperAttribute"/>s. If a matching <see cref="TagHelperAttribute"/> is not found,
        /// adds the specified <paramref name="value"/> to the end of the collection.
        /// </summary>
        /// <param name="name">
        /// The <see cref="TagHelperAttribute.Name"/> of the <see cref="TagHelperAttribute"/> to get or set.
        /// </param>
        /// <returns>The first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.Name"/> matching
        /// <paramref name="name"/>.
        /// </returns>
        /// <remarks><paramref name="name"/> is compared case-insensitively. When setting,
        /// <see cref="TagHelperAttribute"/>s <see cref="TagHelperAttribute.Name"/> must be <c>null</c> or
        /// case-insensitively match the specified <paramref name="name"/>.</remarks>
        /// <example>
        /// <code>
        /// var attributes = new TagHelperAttributeList();
        ///
        /// // Will "value" be converted to a TagHelperAttribute with a null Name
        /// attributes["name"] = "value";
        ///
        /// // TagHelperAttribute.Name must match the specified name.
        /// attributes["name"] = new TagHelperAttribute("name", "value");
        /// </code>
        /// </example>
        public TagHelperAttribute this[string name]
        {
            get
            {
                return null;
            }
            set
            {

            }
        }
    }

Attached is the generated metadata from docfx. yaml.zip

Moved from rtfd/sphinx-autoapi#59

agjohnson commented 8 years ago

Resolved with #57