Skip to content

Commit 14d3460

Browse files
BillWagnerCopilot
andauthored
Add consolidated errors for using and await using (#49493)
* Create stub for CS9229 Create the stub article, and add the information for CS9229. * update all instructions for this task Make more prompt edits to make future changes easier. * Add using statement errors That's the original theme. * Finish any remaining consolidation * copilot's first pass. Not really thrilled. * A final proofread * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 4bfb1d3 commit 14d3460

File tree

9 files changed

+178
-253
lines changed

9 files changed

+178
-253
lines changed

.github/prompts/error-consolidation.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ Overall steps:
1010

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

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

15-
The destination for all these edits is the dynamic-type-and-binding-errors.md file. It already contains a skeleton for the final output.
15+
- For the duration of this chat, all references to "destination file" refer to `using-statement-declaration-errors.md.
16+
- 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.
17+
18+
The destination file already contains a skeleton for the final output.
1619

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

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

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

31-
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.
34+
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.
3235

3336
## Final search in roslyn source
3437

3538
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:
3639
1. Find that number as a constant in `ErrorCodes.cs`.
3740
2. Locate the corresponding `data` element in CSharpResources.resx. The `name` atttribute should match the number of the constant.
3841
3. Read the error message found in the `<value>` element that is a child of that `<data>` element.
39-
Give me a list of all error numbers and corresponding error messages that relate to operator overloading.
42+
Give me a list of all error numbers and corresponding error messages that relate to the target theme.
4043

41-
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.
44+
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.
4245

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

45-
- Add the new error code to the front matter of operator-overloading-errors.md, for both the `f1_keywords` and `helpview_keywords` table.
46-
- Add the new error code and error message to the table at the top of operator-overloading-errors.md.
47-
- Add the new error code to the list of `displayName` elements in the TOC file for operator-overloading-errors.md.
48+
- Add the new error code to the front matter of the destination file, for both the `f1_keywords` and `helpview_keywords` table.
49+
- Add the new error code and error message to the table at the top of the destination file.
50+
- Add the new error code to the list of `displayName` elements in the TOC file entry for the destination file.
4851
- 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.
4952

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

5255
## Build consolidated sections
5356

54-
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.
57+
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.
5558

5659
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.
5760

.openpublishing.redirection.csharp.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,30 @@
563563
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8401.md",
564564
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors"
565565
},
566+
{
567+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8410.md",
568+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
569+
},
570+
{
571+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8417.md",
572+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
573+
},
574+
{
575+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8418.md",
576+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
577+
},
578+
{
579+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8647.md",
580+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
581+
},
582+
{
583+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8648.md",
584+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
585+
},
586+
{
587+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8649.md",
588+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
589+
},
566590
{
567591
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8795.md",
568592
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types"
@@ -1689,6 +1713,10 @@
16891713
"source_path_from_root": "/docs/csharp/misc/cs0244.md",
16901714
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors"
16911715
},
1716+
{
1717+
"source_path_from_root": "/docs/csharp/misc/cs0245.md",
1718+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
1719+
},
16921720
{
16931721
"source_path_from_root": "/docs/csharp/misc/cs0254.md",
16941722
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors"
@@ -1865,6 +1893,10 @@
18651893
"source_path_from_root": "/docs/csharp/misc/cs0715.md",
18661894
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
18671895
},
1896+
{
1897+
"source_path_from_root": "/docs/csharp/misc/cs0728.md",
1898+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow"
1899+
},
18681900
{
18691901
"source_path_from_root": "/docs/csharp/misc/cs1037.md",
18701902
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
@@ -2285,6 +2317,10 @@
22852317
"source_path_from_root": "/docs/csharp/misc/cs1673.md",
22862318
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions"
22872319
},
2320+
{
2321+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1674.md",
2322+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable"
2323+
},
22882324
{
22892325
"source_path_from_root": "/docs/csharp/misc/cs1686.md",
22902326
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions"

docs/csharp/language-reference/compiler-messages/cs1674.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

docs/csharp/language-reference/compiler-messages/cs8410.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)