-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix code snippet fragmentation in Dictionary documentation #12148
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
|
@copilot The code examples are broken into separate blocks in the following Dictionary<TKey,TValue> members: System.Collections.IDictionary.Contains Instead of using a comma-separate list of snippet tags from different parts of a larger code file, please create a new, dedicated code file (and project file) for each member. Place the new code file and project file in a directory that's named for the applicable member. Example file structure: |
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Fixed code snippet fragmentation in six Dictionary methods/properties: GetEnumerator, Contains, Item, Keys, Remove, and Values. All now use comma-separated snippet IDs to render as continuous code blocks instead of separate fragments. (commit 7830bbe) |
|
@copilot Comma-separate snippet IDS do not work. You need to duplicate the code and extract the relevant snippets into new, separate code files for each member. |
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Reverted the comma-separated snippet approach and created separate code files for each member as requested. Created 36 new files (C#, VB, F#) across 6 separate directories for GetEnumerator, Contains, Item, Keys, Remove, and Values members. Each member now has a complete, standalone code example. (commit ebbad48) |
gewarren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use interpolated strings in all the C# files.
...ections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Contains/Project.csproj
Outdated
Show resolved
Hide resolved
...ections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.GetEnumerator/source.cs
Outdated
Show resolved
Hide resolved
...stem.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/source.cs
Outdated
Show resolved
Hide resolved
...stem.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/source.cs
Outdated
Show resolved
Hide resolved
...stem.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Keys/source.cs
Show resolved
Hide resolved
|
@copilot Please respond to feedback. |
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
All feedback has been addressed in commit 7d2a428:
Updated all 6 C# source files to use interpolated strings throughout. (commit 7d2a428) |
gewarren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please add project files for the VB code files.
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes fragmented code snippet rendering in Dictionary documentation by creating dedicated code files for each IDictionary member. Previously, code examples were split into multiple separate blocks, breaking copy/paste functionality. The changes modernize the code examples to use interpolated strings and target .NET 10.0 for C# and VB, and .NET 8.0 for F# snippets.
Key changes:
- Created dedicated source files for 6 IDictionary members across C#, F#, and VB languages
- Updated C# code to use interpolated strings instead of string.Format
- Added project files targeting appropriate .NET versions for all snippets
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Dictionary`2.xml | Consolidated fragmented snippet references into single code file references for 6 IDictionary members |
| C# source files (6 files) | Created standalone examples with interpolated strings for Contains, GetEnumerator, Item, Keys, Remove, and Values |
| C# project files (6 files) | Added project files targeting net10.0 for compilation |
| VB source files (6 files) | Created standalone examples for all 6 IDictionary members |
| VB project files (6 files) | Added project files targeting net10.0 for compilation |
| F# source files (6 files) | Created standalone examples for all 6 IDictionary members |
| F# project files (6 files) | Added project files targeting net8.0 for compilation |


Fix Code Snippet Fragmentation in Dictionary Documentation
Addressed all review feedback:
Changes Made
Files Updated
C# Source Files (interpolated strings):
C# Project Files (net10.0):
VB Project Files (net10.0):
XML Documentation:
All code examples now use modern C# interpolated strings and target the latest .NET version. Both C# and VB snippets now have project files for compilation.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.