Repository navigation
Description
There are several large issues in the content that covers C# Compiler messages.
- Many errors and warnings are not documented. (More than 700 have already been identified here).
- There are 623 individual articles that do cover existing errors and warnings. That many different warnings and errors make this content hard to navigate.
- The purpose of these articles is to help developers modify their code so it compiles without errors or warnings. That makes this content rather important: developers are effectively blocked when they reach these pages.
Can we reorganize this material around types of errors and warnings into a (somewhat) smaller set of articles that help developers diagnose and fix related issues in their code?
A good starting point is to look at the organization in the C# Error codes in the dotnet/roslyn repository. For newer versions (starting with C# 5), the first digit of the code indicates the version when the error or warning was introduced. Further, those messages are often organized by feature:
-
C# 5 warnings are in the range 4000-4999
-
C# 6 is in the range 5000-5999, 7000-7999 and 8000-8106
-
C# 7 is in the range 8107-8210 and are organized by feature.
-
C# 7.1 is in the range 8300-8315
-
C# 7.2 is in the range 8320-8364 and are organized by feature.
-
C# 7.3 is in 8370-8389
-
C# 8 is in 8400-8750, and organized by feature
-
C# 9 is in the range 8751-8911
-
C# 10 (in progress) starts at 8912
-
C# 5 warnings and errors are almost all about
asyncandawait. -
C# 6 is a mixture of errors and warnings for the features introduced in that version. These could be organized by feature.
-
Errors and warnings for features added after 6 are generally organized by feature. This provides a potential roadmap for a new organization for pages organized around each feature.
One major concern to this plan is how to organize articles for errors and warnings introduced before C# 5. When I scanned the list, two groups stand out: LINQ and dynamic. I can spot some related to generics or partial methods, they aren't groups that way.
Before beginning these changes we need to create a full plan for which errors and warnings would be included in each new article.
Proposed article format
If the concern can be addressed, I propose organizing each article on the following outline:
- Feature or Subsystem area
- Table of errors, including code and message
- A few examples of the correct syntax and uses for the features
- Links to relevant language reference articles
- Links to relevant C# spec sections
SEO Concerns
The existing articles have been optimized for each error code and message. The title, H1, and description all include the error and message. Those techniques raise these articles visibility in search for the error code. That may be hard to replicate in a more simplified presentation. Possible actions:
- F1 keywords will help developers using Visual Studio.
- The table of errors and messages should help as well.
- Redirection from existing content should help inherit some of the search rank.
More work here should be done before we begin. If we follow this plan, the new pages should rank in the first page for any relevant compiler error or warning code.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: fc586192-534e-0108-d265-c4f2f6947c57
- Version Independent ID: 4d39f536-5d78-335b-3525-d4b581c28fdc
- Content: C# Compiler messages
- Content Source: docs/csharp/language-reference/compiler-messages/index.md
- Product: dotnet-csharp
- Technology: csharp-diagnostics
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Activity
Youssef1313 commentedon May 1, 2021
I don't think this is correct. C# 9 error messages are all starting with 8, and C# 6 have errors starting with both 7 and 8.
Youssef1313 commentedon May 1, 2021
Some concerns/questions:
In general, I like the idea of grouping the messages by version & feature. I think I can write a tool that generates the markdown files with initial dummy content (metadata, headings including ID + message text, etc.), this can get us to start grouping those "dummy" pages and see how things can go before writing the actual content.
Instead of grouping multiple compiler messages per article, we could also group them by folders - which would preserve the existing structure (i.e, every compiler message has a separate page)
Youssef1313 commentedon May 2, 2021
Initial thoughts:
BillWagner commentedon May 3, 2021
@Youssef1313
Thank you. Edited in the description above.
BillWagner commentedon May 3, 2021
@Youssef1313
I'm investigating if we can archive these articles. I'll add a comment once I've done that.
I'm looking for this data now.
This would be a huge help. I'd like to get farther on a possible organization first.
This is the most important decision point. And, it may not be all one or the other. Maybe there are some natural groupings we discover, and some errors are on their own page. For the time being, let's keep considering organization around errors and warnings.
BillWagner commentedon May 3, 2021
I like the direction. As we fill in errors, I think we'll have more context for refinement.
BenjaminMichaelis commentedon May 4, 2021
More discussion at #23032
dtdimi commentedon Sep 27, 2023
@BillWagner
Hi Bill,
was just reading through the issue and noticed that a year ago inputs stopped with the state "open" ...
Out of curiosity - what's the status now ---
???
Any guidance/tips from your side are highly appreciated!