Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/prompts/error-consolidation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copilot prompts to consolidate error codes.

## Add a single existing file into the new consolidated article.

Add the contents of cs1027.md to the preprocessor-errors.md file, sort that file by 'source_path_from_root'. Add a redirection for cs1027.md to point to preprocessor-errors.md, add "cs1027: to the list of display names in the TOC for preprocessor-errors.md. Finally, delete cs1027.md

## Search for other related articles that may be missed.

Search all files in the docs/csharp/language-reference/compiler-messages and the docs/csharp/misc folder for any other errors and warnings that involve preprocessor tokens. Give me a list to review for possible additional consolidation.

## Final search in roslyn source

To make sure you've found all related errors, we'll check the source. Look in `CSharpResources.resx` for any elements where the `<value>` element is a message related to preprocessor tokens. The symbolic constant for that value is in the `name` attribute on the parent `data` element. Find that value in `ErrorCodes.cs`. It will map to the compiler error code, where the code is "CS" followed by the number as a four digit number. Build a list of any not already added to preprocessor-errors.md

## Build consolidated sections

Examine the highlighted section. Other H2s with similar themes should be combined in a similar format. The recommendations to fix the errors should point to language reference articles that explain the impacted syntax.

To do that, make a new H2 section for the theme. Remove all the H2s for the individual error codes that are part of that theme. Where applicable, the new H2 can include text or examples from the H2s you remove.

The list of errors at the top of the file should remain in numerical order, so it's easy for readers to scan. Each impacted error code should now have a link to the anchor tag for the new section. Repeat the list in the new section, but without the anchors, as shown in the highlighted text.

Start with CS1024 and other errors that indicate "Not a valid preprocessor directive"
88 changes: 88 additions & 0 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1683.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1691.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0270.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
Expand Down Expand Up @@ -1834,6 +1838,70 @@
"source_path_from_root": "/docs/csharp/misc/cs1020.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1024.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1025.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1027.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1028.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1029.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1030.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1032.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1038.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1040.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1517.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1560.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1576.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1578.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1633.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1634.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1635.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1100.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
Expand Down Expand Up @@ -1994,10 +2062,30 @@
"source_path_from_root": "/docs/csharp/misc/cs1686.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1692.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1694.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1695.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1696.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1706.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1709.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1714.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references"
Expand Down
34 changes: 0 additions & 34 deletions docs/csharp/language-reference/compiler-messages/cs1029.md

This file was deleted.

38 changes: 0 additions & 38 deletions docs/csharp/language-reference/compiler-messages/cs1691.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ helpviewer_keywords:
- "CS8634"
- "CS8636"
- "CS8637"
- "CS8668"
- "CS8639"
- "CS8643"
- "CS8644"
Expand Down Expand Up @@ -214,6 +215,7 @@ The following warnings indicate that you haven't set the nullable context correc
- **CS8632** - *The annotation for nullable reference types should only be used in code within a `#nullable` annotations context.*
- **CS8636** - *Invalid option for `/nullable`; must be `disable`, `enable`, `warnings` or `annotations`*
- **CS8637** - *Expected `enable`, `disable`, or `restore`*
- **CS8668** - *Expected `warnings`, `annotations`, or end of directive*

To set the nullable context correctly, you have two options:

Expand Down
Loading