doxypress icon indicating copy to clipboard operation
doxypress copied to clipboard

C# verbatim string misinterpreted as documentation command

Open TransientResponse opened this issue 8 years ago • 1 comments

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 avatar Dec 21 '16 15:12 TransientResponse

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.

TransientResponse avatar Dec 21 '16 19:12 TransientResponse