copperspice / doxypress

Documentation generator using annotated sources for multiple computer languages
https://www.copperspice.com/
GNU General Public License v2.0
150 stars 14 forks source link

C# verbatim string misinterpreted as documentation command #11

Open TransientResponse opened 7 years ago

TransientResponse commented 7 years ago

It appears that having a C# verbatim string (string literal prefixed with @) in a method before the documentation of a property leads to the text in the string being included in the name of the property in the docs.

Example code:

public class Test
{
    /// <summary>Test method</summary>
    /// <returns>a string</returns>
    public static string Bar()
    {
        return new string(@"Ratione dolores qui voluptatem. Sunt facere dignissimos quod est odit. Omnis ipsum quos possimus quis aut. Voluptatem dolorem ut minima magnam aut modi.");
    }

    /// <summary>A property</summary>
    /// <value>a number</value>
    public static int Foo
    {
        get {return 3;}
    }
}

This code documents as: image

First noticed in DoxyPress 1.2.5

TransientResponse commented 7 years ago

Workaround for those interested: use a preprocessor block with a predfine in DoxyPress. Example: #if !DOX_IGNORE followed by #endif around the line with the offending string with DOX_IGNORE added to DoxyPress's predefined macros in Build Settings -> Preprocessor.