first iteration#509
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 selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR adds the new “Dirge” Roslyn source generator example, including its sample project, generator documentation, and site/catalog entries, and updates the example count from 273 to 274. ChangesDirge Example Addition
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Program
participant DALDB
participant ConnectionDB
Program->>DALDB: new DALDB() (using block)
DALDB->>ConnectionDB: new ConnectionDB() (cn, cn1)
Program->>Program: Console.WriteLine("before releasing")
Program->>DALDB: exit using scope
DALDB->>ConnectionDB: Dispose() (generated by AutoDispose)
Program->>Program: Console.WriteLine("after releasing")
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ 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 the Dirge source generator as a new example entry (#274) across the repository’s data registry, website docs, and book export outputs, keeping the various indexes/counts in sync.
Changes:
- Added a new
v2/rscg_examples/Dirgeexample project (source, solution, tour, metadata, and video script). - Updated site exports/docs and category/author pages to include Dirge and increment totals to 274.
- Updated book generation inputs and added the Dirge HTML page entry.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| v2/RSCGExamplesData/GeneratorDataRec.json | Registers Dirge in the generator data list. |
| v2/rscg_examples/Dirge/video.json | Adds the automation script for recording/presenting the Dirge example. |
| v2/rscg_examples/Dirge/src/IDisp/Program.cs | Adds the demo program using the generated IDisposable implementation. |
| v2/rscg_examples/Dirge/src/IDisp/IDisp.csproj | New .NET demo project referencing the Dirge NuGet package. |
| v2/rscg_examples/Dirge/src/IDisp/DALDB.cs | Demonstrates applying [Dirge.AutoDispose] to generate dispose logic. |
| v2/rscg_examples/Dirge/src/IDisp/ConnectionDB.cs | Adds a disposable dependency used by the demo. |
| v2/rscg_examples/Dirge/src/IDisp.sln | Adds solution file for the example. |
| v2/rscg_examples/Dirge/src/.tours/Dirge.tour | Adds VS Code CodeTour steps for the example and generated output. |
| v2/rscg_examples/Dirge/readme.txt | Adds upstream/readme content for Dirge. |
| v2/rscg_examples/Dirge/nuget.txt | Adds the short NuGet description text used by the pipeline. |
| v2/rscg_examples/Dirge/description.json | Adds structured metadata describing the generator and demo files. |
| v2/rscg_examples_site/static/exports/RSCG.json | Adds Dirge to the published JSON export list. |
| v2/rscg_examples_site/src/components/HomepageFeatures/index.js | Updates homepage example count to 274. |
| v2/rscg_examples_site/docs/RSCG-Examples/index.md | Updates category counts and adds Dirge to Disposer section/graph. |
| v2/rscg_examples_site/docs/RSCG-Examples/Dirge.md | Adds the Dirge documentation page (generated content + example tabs). |
| v2/rscg_examples_site/docs/indexRSCG.md | Updates the “List-of-RSCG” page count and inserts Dirge at #274. |
| v2/rscg_examples_site/docs/Categories/Disposer.md | Updates Disposer category count/list to include Dirge. |
| v2/rscg_examples_site/docs/Categories/_PrimitiveDisposer.mdx | Updates the “same category” include list to include Dirge. |
| v2/rscg_examples_site/docs/Authors/Kazuki_Kohzuki.md | Adds author page entry for Kazuki Kohzuki. |
| v2/rscg_examples_site/docs/about.md | Updates site “About” count to 274. |
| v2/Generator/all.csv | Adds Dirge to the generator master CSV list. |
| v2/docFind.json | Adds Dirge to the search index feed. |
| v2/book/pandocHTML.yaml | Includes Dirge in the book HTML build input list. |
| v2/book/list.html | Updates the book list to 274 and adds a Dirge row. |
| v2/book/examples/Dirge.html | Adds the book HTML page for Dirge. |
| README.md | Updates root README counts/latest update and adds the Dirge entry. |
| later.md | Updates latest update date to 2026-07-01. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Installation | ||
|
|
||
| You can install the EnumSerializer from [NuGet](https://www.nuget.org/packages/Dirge/). | ||
|
|
| ###### Installation | ||
|
|
||
| You can install the EnumSerializer from [NuGet](https://www.nuget.org/packages/Dirge/). | ||
|
|
|
|
||
| <h2>About</h2> | ||
|
|
||
| **Dirge** is a Roslyn-based code generator that automatically implements the `IDisposable` pattern for C# classes.Key Features:1. **AutoDispose Attribute**: Mark any partial class with `[AutoDispose]` to automatically generate `Dispose()` and `Dispose(bool)` methods.2. **Automatic Field Disposal**: The generator detects all disposable fields and automatically calls `.Dispose()` on them in the correct order. |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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/examples/Dirge.html`:
- Line 15: The About block in Dirge.html is still being written as markdown text
instead of HTML, so replace the raw markdown in the page content with proper
HTML markup before rendering it. Update the section that outputs the Dirge
description so it uses semantic HTML elements (for example, a
heading/paragraph/list structure) rather than literal `**` and inline markdown,
ensuring the browser renders formatted content correctly.
In `@v2/book/list.html`:
- Line 20: The heading text in the list page still contains a raw greater-than
symbol, which triggers HTMLHint. Update the affected heading content in the list
template so the symbol is escaped (for example using >), and keep the change
localized to the list heading text so the page remains lint-clean.
In `@v2/rscg_examples_site/docs/RSCG-Examples/Dirge.md`:
- Around line 1-6: The page frontmatter in Dirge.md has an empty description,
which is causing the Docusaurus build failure because the field must be a
string. Update the frontmatter by adding a short, non-empty description value
alongside the existing title and slug so the docs page can build successfully.
In `@v2/rscg_examples/Dirge/readme.txt`:
- Around line 12-17: The setup text in the Dirge README still refers to the
wrong package name and gives contradictory usage guidance. Update the
installation sentence to mention Dirge instead of EnumSerializer, and revise the
usage description around the AutoDispose workflow so it says the generator
produces Dispose rather than telling users to implement IDisposable manually;
use the README’s usage section and the [AutoDispose] example as the reference
points.
In `@v2/rscg_examples/Dirge/src/.tours/Dirge.tour`:
- Around line 8-54: The tour steps currently target placeholder patterns like
“this is the code” and generated obj/GX files, so they won’t resolve reliably.
Update the entries in Dirge.tour to use real, stable source content from the
actual project files and prefer source files like IDisp.csproj, ConnectionDB.cs,
DALDB.cs, and Program.cs instead of generated artifacts. Ensure each step’s
pattern matches text that exists in the checked-in source so the tour works from
a clean clone.
In `@v2/rscg_examples/Dirge/video.json`:
- Around line 35-38: The JSON entry in video.json is malformed because the
object contains an invalid unquoted field assignment instead of valid JSON.
Update the affected item in the Dirge video sequence so it uses proper JSON
syntax within the array, either by removing the extra SpeakTest field or
converting it into a valid string-valued property consistent with the
surrounding objects, and verify the entries handled by the browser/waitseconds
steps remain valid JSON.
🪄 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: 2d104f57-fcf9-4d06-b922-251b53c8b5af
⛔ Files ignored due to path filters (2)
v2/Generator/all.csvis excluded by!**/*.csvv2/rscg_examples_site/static/sources/Dirge.zipis excluded by!**/*.zip
📒 Files selected for processing (26)
README.mdlater.mdv2/RSCGExamplesData/GeneratorDataRec.jsonv2/book/examples/Dirge.htmlv2/book/list.htmlv2/book/pandocHTML.yamlv2/docFind.jsonv2/rscg_examples/Dirge/description.jsonv2/rscg_examples/Dirge/nuget.txtv2/rscg_examples/Dirge/readme.txtv2/rscg_examples/Dirge/src/.tours/Dirge.tourv2/rscg_examples/Dirge/src/IDisp.slnv2/rscg_examples/Dirge/src/IDisp/ConnectionDB.csv2/rscg_examples/Dirge/src/IDisp/DALDB.csv2/rscg_examples/Dirge/src/IDisp/IDisp.csprojv2/rscg_examples/Dirge/src/IDisp/Program.csv2/rscg_examples/Dirge/video.jsonv2/rscg_examples_site/docs/Authors/Kazuki_Kohzuki.mdv2/rscg_examples_site/docs/Categories/Disposer.mdv2/rscg_examples_site/docs/Categories/_PrimitiveDisposer.mdxv2/rscg_examples_site/docs/RSCG-Examples/Dirge.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
|
|
||
| <h2>About</h2> | ||
|
|
||
| **Dirge** is a Roslyn-based code generator that automatically implements the `IDisposable` pattern for C# classes.Key Features:1. **AutoDispose Attribute**: Mark any partial class with `[AutoDispose]` to automatically generate `Dispose()` and `Dispose(bool)` methods.2. **Automatic Field Disposal**: The generator detects all disposable fields and automatically calls `.Dispose()` on them in the correct order. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Render the About block as HTML.
Line 15 is still markdown text, so the browser will show literal ** and a run-on sentence instead of formatted content. Convert it before writing this page.
Suggested shape
-**Dirge** is ...
+<p><strong>Dirge</strong> is ...</p>
+<ol>
+ <li>...</li>
+ <li>...</li>
+</ol>📝 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.
| **Dirge** is a Roslyn-based code generator that automatically implements the `IDisposable` pattern for C# classes.Key Features:1. **AutoDispose Attribute**: Mark any partial class with `[AutoDispose]` to automatically generate `Dispose()` and `Dispose(bool)` methods.2. **Automatic Field Disposal**: The generator detects all disposable fields and automatically calls `.Dispose()` on them in the correct order. | |
| <p><strong>Dirge</strong> is a Roslyn-based code generator that automatically implements the IDisposable pattern for C# classes.</p> | |
| <p>Key Features:</p> | |
| <ol> | |
| <li><strong>AutoDispose Attribute</strong>: Mark any partial class with [AutoDispose] to automatically generate Dispose() and Dispose(bool) methods.</li> | |
| <li><strong>Automatic Field Disposal</strong>: The generator detects all disposable fields and automatically calls .Dispose() on them in the correct order.</li> | |
| </ol> |
🤖 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/examples/Dirge.html` at line 15, The About block in Dirge.html is
still being written as markdown text instead of HTML, so replace the raw
markdown in the page content with proper HTML markup before rendering it. Update
the section that outputs the Dirge description so it uses semantic HTML elements
(for example, a heading/paragraph/list structure) rather than literal `**` and
inline markdown, ensuring the browser renders formatted content correctly.
| <body> | ||
| <h1> | ||
| This is the list of 273 RSCG with examples => | ||
| This is the list of 274 RSCG with examples => |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Escape the > in the heading text.
Line 20 still contains a raw > and HTMLHint flags it. Replace it with > (or another escaped arrow) so the page stays lint-clean.
Suggested fix
-This is the list of 274 RSCG with examples =>
+This is the list of 274 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 274 RSCG with examples => | |
| This is the list of 274 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, The heading text in the list page still
contains a raw greater-than symbol, which triggers HTMLHint. Update the affected
heading content in the list template so the symbol is escaped (for example using
>), and keep the change localized to the list heading text so the page
remains lint-clean.
Source: Linters/SAST tools
| You can install the EnumSerializer from [NuGet](https://www.nuget.org/packages/Dirge/). | ||
|
|
||
| ## Usage | ||
|
|
||
| Mark a class with the `[AutoDispose]` attribute and implement the `IDisposable` interface. | ||
| The generator will automatically generate the implementation of the `Dispose` method for you. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the copied setup wording.
The install sentence still says EnumSerializer, and the usage text tells readers to implement IDisposable manually even though the example below shows [AutoDispose] generating it. That will confuse users.
Proposed fix
-You can install the EnumSerializer from [NuGet](https://www.nuget.org/packages/Dirge/).
+You can install Dirge from [NuGet](https://www.nuget.org/packages/Dirge/).
-Mark a class with the `[AutoDispose]` attribute and implement the `IDisposable` interface.
+Mark a partial class with the `[AutoDispose]` attribute; the generator adds `IDisposable` and generates `Dispose()`.📝 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.
| You can install the EnumSerializer from [NuGet](https://www.nuget.org/packages/Dirge/). | |
| ## Usage | |
| Mark a class with the `[AutoDispose]` attribute and implement the `IDisposable` interface. | |
| The generator will automatically generate the implementation of the `Dispose` method for you. | |
| You can install Dirge from [NuGet](https://www.nuget.org/packages/Dirge/). | |
| ## Usage | |
| Mark a partial class with the `[AutoDispose]` attribute; the generator adds `IDisposable` and generates `Dispose()`. | |
| The generator will automatically generate the implementation of the `Dispose` method for you. |
🤖 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/Dirge/readme.txt` around lines 12 - 17, The setup text in
the Dirge README still refers to the wrong package name and gives contradictory
usage guidance. Update the installation sentence to mention Dirge instead of
EnumSerializer, and revise the usage description around the AutoDispose workflow
so it says the generator produces Dispose rather than telling users to implement
IDisposable manually; use the README’s usage section and the [AutoDispose]
example as the reference points.
| "file": "IDisp/IDisp.csproj", | ||
| "description": "First, we add Nuget [Dirge](https://www.nuget.org/packages/Dirge/) in csproj ", | ||
| "pattern": "Dirge" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/ConnectionDB.cs", | ||
| "description": "File ConnectionDB.cs ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/DALDB.cs", | ||
| "description": "File DALDB.cs ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/Program.cs", | ||
| "description": "File Program.cs \r\n>> dotnet run --project IDisp/IDisp.csproj ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
|
|
||
| ,{ | ||
| "file": "IDisp/obj/GX/Dirge/Dirge.Generators.TypesGenerator/DoNotDisposeWhenAttribute.g.cs", | ||
| "description": "Generated File 4 from 4 : DoNotDisposeWhenAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/obj/GX/Dirge/Dirge.Generators.TypesGenerator/DoNotDisposeAttribute.g.cs", | ||
| "description": "Generated File 3 from 4 : DoNotDisposeAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/obj/GX/Dirge/Dirge.Generators.TypesGenerator/AutoDisposeAttribute.g.cs", | ||
| "description": "Generated File 2 from 4 : AutoDisposeAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "IDisp/obj/GX/Dirge/Dirge.Generators.DisposeGenerator/DALDB.GeneratedDispose.g.cs", | ||
| "description": "Generated File 1 from 4 : DALDB.GeneratedDispose.g.cs ", | ||
| "line": 1 | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Replace the placeholder tour targets.
The source steps search for the literal text this is the code, so they won't resolve in the sample files. The generated obj/GX/... targets also make the tour fragile across fresh checkouts. Point these steps at real source text and stable files.
🤖 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/Dirge/src/.tours/Dirge.tour` around lines 8 - 54, The tour
steps currently target placeholder patterns like “this is the code” and
generated obj/GX files, so they won’t resolve reliably. Update the entries in
Dirge.tour to use real, stable source content from the actual project files and
prefer source files like IDisp.csproj, ConnectionDB.cs, DALDB.cs, and Program.cs
instead of generated artifacts. Ensure each step’s pattern matches text that
exists in the checked-in source so the tour works from a clean clone.
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dirge#download-example-net--c-", | ||
| SpeakTest=" "}, | ||
| {"typeStep":"waitseconds","arg":"30"}, | ||
| ] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Fix the malformed JSON entry.
SpeakTest=" " is not valid JSON, which matches the parse error from static analysis. The script won't load until this object is made valid JSON or the extra field is removed.
Proposed fix
-{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dirge#download-example-net--c-",
-SpeakTest=" "},
+{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dirge#download-example-net--c-","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/Dirge#download-example-net--c-", | |
| SpeakTest=" "}, | |
| {"typeStep":"waitseconds","arg":"30"}, | |
| ] | |
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dirge#download-example-net--c-","SpeakTest":" "}, | |
| {"typeStep":"waitseconds","arg":"30"}, | |
| ] |
🧰 Tools
🪛 Biome (2.5.1)
[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)
[error] 38-38: Expected an array, an object, or a literal 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/Dirge/video.json` around lines 35 - 38, The JSON entry in
video.json is malformed because the object contains an invalid unquoted field
assignment instead of valid JSON. Update the affected item in the Dirge video
sequence so it uses proper JSON syntax within the array, either by removing the
extra SpeakTest field or converting it into a valid string-valued property
consistent with the surrounding objects, and verify the entries handled by the
browser/waitseconds steps remain valid JSON.
Source: Linters/SAST tools
Summary by CodeRabbit