dotnet / dotnet/csharpstandard

Exclude quadruple slash `////` and `/***` from documentation comments

Open
#1,079 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

**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. `//// ` 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**

```csharp
////
class C {
/*** */
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:

* `////` at
* `/***` (and `/**/`) at

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.