Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude quadruple slash //// and /*** from documentation comments #1079

Open
KalleOlaviNiemitalo opened this issue Apr 14, 2024 · 0 comments

Comments

@KalleOlaviNiemitalo
Copy link
Contributor

Describe the bug

It isn't clear from §D.2 (Documentation comments / Introduction) whether a comment that starts with four slashes //// is a documentation comment. The text talks about comments "that start with three slashes" and, well, if there are four slashes, then three of those are at the start. The expository Single_Line_Doc_Comment grammar rule matches this syntax too, as a slash / can be an Input_Character.

Likewise /*** and Delimited_Doc_Comment.

However, Roslyn does not parse e.g. //// <hello> as a documentation comment, and "Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.9149 for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727" doesn't either. The quadruple-slash syntax has been used for commenting out code, but I forget where I saw that recommendation.

Example

//// <not a doc comment>
class C {
    /***  <not a doc comment> */
    int i;
}

Expected behavior

Declare that a Single_Line_Comment that starts with four or more slashes is not a documentation comment. In text and also in the Single_Line_Doc_Comment grammar rule.

Likewise, declare that a Delimited_Comment that starts with a slash and three or more asterisks is not a documentation comment.

Additional context

Roslyn excludes those here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant