dotnet / dotnet/dotnet-api-docs

Identify, correct confusion of enumeration types and properties that return them

Open
#3,093 0 comments 0 reactions 0 assignees View on GitHub
area-System.Runtime help wanted Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

## Identify, correct confusion of enumeration types and properties that return them

One of the patterns that we've noticed in the enumeration documentation is a confusion of the enumeration type and the member that returns that enumeration type. For example:

> If the [DayOfWeek](https://docs.microsoft.com/dotnet/api/system.dayofweek?view=netframework-4.8) property is set to `DayOfWeek.Sunday`, then...

should instead be something like:

> If the [DateTime.DayOfWeek](https://docs.microsoft.com/dotnet/api/system.datetime.dayofweek) or [DateTimeOffset.DayOfWeek](https://docs.microsoft.com/dotnet/api/system.datetimeoffset.dayofweek) property is set to `DayOfWeek.Sunday`...

It would be nice to identify and correct these. They can be found using a literal string search and a regular expression:

1. In each .xml file in the dotnet/dotnet-api-docs repo, look for the string `System.Enum`, which identifies an enumeration type.

1. In each file for an enumeration type, use a regular expression to identify this pattern. The enumeration type's DocId would be one capturing group (``), while a second would be the fully qualified type name.
2. That first capturing group would be matched later in the file by a regex pattern like `\k.+?\\.\w+\>`.

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.