-
Notifications
You must be signed in to change notification settings - Fork 6k
Create new consolidated error page for compiler diagnostics related to operator overloading #49281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
544e5e5
Create skeleton
BillWagner dae773c
Consolidate identified error messages.
BillWagner 5c7dfe1
Add related missing error codes
BillWagner dcd023d
First pass at consolidation.
BillWagner 5060dd0
edit pass on samples
BillWagner d4e61c3
do a final proofread.
BillWagner 8f60ff2
proofread samples.
BillWagner 29f020e
fix build warnings
BillWagner c1ee4ed
Apply suggestions from code review
BillWagner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 I approve. | ||
|
||
## 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: | ||
BillWagner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
docs/csharp/language-reference/compiler-messages/cs0552.md
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
docs/csharp/language-reference/compiler-messages/cs0563.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.