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
21 changes: 12 additions & 9 deletions .github/prompts/error-consolidation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ Overall steps:

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

We're going to work through a series of files consolidating errors and warnings related to declaring the `dynamic` type and dynamic binding.
We're going to work through a series of files consolidating errors and warnings.

The destination for all these edits is the dynamic-type-and-binding-errors.md file. It already contains a skeleton for the final output.
- For the duration of this chat, all references to "destination file" refer to `using-statement-declaration-errors.md.
- For the duration of this chat, all references to "the target theme" refer to errors and warnings related to `using` statements and `using` variable declarations. Note that the `using` keyword can also be used for a `using` directive. Don't include those error messages.

The destination file already contains a skeleton for the final output.

For each source file I specify in this chat, you'll do the following tasks:

Expand All @@ -28,30 +31,30 @@ For each source file I specify in this chat, you'll do the following tasks:

## 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 the `dynamic` type or dynamic binding. Give me a list to review for possible additional consolidation. Don't make any edits until the originating user approves.
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 the target theme. Give me a list to review for possible additional consolidation. Don't make any edits until the originating user approves.

## Final search in roslyn source

Let's check undocumented errors and the roslyn source for any missing errors. For every error code listed in "sorry-we-don-t-have-specifics-on-this-csharp-error.md" under the `f1_keywords` front matter, do the following:
1. Find that number as a constant in `ErrorCodes.cs`.
2. Locate the corresponding `data` element in CSharpResources.resx. The `name` atttribute should match the number of the constant.
3. Read the error message found in the `<value>` element that is a child of that `<data>` element.
Give me a list of all error numbers and corresponding error messages that relate to operator overloading.
Give me a list of all error numbers and corresponding error messages that relate to the target theme.

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 related errors, but don't make any edits yet.
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 the target theme. 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 related errors, but don't make any edits yet.

I'll give you error codes one by one. For each, I want you to do the following:

- Add the new error code to the front matter of operator-overloading-errors.md, for both the `f1_keywords` and `helpview_keywords` table.
- Add the new error code and error message to the table at the top of operator-overloading-errors.md.
- Add the new error code to the list of `displayName` elements in the TOC file for operator-overloading-errors.md.
- Add the new error code to the front matter of the destination file, for both the `f1_keywords` and `helpview_keywords` table.
- Add the new error code and error message to the table at the top of the destination file.
- Add the new error code to the list of `displayName` elements in the TOC file entry for the destination file.
- Remove the new error code from the front matter in the file `csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-errors.md` file.

Note that no redirections need to be added for these error codes.

## Build consolidated sections

For all remaining work, all edits will be in the `dynamic-type-and-binding-errors.md` file. The final format should mirror the structure of the `preprocessor-errors.md` file. Every H2 is a theme, all anchors are for the theme, not an individual error code.
For all remaining work, all edits will be in the target file. The final format should mirror the structure of the other target theme files in the docs/csharp/language-reference/compiler-messages folder. Every H2 is a theme, all anchors are for the theme, not an individual error code.

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 new section should include links to language reference articles that discuss the feature or theme.

Expand Down
36 changes: 36 additions & 0 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,30 @@
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8401.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8410.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8417.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8418.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8647.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8648.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8649.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8795.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types"
Expand Down Expand Up @@ -1689,6 +1713,10 @@
"source_path_from_root": "/docs/csharp/misc/cs0244.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0245.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0254.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors"
Expand Down Expand Up @@ -1865,6 +1893,10 @@
"source_path_from_root": "/docs/csharp/misc/cs0715.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0728.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1037.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
Expand Down Expand Up @@ -2285,6 +2317,10 @@
"source_path_from_root": "/docs/csharp/misc/cs1673.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1674.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
},
{
"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"
Expand Down
77 changes: 0 additions & 77 deletions docs/csharp/language-reference/compiler-messages/cs1674.md

This file was deleted.

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

This file was deleted.

Loading