dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.9k stars 4.01k forks source link

Automatic exception xml tag when using static class such as ArgumentNullException #74776

Open vsfeedback opened 4 weeks ago

vsfeedback commented 4 weeks ago

This issue has been moved from a ticket on Developer Community.


public void test(string test)
        {
            if (string.IsNullOrEmpty(test)) { throw new ArgumentNullException(nameof(test)); }
        }

This generates a summary block comment including the exception node with ArgumentNullException such as :

        /// <summary>
        /// 
        /// </summary>
        /// <param name="test"></param>
        /// <exception cref="ArgumentNullException"></exception>

The use of static class doesn't generate the exception node in the xml summary comment.

        public void test(string test)
        {
            ArgumentException.ThrowIfNullOrEmpty(test);
        }

Here is the result:

        /// <summary>
        /// 
        /// </summary>
        /// <param name="test"></param>

If possible, make it so that the use of static class helper for exception creates the exception node in xml documentation automatically.


Original Comments

Feedback Bot on 7/18/2024, 10:40 PM:

(private comment, text removed)

dotnet-issue-labeler[bot] commented 4 weeks ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 4 weeks ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.