In Visual studio, three backlashes don't result in a comment occurring between my two summary backlashes

cal 1 Reputation point
2021-01-29T20:26:06.713+00:00

62051-no-autogenrated-comment.jpg

I am new to visual studio and between the summary backlashes an auto-generated comment should have been "computes a modified age integer". I would like to know how to fix it so that I can always learn something about a method that I have written.

Thanks for the help in advance.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,688 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Michael Taylor 49,246 Reputation points
    2021-01-29T22:30:36.23+00:00

    When you are above a type or member and enter three slashes the editor will auto generate a summary tag and, if a method and it has parameters, then a param tag for each parameter. It'll also generate a returns tag if there is a return value. However that is it.

    // 3 slashes here auto generates 
    //    /// <summary>
    //    /// </summary
    void Foo ()
    {}
    
    // 3 slashes here auto generates 
    //    /// <summary>
    //    /// <param name="id"></param>
    //    /// </summary
    void Foo ( int id )
    {
    }
    

    Everything else, including the actual text inside the doctag elements, you have to provide yourself. The editor has no way of knowing how to describe your member and therefore cannot fill any of this out for you.

    0 comments No comments

  2. cal 1 Reputation point
    2021-01-30T10:56:15.843+00:00

    Thanks for answering. Ah okay, so for it to auto-generate an answer, I would have needed to have a value in the () parentheses field? Or should I have an auto-generated item in the method void ComputeAge()

    thanks in advance


  3. Eric Woodruff 121 Reputation points
    2021-01-30T18:58:30.417+00:00

    If you want the actual comment text auto-generated, you'll need an extension like GhostDoc. Even then it's based on the method name and signature so it's only going to be as good as what you define. It won't tell you anything instructive necessarily.

    0 comments No comments