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
40 changes: 27 additions & 13 deletions .github/prompts/error-consolidation.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
# Copilot prompts to consolidate error codes.

We're going to edit this file, string-literal.md, to contain information about all errors and warnings related to string and character literal declarations. I'll write prompts for specific tasks. Don't make any edits yet. In future prompts, the destination for new error and warning content is always this file.
Overall steps:

1. Make a new template, by hand.
1. Add any new errors that should be added here.
1. Consolidate existing errors, as identified by person.
1. Run Copilot search for other existing errors that person may have missed.
1. Search for missing errors.

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

Start with CS1009.md as the source file.
For each source file:
We're going to work through a series of files consolidating errors and warnings related to declaring overloaded operators.

The destination for all these edits is the overloaded-operator-errors.md file. It already contains a skeleton for the final output.

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

- Add the contents of the source file to the destination.md file.
- Include the source error code in the YML header for `f1_keywords` and `helpviewer_keywords`.
- Include the source error code in the YML header for f1_keywords and helpviewer_keywords.
- Add an entry with an anchor for the error error code and its corresponding error message.
- Add the contents of the source file as a new H2 in the destination file.
- Add a redirection for the source file in the file `.openpublishing.redirection.csharp.json`. Make the destination point to destination file. Place the new entry in sorted order based on 'source_path_from_root'.
- Add a redirection for the source file in the file .openpublishing.redirection.csharp.json. Make the destination point to destination file. Place the new entry in sorted order based on 'source_path_from_root'.
- Update the TOC file:
- Add the error code to the list of display names in the TOC for the destination file, sorted by numeric error code.
- Remove the TOC entry for the source file.
- Finally, delete the source markdown file.
- Finally, delete the source markdown file.

## 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 string literals or constants. Give me a list to review for possible additional consolidation.
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 operator overloading. 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.

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.

For each new file:
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 the consolidated article, 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 article.
- Add the new error code to the list of `displaName` elements in the TOC file.
- 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.
- 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 `string-literal.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 `overloaded-operator-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.

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.

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 the section for all errors related to raw string literals.
Understand these instructions, then suggest a list of themes and the included error codes. I'll approve each theme before you begin editing.
104 changes: 104 additions & 0 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,14 @@
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0270.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0552.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0563.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0650.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
Expand Down Expand Up @@ -1549,6 +1557,14 @@
"source_path_from_root": "/docs/csharp/misc/cs0035.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0056.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0057.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0105.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors"
Expand Down Expand Up @@ -1589,6 +1605,22 @@
"source_path_from_root": "/docs/csharp/misc/cs0206.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0215.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0216.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0217.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0218.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0225.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays"
Expand Down Expand Up @@ -1649,6 +1681,10 @@
"source_path_from_root": "/docs/csharp/misc/cs0440.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0448.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0457.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
Expand Down Expand Up @@ -1685,6 +1721,74 @@
"source_path_from_root": "/docs/csharp/misc/cs0526.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0553.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0554.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0555.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0556.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0557.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0558.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0559.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0562.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0564.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0567.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0590.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0660.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0661.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"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/cs1037.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1553.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1554.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"
},
{
"source_path_from_root": "/docs/csharp/misc/cs0568.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructors-in-struct-types"
Expand Down
37 changes: 0 additions & 37 deletions docs/csharp/language-reference/compiler-messages/cs0552.md

This file was deleted.

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

This file was deleted.

Loading