first#502
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds LinkDotNet.Enumeration as the 269th RSCG example, integrating it into the generator catalog through core data records, a complete working example with demo project, user documentation pages, and updated listing surfaces across README, navigation pages, and category indexes. A secondary enhancement expands GenerateDispose documentation with detailed usage guidance. ChangesLinkDotNet.Enumeration Example Addition
GenerateDispose Documentation Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new RSCG example for LinkDotNet.Enumeration (incl. demo project + docs/site/book integration) and upgrades GenerateDispose metadata to the newer “## Summary …” format, while bumping repository/site counts from 268 → 269.
Changes:
- Added a new example package folder and demo project for LinkDotNet.Enumeration (source, tour, video script, metadata).
- Generated and integrated new documentation pages/exports (site docs, category/author indexes, search index, book HTML list/pages).
- Updated GenerateDispose’s description/video metadata to the expanded summary format and updated global counts/latest dates.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| v2/RSCGExamplesData/GeneratorDataRec.json | Registers the new generator entry (LinkDotNet.Enumeration) in the data feed. |
| v2/rscg_examples/LinkDotNet.Enumeration/video.json | Adds the video script steps for the new example. |
| v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/Program.cs | New demo console app showing parsing + exhaustive Match(...). |
| v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/EnumDemo.csproj | New demo project referencing the generator package. |
| v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/CarTypes.cs | Defines the [Enumeration(...)] sample type used by the demo. |
| v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo.sln | Solution file for the demo project. |
| v2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tour | VS Code CodeTour steps for the new example. |
| v2/rscg_examples/LinkDotNet.Enumeration/readme.txt | Captures upstream/readme content for the generator. |
| v2/rscg_examples/LinkDotNet.Enumeration/nuget.txt | Short NuGet description snippet for the generator. |
| v2/rscg_examples/LinkDotNet.Enumeration/description.json | Generator metadata and “goodFor” summary used for docs generation. |
| v2/rscg_examples/GenerateDispose/video.json | Updates the video script summary text for GenerateDispose. |
| v2/rscg_examples/GenerateDispose/description.json | Expands GenerateDispose “goodFor” content to the multi-section summary format. |
| v2/rscg_examples_site/static/exports/RSCG.json | Adds LinkDotNet.Enumeration to the exported JSON dataset. |
| v2/rscg_examples_site/src/components/HomepageFeatures/index.js | Updates homepage example count from 268 to 269. |
| v2/rscg_examples_site/docs/RSCG-Examples/LinkDotNet.Enumeration.md | Adds the full docs page for the new generator example. |
| v2/rscg_examples_site/docs/RSCG-Examples/index.md | Updates list counts and adds LinkDotNet.Enumeration to Enum category listings/diagram. |
| v2/rscg_examples_site/docs/RSCG-Examples/GenerateDispose.md | Updates page frontmatter + “About” section to the summary format. |
| v2/rscg_examples_site/docs/indexRSCG.md | Updates global list count and adds the new entry to the chronological index. |
| v2/rscg_examples_site/docs/Categories/Enum.md | Updates Enum category count and inserts LinkDotNet.Enumeration. |
| v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx | Updates “SameCategory” content to include the new Enum example. |
| v2/rscg_examples_site/docs/Authors/Steven_Giesel.md | Updates author page count and adds LinkDotNet.Enumeration to the author list. |
| v2/rscg_examples_site/docs/about.md | Updates the overall RSCG count to 269. |
| v2/docFind.json | Adds LinkDotNet.Enumeration to the search/find index. |
| v2/book/pandocHTML.yaml | Adds LinkDotNet.Enumeration book HTML input entry. |
| v2/book/list.html | Updates book list count and adds LinkDotNet.Enumeration to the table. |
| v2/book/examples/LinkDotNet.Enumeration.html | Adds the book HTML page for the new example. |
| README.md | Updates repo-wide counts/latest update and adds LinkDotNet.Enumeration entry. |
| later.md | Updates the “Latest Update” date to 2026-05-14. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public sealed partial record Color; | ||
| ``` | ||
|
|
||
| This will generate a `JsonConverter` that can be used with `System.Text.Json` to serialize and deserialize `Color` instances as their string keys. The generated converter is called `\{TypeName}\}JsonConverter`. |
| public Casing MemberCasing \{ get; } | ||
| /// <summary> | ||
| /// When <see langword="true"/>, a <see cref="System.Text.Json.Serialization.JsonConverterAttribute"/> | ||
| /// is applied to the enumeration type and a <c>\{TypeName}\}JsonConverter</c> class is generated |
| using EnumDemo; | ||
| using System.Reflection; |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (3)
v2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tour (2)
19-23: 💤 Low valueReplace placeholder pattern with actual code pattern.
The pattern
"this is the code"appears to be a placeholder. Consider using an actual code pattern fromProgram.cs(e.g.,"CarTypes.TryParse") or removing the pattern field to highlight the entire file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@v2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tour` around lines 19 - 23, The tour file contains a placeholder pattern "this is the code" for the entry referencing EnumDemo/Program.cs; replace that placeholder with a real code pattern from Program.cs (for example "CarTypes.TryParse" or another specific snippet present in the file) or remove the "pattern" field entirely so the tour highlights the full file; update the JSON entry that currently references "EnumDemo/Program.cs" to use the real symbol or omit the pattern.
14-17: 💤 Low valueReplace placeholder pattern with actual code pattern.
The pattern
"this is the code"appears to be a placeholder. Consider using an actual code pattern fromCarTypes.cs(e.g.,"Enumeration") or removing the pattern field to highlight the entire file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@v2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tour` around lines 14 - 17, The tour entry references EnumDemo/CarTypes.cs but uses a placeholder pattern "this is the code"; update the "pattern" value to a real code snippet or identifier found in CarTypes.cs (for example a class or enum name like "CarTypes" or "Enumeration") or remove the "pattern" field entirely so the tour highlights the whole file, ensuring the tour matches actual content in CarTypes.cs.v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/Program.cs (1)
3-3: ⚡ Quick winRemove unused import.
The
System.Reflectionnamespace is imported but never used in this file.🧹 Proposed fix
-using System.Reflection;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/Program.cs` at line 3, Remove the unused using directive "using System.Reflection;" from Program.cs (it's not referenced by the Program class or any methods), leaving only the required using statements; verify the file still compiles and run a quick build to ensure no dependent reflection APIs were accidentally removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@v2/book/list.html`:
- Line 20: Replace the literal ">" character in the HTML content string "This is
the list of 269 RSCG with examples =>" with its HTML-escaped entity ">";
update the text in v2/book/list.html so the line reads "This is the list of 269
RSCG with examples =>" to prevent rendering/parsing issues.
In `@v2/rscg_examples_site/docs/RSCG-Examples/GenerateDispose.md`:
- Around line 166-295: The GenerateDispose documentation is fragmented by
excessive blank lines and indented code causing broken markdown; update the
source by first refactoring the goodFor array in description.json into a concise
summary, then rewrite RSCG-Examples/GenerateDispose.md to use continuous
paragraphs, properly fenced code blocks (```), and remove superfluous blank
lines so the example partial class DALDB, attribute
[GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))], the Dispose
pattern description (public Dispose(), private int _isDisposed, sealed vs
non-sealed behavior) and usage examples appear as coherent sections with correct
Markdown headings and no indented code blocks.
- Line 4: The frontmatter "description" currently contains Markdown heading
syntax ("## Summary: GenerateDispose") which makes it invalid; replace that
value with plain text (e.g., "Summary: GenerateDispose" or "GenerateDispose
summary") so the description is a simple string and not null, ensuring the
frontmatter description field is a plain-text string without Markdown
characters.
In `@v2/rscg_examples_site/docs/RSCG-Examples/LinkDotNet.Enumeration.md`:
- Line 4: Replace the front matter description value that currently contains
markdown ("## Summary: LinkDotNet.Enumeration") with a plain string; update the
description field in the document's YAML front matter (the "description" key) to
a simple text value such as "Summary: LinkDotNet.Enumeration" or just
"LinkDotNet.Enumeration" so it no longer contains markdown heading syntax.
In `@v2/rscg_examples/GenerateDispose/description.json`:
- Around line 12-55: The goodFor metadata array currently contains full tutorial
Markdown and code blocks; replace the entire goodFor array content with a
concise 1–3 sentence summary for the GenerateDispose generator (e.g., "Generates
a thread-safe Dispose implementation from a named cleanup method, adapting for
sealed/non-sealed classes"), and move the long-form examples and multi-section
tutorial into the generator's MDX documentation (About section) so formatting
and code blocks render correctly; ensure any consumers (e.g., the video template
that joins GoodFor) now receive the short summary only.
In `@v2/rscg_examples/LinkDotNet.Enumeration/video.json`:
- Around line 35-36: In video.json there is a JSON syntax error: the property
SpeakTest is written as SpeakTest=" " instead of a proper JSON key/value pair;
update the object that contains "typeStep" and "arg" so the SpeakTest property
is quoted and uses a colon (i.e. "SpeakTest": " "), ensuring commas and
surrounding braces remain valid for the array/object in
v2/rscg_examples/LinkDotNet.Enumeration/video.json.
---
Nitpick comments:
In
`@v2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tour`:
- Around line 19-23: The tour file contains a placeholder pattern "this is the
code" for the entry referencing EnumDemo/Program.cs; replace that placeholder
with a real code pattern from Program.cs (for example "CarTypes.TryParse" or
another specific snippet present in the file) or remove the "pattern" field
entirely so the tour highlights the full file; update the JSON entry that
currently references "EnumDemo/Program.cs" to use the real symbol or omit the
pattern.
- Around line 14-17: The tour entry references EnumDemo/CarTypes.cs but uses a
placeholder pattern "this is the code"; update the "pattern" value to a real
code snippet or identifier found in CarTypes.cs (for example a class or enum
name like "CarTypes" or "Enumeration") or remove the "pattern" field entirely so
the tour highlights the whole file, ensuring the tour matches actual content in
CarTypes.cs.
In `@v2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/Program.cs`:
- Line 3: Remove the unused using directive "using System.Reflection;" from
Program.cs (it's not referenced by the Program class or any methods), leaving
only the required using statements; verify the file still compiles and run a
quick build to ensure no dependent reflection APIs were accidentally removed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9984084d-1577-407c-9c92-8ecbfa08cc43
⛔ Files ignored due to path filters (2)
v2/rscg_examples_site/static/exports/RSCG.xlsxis excluded by!**/*.xlsxv2/rscg_examples_site/static/sources/LinkDotNet.Enumeration.zipis excluded by!**/*.zip
📒 Files selected for processing (28)
README.mdlater.mdv2/RSCGExamplesData/GeneratorDataRec.jsonv2/book/examples/LinkDotNet.Enumeration.htmlv2/book/list.htmlv2/book/pandocHTML.yamlv2/docFind.jsonv2/rscg_examples/GenerateDispose/description.jsonv2/rscg_examples/GenerateDispose/video.jsonv2/rscg_examples/LinkDotNet.Enumeration/description.jsonv2/rscg_examples/LinkDotNet.Enumeration/nuget.txtv2/rscg_examples/LinkDotNet.Enumeration/readme.txtv2/rscg_examples/LinkDotNet.Enumeration/src/.tours/LinkDotNet.Enumeration.tourv2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo.slnv2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/CarTypes.csv2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/EnumDemo.csprojv2/rscg_examples/LinkDotNet.Enumeration/src/EnumDemo/Program.csv2/rscg_examples/LinkDotNet.Enumeration/video.jsonv2/rscg_examples_site/docs/Authors/Steven_Giesel.mdv2/rscg_examples_site/docs/Categories/Enum.mdv2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdxv2/rscg_examples_site/docs/RSCG-Examples/GenerateDispose.mdv2/rscg_examples_site/docs/RSCG-Examples/LinkDotNet.Enumeration.mdv2/rscg_examples_site/docs/RSCG-Examples/index.mdv2/rscg_examples_site/docs/about.mdv2/rscg_examples_site/docs/indexRSCG.mdv2/rscg_examples_site/src/components/HomepageFeatures/index.jsv2/rscg_examples_site/static/exports/RSCG.json
| <body> | ||
| <h1> | ||
| This is the list of 268 RSCG with examples => | ||
| This is the list of 269 RSCG with examples => |
There was a problem hiding this comment.
Escape the special character in HTML.
The > character should be escaped as > in HTML content.
🔧 Proposed fix
-This is the list of 269 RSCG with examples =>
+This is the list of 269 RSCG with examples >📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| This is the list of 269 RSCG with examples => | |
| This is the list of 269 RSCG with examples => |
🧰 Tools
🪛 HTMLHint (1.9.2)
[error] 20-20: Special characters must be escaped : [ > ].
(spec-char-escape)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@v2/book/list.html` at line 20, Replace the literal ">" character in the HTML
content string "This is the list of 269 RSCG with examples =>" with its
HTML-escaped entity ">"; update the text in v2/book/list.html so the line
reads "This is the list of 269 RSCG with examples =>" to prevent
rendering/parsing issues.
| ## Summary: GenerateDispose | ||
|
|
||
|
|
||
| ### Purpose | ||
|
|
||
|
|
||
| A Roslyn source generator that replaces the 10+ lines of IDisposable boilerplate code with a single attribute. | ||
|
|
||
|
|
||
| It also automatically adapts the generated pattern when the class modifiers change (e.g. sealed to non-sealed). | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### How to Define | ||
|
|
||
|
|
||
| [GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))] | ||
|
|
||
|
|
||
| partial class DALDB : IDisposable // : IDisposable is optional! | ||
|
|
||
|
|
||
| { | ||
|
|
||
|
|
||
| private ConnectionDB cn; | ||
|
|
||
|
|
||
| private ConnectionDB cn1; | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| public DALDB() | ||
|
|
||
|
|
||
| { | ||
|
|
||
|
|
||
| cn = new ConnectionDB(); | ||
|
|
||
|
|
||
| cn1 = new ConnectionDB(); | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| public void Drop() // Your custom disposal logic | ||
|
|
||
|
|
||
| { | ||
|
|
||
|
|
||
| cn.Dispose(); | ||
|
|
||
|
|
||
| cn1.Dispose(); | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| - The class must be partial | ||
|
|
||
|
|
||
| - Pass nameof(YourDisposeMethod) to the attribute - the method must be callable with no arguments | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### What Gets Generated | ||
|
|
||
|
|
||
| - public void Dispose() (thread-safe, calls your method) | ||
|
|
||
|
|
||
| - A private int _isDisposed field for double-dispose protection | ||
|
|
||
|
|
||
| - Adapts to sealed vs non-sealed automatically (private vs protected virtual) | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### How to Use | ||
|
|
||
|
|
||
| using (var db = new DALDB()) | ||
|
|
||
|
|
||
| { | ||
|
|
||
|
|
||
| // use db... | ||
|
|
||
|
|
||
| } // Dispose() called automatically | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### Key Benefits | ||
|
|
||
|
|
||
| - 10+ lines of boilerplate replaced by 1 attribute | ||
|
|
||
|
|
||
| - sealed changes auto-adapt the Dispose pattern | ||
|
|
||
|
|
||
| - No manual IDisposable wiring needed | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift
Documentation section has excessive whitespace and formatting issues.
The expanded content (130 lines) renders each goodFor array element as a separate line, creating:
- Excessive blank lines (e.g., lines 167-169, 177-180, 197-201)
- Broken code block formatting flagged by markdownlint at lines 193 and 274 (indented instead of fenced)
- Poor readability due to fragmented layout
This is a consequence of the goodFor array structure in description.json. Once that file is refactored to a concise summary, this section should be manually rewritten with proper Markdown formatting: continuous paragraphs, properly fenced code blocks, and appropriate whitespace.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 193-193: Code block style
Expected: fenced; Actual: indented
(MD046, code-block-style)
[warning] 274-274: Code block style
Expected: fenced; Actual: indented
(MD046, code-block-style)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@v2/rscg_examples_site/docs/RSCG-Examples/GenerateDispose.md` around lines 166
- 295, The GenerateDispose documentation is fragmented by excessive blank lines
and indented code causing broken markdown; update the source by first
refactoring the goodFor array in description.json into a concise summary, then
rewrite RSCG-Examples/GenerateDispose.md to use continuous paragraphs, properly
fenced code blocks (```), and remove superfluous blank lines so the example
partial class DALDB, attribute
[GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))], the Dispose
pattern description (public Dispose(), private int _isDisposed, sealed vs
non-sealed behavior) and usage examples appear as coherent sections with correct
Markdown headings and no indented code blocks.
| "goodFor":["## Summary: GenerateDispose", | ||
| "### Purpose", | ||
| "A Roslyn source generator that replaces the 10+ lines of IDisposable boilerplate code with a single attribute.", | ||
| "It also automatically adapts the generated pattern when the class modifiers change (e.g. sealed to non-sealed).", | ||
| "", | ||
| "### How to Define", | ||
| "[GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))]", | ||
| "partial class DALDB : IDisposable // : IDisposable is optional!", | ||
| "{", | ||
| " private ConnectionDB cn;", | ||
| " private ConnectionDB cn1;", | ||
| "", | ||
| " public DALDB()", | ||
| " {", | ||
| " cn = new ConnectionDB();", | ||
| " cn1 = new ConnectionDB();", | ||
| " }", | ||
| "", | ||
| " public void Drop() // Your custom disposal logic", | ||
| " {", | ||
| " cn.Dispose();", | ||
| " cn1.Dispose();", | ||
| " }", | ||
| "}", | ||
| "", | ||
| "- The class must be partial", | ||
| "- Pass nameof(YourDisposeMethod) to the attribute - the method must be callable with no arguments", | ||
| "", | ||
| "### What Gets Generated", | ||
| "- public void Dispose() (thread-safe, calls your method)", | ||
| "- A private int _isDisposed field for double-dispose protection", | ||
| "- Adapts to sealed vs non-sealed automatically (private vs protected virtual)", | ||
| "", | ||
| "### How to Use", | ||
| "using (var db = new DALDB())", | ||
| "{", | ||
| " // use db...", | ||
| "} // Dispose() called automatically", | ||
| "", | ||
| "### Key Benefits", | ||
| "- 10+ lines of boilerplate replaced by 1 attribute", | ||
| "- sealed changes auto-adapt the Dispose pattern", | ||
| "- No manual IDisposable wiring needed", | ||
| ""], |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift
The goodFor array contains excessive Markdown formatting unsuitable for metadata.
The goodFor field has been expanded to include 44 lines of detailed Markdown content with code blocks, headings, and multi-line examples. This creates several downstream issues:
-
Video script rendering (see
video.jsonline 11): The build template joins this array with@string.Join("", Model.Data!.GoodFor!), producing an unreadable 1000+ character single-line narration string. -
Documentation rendering (see
GenerateDispose.mdlines 166-295): Each array element becomes a separate line, breaking code block formatting and creating excessive whitespace. -
Metadata field misuse: The
goodForfield should contain a concise summary, not full tutorial content.
Recommendation: Replace this with a brief 1-3 sentence summary. Move the detailed examples, code snippets, and multi-section tutorial content directly into the MDX documentation file where formatting can be controlled properly.
♻️ Proposed refactoring
- "goodFor":["## Summary: GenerateDispose",
-"### Purpose",
-"A Roslyn source generator that replaces the 10+ lines of IDisposable boilerplate code with a single attribute.",
-"It also automatically adapts the generated pattern when the class modifiers change (e.g. sealed to non-sealed).",
-"",
-"### How to Define",
-"[GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))]",
-"partial class DALDB : IDisposable // : IDisposable is optional!",
-"{",
-" private ConnectionDB cn;",
-" private ConnectionDB cn1;",
-"",
-" public DALDB()",
-" {",
-" cn = new ConnectionDB();",
-" cn1 = new ConnectionDB();",
-" }",
-"",
-" public void Drop() // Your custom disposal logic",
-" {",
-" cn.Dispose();",
-" cn1.Dispose();",
-" }",
-"}",
-"",
-"- The class must be partial",
-"- Pass nameof(YourDisposeMethod) to the attribute - the method must be callable with no arguments",
-"",
-"### What Gets Generated",
-"- public void Dispose() (thread-safe, calls your method)",
-"- A private int _isDisposed field for double-dispose protection",
-"- Adapts to sealed vs non-sealed automatically (private vs protected virtual)",
-"",
-"### How to Use",
-"using (var db = new DALDB())",
-"{",
-" // use db...",
-"} // Dispose() called automatically",
-"",
-"### Key Benefits",
-"- 10+ lines of boilerplate replaced by 1 attribute",
-"- sealed changes auto-adapt the Dispose pattern",
-"- No manual IDisposable wiring needed",
-""],
+ "goodFor":["Replaces 10+ lines of IDisposable boilerplate with a single attribute. Automatically adapts the Dispose pattern when class modifiers change (sealed/non-sealed)."],Then add the detailed tutorial content directly in the MDX file's "About" section with proper Markdown formatting.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "goodFor":["## Summary: GenerateDispose", | |
| "### Purpose", | |
| "A Roslyn source generator that replaces the 10+ lines of IDisposable boilerplate code with a single attribute.", | |
| "It also automatically adapts the generated pattern when the class modifiers change (e.g. sealed to non-sealed).", | |
| "", | |
| "### How to Define", | |
| "[GenerateDispose.SourceGenerators.GenerateDispose(nameof(Drop))]", | |
| "partial class DALDB : IDisposable // : IDisposable is optional!", | |
| "{", | |
| " private ConnectionDB cn;", | |
| " private ConnectionDB cn1;", | |
| "", | |
| " public DALDB()", | |
| " {", | |
| " cn = new ConnectionDB();", | |
| " cn1 = new ConnectionDB();", | |
| " }", | |
| "", | |
| " public void Drop() // Your custom disposal logic", | |
| " {", | |
| " cn.Dispose();", | |
| " cn1.Dispose();", | |
| " }", | |
| "}", | |
| "", | |
| "- The class must be partial", | |
| "- Pass nameof(YourDisposeMethod) to the attribute - the method must be callable with no arguments", | |
| "", | |
| "### What Gets Generated", | |
| "- public void Dispose() (thread-safe, calls your method)", | |
| "- A private int _isDisposed field for double-dispose protection", | |
| "- Adapts to sealed vs non-sealed automatically (private vs protected virtual)", | |
| "", | |
| "### How to Use", | |
| "using (var db = new DALDB())", | |
| "{", | |
| " // use db...", | |
| "} // Dispose() called automatically", | |
| "", | |
| "### Key Benefits", | |
| "- 10+ lines of boilerplate replaced by 1 attribute", | |
| "- sealed changes auto-adapt the Dispose pattern", | |
| "- No manual IDisposable wiring needed", | |
| ""], | |
| "goodFor":["Replaces 10+ lines of IDisposable boilerplate with a single attribute. Automatically adapts the Dispose pattern when class modifiers change (sealed/non-sealed)."], |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@v2/rscg_examples/GenerateDispose/description.json` around lines 12 - 55, The
goodFor metadata array currently contains full tutorial Markdown and code
blocks; replace the entire goodFor array content with a concise 1–3 sentence
summary for the GenerateDispose generator (e.g., "Generates a thread-safe
Dispose implementation from a named cleanup method, adapting for
sealed/non-sealed classes"), and move the long-form examples and multi-section
tutorial into the generator's MDX documentation (About section) so formatting
and code blocks render correctly; ensure any consumers (e.g., the video template
that joins GoodFor) now receive the short summary only.
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/LinkDotNet.Enumeration#download-example-net--c-", | ||
| SpeakTest=" "}, |
There was a problem hiding this comment.
Fix JSON syntax error.
Line 36 contains invalid JSON syntax. The property key must be quoted and separated from its value with a colon.
🔧 Proposed fix
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/LinkDotNet.Enumeration#download-example-net--c-",
-SpeakTest=" "},
+"SpeakTest": " "},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/LinkDotNet.Enumeration#download-example-net--c-", | |
| SpeakTest=" "}, | |
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/LinkDotNet.Enumeration#download-example-net--c-", | |
| "SpeakTest": " "}, |
🧰 Tools
🪛 Biome (2.4.15)
[error] 36-36: Property key must be double quoted
(parse)
[error] 36-36: unexpected character =
(parse)
[error] 36-36: expected , but instead found " "
(parse)
[error] 36-36: expected : but instead found }
(parse)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@v2/rscg_examples/LinkDotNet.Enumeration/video.json` around lines 35 - 36, In
video.json there is a JSON syntax error: the property SpeakTest is written as
SpeakTest=" " instead of a proper JSON key/value pair; update the object that
contains "typeStep" and "arg" so the SpeakTest property is quoted and uses a
colon (i.e. "SpeakTest": " "), ensuring commas and surrounding braces remain
valid for the array/object in
v2/rscg_examples/LinkDotNet.Enumeration/video.json.
Summary by CodeRabbit
New Features
Documentation
Site Updates