Skip to content

Conversation

@ignatandrei
Copy link
Owner

@ignatandrei ignatandrei commented Nov 29, 2025

Summary by CodeRabbit

  • New Features

    • Added DecoratorGenerator as the 241st RSCG example, demonstrating the decorator pattern implementation.
    • Introduced a new "Decorator" category for related generators.
  • Documentation

    • Added comprehensive documentation, guides, and working examples for DecoratorGenerator.
    • Updated all reference counts and metadata from 240 to 241 examples across the documentation site.

✏️ Tip: You can customize this high-level summary in your review settings.

Introduced a new example for the DecoratorGenerator source generator, including metadata in GeneratorDataRec.json and a complete demo project. The demo demonstrates decorating an IPerson interface, logging property access and method calls using a LogPerson decorator.
Added DecoratorGenerator as the 241st Roslyn Source Code Generator example, including new documentation, category, and example files. Updated README, about, and index files to reflect the new total and category. Included new tour, video, and supporting files for DecoratorGenerator, and updated category and generator lists accordingly.
Added a new example for DecoratorGenerator (RSCG #241), including its HTML documentation, entry in the list of RSCG examples, YAML configuration for Pandoc, and the associated source ZIP file.
Copilot AI review requested due to automatic review settings November 29, 2025 06:35
@coderabbitai
Copy link

coderabbitai bot commented Nov 29, 2025

Walkthrough

This PR introduces DecoratorGenerator as the 241st RSCG example. Changes include adding a new Decorator category enum value, creating an example project with interface, implementation, and decorator classes, adding metadata and description files, and updating documentation and data files across the website to reflect the new total count and category.

Changes

Cohort / File(s) Change Summary
Version Count Updates
README.md, v2/book/list.html, v2/rscg_examples_site/docs/RSCG-Examples/index.md, v2/rscg_examples_site/docs/about.md, v2/rscg_examples_site/docs/indexRSCG.md, v2/rscg_examples_site/src/components/HomepageFeatures/index.js
Updated references from 240 to 241 total RSCG examples and latest timestamp to 2025-11-10.
Metadata & Data Files
v2/GeneratorData/Category.cs, v2/RSCGExamplesData/GeneratorDataRec.json, v2/rscg_examples_site/static/exports/RSCG.json
Added Decorator category enum (value 41), new DecoratorGenerator JSON entry with metadata, and export data entry.
DecoratorGenerator Documentation
v2/rscg_examples/DecoratorGenerator/description.json, v2/rscg_examples/DecoratorGenerator/nuget.txt, v2/rscg_examples/DecoratorGenerator/readme.txt, v2/rscg_examples/DecoratorGenerator/video.json, v2/.tours/DecoratorGenerator.tour
Added metadata, NuGet documentation, usage guide, video script, and CodeTour for the DecoratorGenerator example.
DecoratorGenerator Example Project
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo.slnx, v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj, v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs, v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs, v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs, v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Program.cs
Added complete C# example project demonstrating the decorator pattern with interface, implementation, decorator wrapper, and console entry point.
Website Documentation
v2/book/examples/DecoratorGenerator.html, v2/book/pandocHTML.yaml, v2/rscg_examples_site/docs/Categories/Decorator.md, v2/rscg_examples_site/docs/Categories/_PrimitiveDecorator.mdx, v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md
Added HTML documentation page, category documentation pages, and comprehensive RSCG example guide with usage details and code tabs.
Timestamp Updates
later.md
Updated latest update timestamp from 2025-11-09 to 2025-11-10.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Primarily additive changes following established patterns (new documentation files, metadata entries, example project)
  • Count/version updates are repetitive and homogeneous across files
  • Example code demonstrates a straightforward decorator pattern with no complex logic
  • No behavioral changes to existing functionality

Areas to verify:

  • All 240→241 count updates are consistent across files
  • DecoratorGenerator metadata is properly linked in all data structures
  • Example project follows the established template structure and builds correctly
  • Category enum value (Decorator=41) is correctly referenced in data files

Poem

🐰 Hops with joy, the count goes up once more,
DecoratorGenerator opens RSCG's door!
From two-forty springs two-forty-one with grace,
Decorators wrapping patterns, keeping pace!
LogPerson logs while IPerson shines bright,
Our rabbit's catalog expanded tonight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a new DecoratorGenerator example with its accompanying demo project. It clearly summarizes the main addition to the repository.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 420-httpsgithubcomcodingflowdecorator-generatorissues82issuecomment-3573571178

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (10)
v2/book/examples/DecoratorGenerator.html (1)

1-71: DecoratorGenerator example page looks consistent; only minor wording nits

The structure, links, and screenshots integrate cleanly with the rest of the book examples. If you want extra polish, consider small text tweaks like “Adding decorators for classes/interfaces” instead of “adding decorator for classes/ interfaces”, but this is non-blocking.

v2/rscg_examples_site/docs/indexRSCG.md (1)

23-23: Minor: Extra space in link text.

The link contains an extra space before the closing bracket. This is flagged by markdownlint.

Apply this diff:

-|241| [DecoratorGenerator by Leopoldo Fu ](/docs/DecoratorGenerator)|2025-11-10 => 10 November 2025 | [Decorator](/docs/Categories/Decorator) |
+|241| [DecoratorGenerator by Leopoldo Fu](/docs/DecoratorGenerator)|2025-11-10 => 10 November 2025 | [Decorator](/docs/Categories/Decorator) |
v2/rscg_examples_site/docs/Categories/Decorator.md (1)

1-6: LGTM! (Minor: Consider adding trailing newline)

The Decorator category page is properly structured with the correct reference to DecoratorGenerator.

Some projects enforce a trailing newline at the end of files via .editorconfig for consistency.

v2/rscg_examples/DecoratorGenerator/description.json (3)

15-16: Avoid empty-string array entries; use empty arrays or omit keys.

Empty strings can leak into tooling. Prefer [] or remove the keys when not used.

-      "excludeDirectoryGenerated":[""],
-      "includeAdditionalFiles":[""]
+      "excludeDirectoryGenerated": [],
+      "includeAdditionalFiles": []

12-12: Tighten “goodFor” phrasing.

Small clarity tweak.

-      "goodFor":["adding decorator for classes/ interfaces"],
+      "goodFor":["generating decorators for classes and interfaces"],

4-9: Link vs source: consider pointing “link” to the docs page.

If “link” is intended for the example/docs page, set it to the site URL and keep “source” for GitHub.

-      "link":"https://github.com/CodingFlow/decorator-generator",
+      "link":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator",
       "author":"Leopoldo Fu",
       "source":"https://github.com/CodingFlow/decorator-generator"
v2/rscg_examples/DecoratorGenerator/readme.txt (3)

88-88: Hyphenate “third-party”.

Minor style fix. Based on static analysis hints.

- To generate decorator abstract classes for third party interfaces,
+ To generate decorator abstract classes for third-party interfaces,

23-26: Use a shell-appropriate code fence for Install-Package.

Improves syntax highlighting.

-```c#
+```powershell
 Install-Package DecoratorGenerator

---

`43-61`: **Tiny wording tweak for flow.**

Reads a bit smoother.

```diff
-Since this library is an incremental source generator, the abstract class should be generated after saving the changes to interface's file.
+Since this library is an incremental source generator, the abstract class is generated after saving changes to the interface file.
v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md (1)

184-190: Consider replacing hard tabs with spaces.

The PropertyGroup block uses hard tabs instead of spaces, which is inconsistent with typical markdown and XML formatting standards. While this doesn't break functionality, converting to spaces would improve consistency.

Apply this diff to replace tabs with spaces:

-	<PropertyGroup>
-		<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
-		<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
-	</PropertyGroup>
-	<ItemGroup>
-	  <PackageReference Include="DecoratorGenerator" Version="0.3.0" />
-	</ItemGroup>
+  <PropertyGroup>
+    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
+    <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="DecoratorGenerator" Version="0.3.0" />
+  </ItemGroup>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d325037 and ba4db8e.

⛔ Files ignored due to path filters (2)
  • v2/Generator/all.csv is excluded by !**/*.csv
  • v2/rscg_examples_site/static/sources/DecoratorGenerator.zip is excluded by !**/*.zip
📒 Files selected for processing (26)
  • README.md (2 hunks)
  • later.md (1 hunks)
  • v2/.tours/DecoratorGenerator.tour (1 hunks)
  • v2/GeneratorData/Category.cs (1 hunks)
  • v2/RSCGExamplesData/GeneratorDataRec.json (1 hunks)
  • v2/book/examples/DecoratorGenerator.html (1 hunks)
  • v2/book/list.html (2 hunks)
  • v2/book/pandocHTML.yaml (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/description.json (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/nuget.txt (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/readme.txt (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo.slnx (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Program.cs (1 hunks)
  • v2/rscg_examples/DecoratorGenerator/video.json (1 hunks)
  • v2/rscg_examples_site/docs/Categories/Decorator.md (1 hunks)
  • v2/rscg_examples_site/docs/Categories/_PrimitiveDecorator.mdx (1 hunks)
  • v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md (1 hunks)
  • v2/rscg_examples_site/docs/RSCG-Examples/index.md (3 hunks)
  • v2/rscg_examples_site/docs/about.md (1 hunks)
  • v2/rscg_examples_site/docs/indexRSCG.md (2 hunks)
  • v2/rscg_examples_site/src/components/HomepageFeatures/index.js (1 hunks)
  • v2/rscg_examples_site/static/exports/RSCG.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (2)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (2)
  • FullName (25-29)
  • Task (30-34)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (2)
  • FullName (11-14)
  • Task (15-22)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (2)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (2)
  • FullName (13-13)
  • Task (15-15)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (2)
  • FullName (11-14)
  • Task (15-22)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Program.cs (3)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (2)
  • Person (7-24)
  • FullName (11-14)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (3)
  • LogPerson (7-35)
  • LogPerson (9-11)
  • FullName (25-29)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (1)
  • FullName (13-13)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (2)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (2)
  • FullName (13-13)
  • Task (15-15)
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (2)
  • FullName (25-29)
  • Task (30-34)
🪛 Biome (2.1.2)
v2/rscg_examples/DecoratorGenerator/video.json

[error] 35-36: Property key must be double quoted

(parse)


[error] 36-36: unexpected character =

(parse)


[error] 36-36: expected , but instead found " "

Remove " "

(parse)


[error] 36-36: expected : but instead found }

Remove }

(parse)


[error] 37-38: Expected an array, an object, or a literal but instead found ']'.

Expected an array, an object, or a literal here.

(parse)

🪛 LanguageTool
v2/rscg_examples/DecoratorGenerator/readme.txt

[grammar] ~88-~88: Use a hyphen to join words.
Context: ...ate decorator abstract classes for third party interfaces, Decorator Generator wi...

(QB_NEW_EN_HYPHEN)

v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md

[grammar] ~141-~141: Use a hyphen to join words.
Context: ...ate decorator abstract classes for third party interfaces, Decorator Generator wi...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md

36-36: Bare URL used

(MD034, no-bare-urls)


39-39: Bare URL used

(MD034, no-bare-urls)


41-41: Bare URL used

(MD034, no-bare-urls)


184-184: Hard tabs
Column: 1

(MD010, no-hard-tabs)


185-185: Hard tabs
Column: 1

(MD010, no-hard-tabs)


186-186: Hard tabs
Column: 1

(MD010, no-hard-tabs)


187-187: Hard tabs
Column: 1

(MD010, no-hard-tabs)


188-188: Hard tabs
Column: 1

(MD010, no-hard-tabs)


189-189: Hard tabs
Column: 1

(MD010, no-hard-tabs)


190-190: Hard tabs
Column: 1

(MD010, no-hard-tabs)


336-336: Code block style
Expected: fenced; Actual: indented

(MD046, code-block-style)


353-353: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

v2/rscg_examples_site/docs/indexRSCG.md

23-23: Spaces inside link text

(MD039, no-space-in-links)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: CodeQL analysis (csharp)
  • GitHub Check: Agent
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: call-workflow-passing-data / build (24.3.0)
🔇 Additional comments (22)
v2/GeneratorData/Category.cs (1)

45-46: Enum extension for Decorator category is consistent

Decorator = 41 follows the existing sequential pattern and cleanly adds the new category without affecting prior values.

v2/book/list.html (2)

20-20: Header count updated to 241 matches the expanded list

The header text now reflects the total including the new DecoratorGenerator entry; this keeps the page title consistent with the table.


989-992: DecoratorGenerator row correctly appended as item 241

The new row is numbered 241 and links to examples/DecoratorGenerator.html, matching the new example file and leaving existing entries untouched.

v2/rscg_examples_site/docs/about.md (1)

8-10: About-page count synchronized to 241 examples

The updated wording to “241 Roslyn Source Code Generator (RSCG)” is consistent with the new total.

v2/rscg_examples_site/src/components/HomepageFeatures/index.js (1)

5-13: Homepage feature title correctly updated to 241 examples

The feature title now reflects the new total while keeping the MSFT count unchanged; no behavioral impact.

v2/book/pandocHTML.yaml (1)

257-257: Pandoc inputs updated to include DecoratorGenerator example

Adding examples/DecoratorGenerator.html ensures the new example is rendered with the rest of the book content.

v2/rscg_examples_site/docs/Categories/_PrimitiveDecorator.mdx (1)

1-7: Decorator category primitive doc aligns with new generator entry

This snippet correctly introduces the “Decorator” category, lists DecoratorGenerator with badges and date, and links to the category page.

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo.slnx (1)

1-3: LGTM!

The solution file structure is correct and properly references the DecoratorDemo project.

later.md (1)

3-3: LGTM!

The date update aligns correctly with the new DecoratorGenerator entry dated 2025-11-10.

v2/rscg_examples_site/docs/indexRSCG.md (1)

10-12: LGTM!

The count updates from 240 to 241 are consistent and correct.

v2/RSCGExamplesData/GeneratorDataRec.json (1)

1457-1462: LGTM!

The DecoratorGenerator entry is properly structured with correct Category (41 for Decorator) and date (2025-11-10).

v2/rscg_examples/DecoratorGenerator/nuget.txt (1)

1-3: LGTM!

The documentation clearly describes the DecoratorGenerator's purpose and functionality.

v2/.tours/DecoratorGenerator.tour (1)

1-48: LGTM!

The CodeTour configuration properly references all relevant source files and the generated decorator. The pattern "this is the code" appears to be used as a marker for tour navigation.

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj (1)

1-16: DecoratorGenerator package version 0.3.0 is publicly available and compatible with .NET 10.0.

The package exists on NuGet and targets .NETStandard2.0, which is compatible with all .NET versions including .NET 10.0. No compatibility issues detected.

README.md (1)

1-1: All verification checks passed—DecoratorGenerator docs and exports are properly configured.

The DecoratorGenerator entry is correctly:

  • Documented at v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md (381 lines)
  • Exported in v2/rscg_examples_site/static/exports/RSCG.json with proper metadata (Name, Link, NuGet, Source, Category)
  • Listed under the "Decorator" category anchor in the docs index at line 381–388

Links will resolve without 404 errors.

v2/rscg_examples/DecoratorGenerator/description.json (1)

13-15: File references in the review snippet are outdated and incorrect.

The description.json for RSCG_Decorator (not DecoratorGenerator) actually contains:

  • csprojDemo: "RSCG_DecoratorTestConsole.csproj" (not "DecoratorDemo.csproj")
  • csFiles: ["Program.cs","PersonLogger.cs","Person.cs"] (not ["Program.cs","Person.cs","IPerson.cs","LogPerson.cs"])

All referenced files do exist in the demo directory, but the review snippet shows stale or incorrect content that doesn't match the actual file.

Likely an incorrect or invalid review comment.

v2/rscg_examples_site/static/exports/RSCG.json (1)

1924-1932: LGTM!

The DecoratorGenerator catalog entry is correctly formatted and includes all required fields (Name, Link, NuGet, Source, Category, AddedOn).

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs (1)

1-16: LGTM!

The interface is well-designed for the decorator pattern demonstration. The [Decorate] attribute will trigger the generator to create the PersonDecorator base class, and the interface includes a good mix of properties and methods (both sync and async) to showcase the decorator functionality.

v2/rscg_examples_site/docs/RSCG-Examples/index.md (1)

3-4: LGTM!

The documentation correctly reflects the addition of DecoratorGenerator as the 241st RSCG example and properly includes it in both the category listing and the mermaid diagram.

Also applies to: 381-391, 1618-1619

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Program.cs (1)

1-12: LGTM!

The demonstration program effectively showcases the decorator pattern with DecoratorGenerator. It properly wraps the concrete Person implementation with LogPerson decorator and demonstrates both property access and method calls (including async methods).

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs (1)

7-35: LGTM!

The LogPerson decorator is correctly implemented, demonstrating how to add logging cross-cutting concerns while preserving the original behavior through base calls. The implementation shows override patterns for properties, sync methods, and async methods.

v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs (1)

7-24: LGTM!

The Person class provides a clean, straightforward implementation of IPerson. The age calculation logic correctly accounts for whether the birthday has occurred this year, and the async method properly simulates asynchronous work.

Comment on lines +29 to +51
### 241. [DecoratorGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator) , in the [Decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) category

Generated on : 2025-11-10 => 10 November 2025

<details>
<summary>Expand</summary>



Author: Leopoldo Fu

Source generator for decorator pattern boilerplate code in C#.

When implementing the decorator pattern in C#, it requires adding boilerplate code for every interface that needs to support decorators, namely the abstract class. Boilerplate is tedious to write and error-prone. This source generator solves this problem by automatically generating the abstract class. It only needs to be told which interfaces it should generate the abstract class for.

Nuget: [https://www.nuget.org/packages/DecoratorGenerator/](https://www.nuget.org/packages/DecoratorGenerator/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator)

Source: [https://github.com/CodingFlow/decorator-generator](https://github.com/CodingFlow/decorator-generator)

</details>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the external links for DecoratorGenerator entry
echo "Checking NuGet package URL..."
curl -s -o /dev/null -w "NuGet Package: HTTP Status %{http_code}\n" "https://www.nuget.org/packages/DecoratorGenerator/"

echo "Checking GitHub repository URL..."
curl -s -o /dev/null -w "GitHub Repo: HTTP Status %{http_code}\n" "https://github.com/CodingFlow/decorator-generator"

echo "Checking documentation URL..."
curl -s -o /dev/null -w "Documentation: HTTP Status %{http_code}\n" "https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator"

Repository: ignatandrei/RSCG_Examples

Length of output: 253


Documentation link is broken (404) — needs correction before merge.

Verification results:

  • ✅ NuGet Package: HTTP 200 (valid)
  • ✅ GitHub Repository: HTTP 200 (valid)
  • ❌ Documentation: HTTP 404 (broken link)

The documentation URL https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator returns a 404 error. This link should be removed or corrected to point to a valid documentation page before merging.

🤖 Prompt for AI Agents
In README.md around lines 29 to 51 the documentation URL
https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator returns
404; fix by either removing the broken documentation link or replacing it with a
valid URL (for example the repository README:
https://github.com/CodingFlow/decorator-generator or the NuGet package page) and
update the "Link:" and the expanded details block so both point to the
corrected/working documentation URL; ensure no lingering references to the
broken ignatandrei.github.io URL remain.

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import TOCInline from '@theme/TOCInline';
import SameCategory from '../Categories/_PrimitiveDecorator.mdx';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the category import.

The import references _PrimitiveDecorator.mdx but should reference _Decorator.mdx to match the actual category for DecoratorGenerator.

Apply this diff:

-import SameCategory from '../Categories/_PrimitiveDecorator.mdx';
+import SameCategory from '../Categories/_Decorator.mdx';
📝 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.

Suggested change
import SameCategory from '../Categories/_PrimitiveDecorator.mdx';
import SameCategory from '../Categories/_Decorator.mdx';
🤖 Prompt for AI Agents
In v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md around line
10, the import is pointing to '../Categories/_PrimitiveDecorator.mdx' but the
correct category file is '../Categories/_Decorator.mdx'; update the import path
to reference '_Decorator.mdx' so the DecoratorGenerator page pulls in the
correct category file.


internal class Person : IPerson
{
public string FirstName \{ get; set; \} = string.Empty;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove escaped braces in C# code samples.

The backslashes before braces in property declarations (e.g., \{ get; set; \}) are unnecessary and make the code samples syntactically incorrect. These should be plain braces for valid C# syntax.

Apply this diff to fix the escaped braces:

-    public string FirstName \{ get; set; \} = string.Empty;
-    public string LastName \{ get; set; \} = string.Empty;
+    public string FirstName { get; set; } = string.Empty;
+    public string LastName { get; set; } = string.Empty;

Also fix Lines 264-265:

-    public string FirstName \{ get; set; }
-    public string LastName \{ get; set; }
+    public string FirstName { get; set; }
+    public string LastName { get; set; }

And Lines 340, 342:

-    public virtual string FirstName \{ get => person.FirstName; set => person.FirstName = value; }
-    public virtual string LastName \{ get => person.LastName; set => person.LastName = value; }
+    public virtual string FirstName { get => person.FirstName; set => person.FirstName = value; }
+    public virtual string LastName { get => person.LastName; set => person.LastName = value; }

Also applies to: 264-265, 340-340, 342-342

🤖 Prompt for AI Agents
In v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md around lines
230, 264-265, 340 and 342, the C# code samples contain escaped braces (e.g., "\{
get; set; \}") which are invalid; remove the backslashes so the property and
other brace usages use plain braces ("{ get; set; }", etc.) ensuring all
occurrences on those lines replace "\{" with "{" and "\}" with "}" to produce
valid C# syntax.


<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, verify the file exists and check its content
if [ -f "v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj" ]; then
  echo "=== File found. Checking line 5 ==="
  sed -n '1,10p' "v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj"
else
  echo "File not found at expected path. Searching for it..."
  find . -name "DecoratorDemo.csproj" -type f
fi

Repository: ignatandrei/RSCG_Examples

Length of output: 414


🏁 Script executed:

#!/bin/bash
# Check for other .csproj files with target frameworks to understand the pattern
echo "=== Checking all .csproj files for target frameworks ==="
rg -t xml '<TargetFramework>' -A 0 --no-heading 2>/dev/null | head -20

Repository: ignatandrei/RSCG_Examples

Length of output: 125


🏁 Script executed:

#!/bin/bash
# Find all .csproj files and check their target frameworks
echo "=== All .csproj files with TargetFramework ==="
find . -name "*.csproj" -type f -exec grep -H "TargetFramework" {} \; | head -30

Repository: ignatandrei/RSCG_Examples

Length of output: 14384


🏁 Script executed:

#!/bin/bash
# Check for net10.0 specifically in v2 examples
echo "=== .NET 10.0 targeting in v2 ==="
find v2 -name "*.csproj" -type f -exec grep -l "net10.0" {} \;

echo ""
echo "=== All v2 target frameworks ==="
find v2 -name "*.csproj" -type f -exec grep "TargetFramework" {} \; | sort | uniq -c

Repository: ignatandrei/RSCG_Examples

Length of output: 1346


🏁 Script executed:

#!/bin/bash
# Get the exact list of net10.0 projects
echo "=== All projects targeting net10.0 ==="
find v2 -name "*.csproj" -type f | while read f; do
  if grep -q "net10.0" "$f"; then
    echo "$f"
  fi
done

Repository: ignatandrei/RSCG_Examples

Length of output: 424


🏁 Script executed:

#!/bin/bash
# Let's also check if there's any documentation or comments about why net10.0 was chosen
echo "=== Checking for context in DecoratorGenerator files ==="
find v2/rscg_examples/DecoratorGenerator -type f -name "*.md" -o -name "*.txt" | head -5

echo ""
echo "=== Checking README or docs ==="
find v2/rscg_examples/DecoratorGenerator -type f \( -name "README*" -o -name "*.md" \) -exec head -20 {} \;

Repository: ignatandrei/RSCG_Examples

Length of output: 251


🏁 Script executed:

#!/bin/bash
# Check the readme and nuget files
echo "=== Content of readme.txt ==="
cat v2/rscg_examples/DecoratorGenerator/readme.txt 2>/dev/null || echo "Not found"

echo ""
echo "=== Content of nuget.txt ==="
cat v2/rscg_examples/DecoratorGenerator/nuget.txt 2>/dev/null || echo "Not found"

Repository: ignatandrei/RSCG_Examples

Length of output: 3893


🏁 Script executed:

#!/bin/bash
# Final check: List all net10.0 projects to understand scope
echo "=== Summary of net10.0 targeting projects ==="
find v2 -name "*.csproj" -type f | while read f; do
  if grep -q "net10.0" "$f"; then
    echo "- $f"
  fi
done | sort

Repository: ignatandrei/RSCG_Examples

Length of output: 441


Based on my comprehensive verification, I have confirmed all the facts in the review comment:

Verification Summary:

  1. ✓ File confirmed: DecoratorDemo.csproj targets net10.0 at line 5
  2. ✓ Timeline confirmed: As of November 2025, .NET 9 is the latest released version; .NET 10 is scheduled for November 2026
  3. ✓ Impact confirmed: This targeting will cause build failures on systems with only .NET 9 or earlier
  4. ✓ Scope identified: Five projects in v2 have this same issue (systemic problem)
  5. ✓ Suggested fixes are appropriate: net9.0 or net8.0 (LTS) are valid alternatives

The review comment is accurate and well-founded.


Critical: Invalid target framework net10.0.

The project targets net10.0, which does not exist as of November 2025. .NET follows an annual release cycle with major versions in November. .NET 9 is the latest available version in November 2025, and .NET 10 is scheduled for November 2026.

This will cause build failures.

Apply this diff to use .NET 9:

-    <TargetFramework>net10.0</TargetFramework>
+    <TargetFramework>net9.0</TargetFramework>

Alternatively, use .NET 8 (LTS) if long-term support is preferred:

-    <TargetFramework>net10.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>

Note: This issue also affects four other projects in v2 (Program, TUnit, TeCLI, XmlCommentGenerator).

📝 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.

Suggested change
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
🤖 Prompt for AI Agents
v2/rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj lines
5-5: the project targets non-existent framework "net10.0", causing build
failures; update the TargetFramework value to a valid released framework
(preferably "net9.0" or, for LTS, "net8.0") and apply the same fix to the other
affected projects (Program, TUnit, TeCLI, XmlCommentGenerator) to ensure
consistent, buildable targets.

Comment on lines +35 to +38
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator#download-example-net--c-",
SpeakTest=" "},
{"typeStep":"waitseconds","arg":"30"},
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix invalid JSON syntax in final steps array entries

The SpeakTest=" " fragment is not valid JSON (missing quotes around the key, uses = instead of :, and breaks the object), and the last waitseconds entry ends with a trailing comma, making the whole file unparsable.

You can fix both issues like this:

-{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator#download-example-net--c-",
-SpeakTest=" "},
-{"typeStep":"waitseconds","arg":"30"},
-]
+{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator#download-example-net--c-","SpeakTest":""},
+{"typeStep":"waitseconds","arg":"30"}
+]

If SpeakTest isn’t actually used by your tooling, you could alternatively drop that property entirely.

🧰 Tools
🪛 Biome (2.1.2)

[error] 35-36: Property key must be double quoted

(parse)


[error] 36-36: unexpected character =

(parse)


[error] 36-36: expected , but instead found " "

Remove " "

(parse)


[error] 36-36: expected : but instead found }

Remove }

(parse)


[error] 37-38: Expected an array, an object, or a literal but instead found ']'.

Expected an array, an object, or a literal here.

(parse)

🤖 Prompt for AI Agents
In v2/rscg_examples/DecoratorGenerator/video.json around lines 35 to 38, the
final steps array contains invalid JSON: the fragment SpeakTest=" " uses = and
an unquoted key and must be a proper JSON property (either remove it or change
to "SpeakTest": " "), and the last {"typeStep":"waitseconds","arg":"30"}, entry
has a trailing comma that must be removed so the array ends with a valid element
followed by the closing bracket. Ensure the steps array elements are
comma-separated JSON objects, no trailing comma after the final object, and run
a JSON linter to verify the file parses.

Copy link
Contributor

Copilot AI left a 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 adds DecoratorGenerator as the 241st Roslyn Source Code Generator (RSCG) example to the repository. DecoratorGenerator is a source generator that automates the creation of decorator pattern boilerplate code in C#.

Key Changes:

  • Added new RSCG example "DecoratorGenerator" with complete documentation and demo project
  • Updated all count references from 240 to 241 RSCGs across documentation
  • Added new "Decorator" category (enum value 41) to categorize this generator

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/rscg_examples_site/static/sources/DecoratorGenerator.zip Binary zip file containing the demo project source code
v2/rscg_examples_site/static/exports/RSCG.json Added DecoratorGenerator entry to the RSCG catalog
v2/rscg_examples_site/src/components/HomepageFeatures/index.js Updated example count from 240 to 241
v2/rscg_examples_site/docs/indexRSCG.md Added DecoratorGenerator to the chronological list and updated counts
v2/rscg_examples_site/docs/about.md Updated RSCG count from 240 to 241
v2/rscg_examples_site/docs/RSCG-Examples/index.md Added new Decorator category section and flowchart node
v2/rscg_examples_site/docs/RSCG-Examples/DecoratorGenerator.md Comprehensive documentation page for DecoratorGenerator
v2/rscg_examples_site/docs/Categories/_PrimitiveDecorator.mdx New category component for Decorator generators
v2/rscg_examples_site/docs/Categories/Decorator.md New category page listing Decorator generators
v2/rscg_examples/DecoratorGenerator/video.json Video script configuration (contains JSON syntax errors)
v2/rscg_examples/DecoratorGenerator/src/* Complete C# demo project files showcasing DecoratorGenerator usage
v2/book/* Updated book HTML files with new generator entry
v2/RSCGExamplesData/GeneratorDataRec.json Added DecoratorGenerator metadata record
v2/GeneratorData/Category.cs Added Decorator enum value (41)
v2/Generator/all.csv Added DecoratorGenerator to CSV catalog
v2/.tours/DecoratorGenerator.tour CodeTour configuration for walking through the example
later.md Updated latest update date to 2025-11-10
README.md Updated count and added DecoratorGenerator section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{"typeStep":"waitseconds","arg":"30"},
{"typeStep":"text","arg": "Remember, you can download the code from here"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator#download-example-net--c-",
SpeakTest=" "},
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid JSON syntax: the SpeakTest property on line 36 should be a string value in quotes. Change SpeakTest=" " to "SpeakTest":" ".

Suggested change
SpeakTest=" "},
"SpeakTest":" "},

Copilot uses AI. Check for mistakes.
{"typeStep":"text","arg": "Remember, you can download the code from here"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator#download-example-net--c-",
SpeakTest=" "},
{"typeStep":"waitseconds","arg":"30"},
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid JSON syntax: trailing comma after the last array element on line 37. Remove the comma after {"typeStep":"waitseconds","arg":"30"}, to make valid JSON.

Suggested change
{"typeStep":"waitseconds","arg":"30"},
{"typeStep":"waitseconds","arg":"30"}

Copilot uses AI. Check for mistakes.
import TOCInline from '@theme/TOCInline';
import SameCategory from '../Categories/_PrimitiveDecorator.mdx';

# DecoratorGenerator by Leopoldo Fu
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space in the heading. There are two spaces between "DecoratorGenerator" and "by". Should be single space: # DecoratorGenerator by Leopoldo Fu.

Suggested change
# DecoratorGenerator by Leopoldo Fu
# DecoratorGenerator by Leopoldo Fu

Copilot uses AI. Check for mistakes.
@ignatandrei ignatandrei merged commit f87715a into main Nov 29, 2025
8 of 10 checks passed
@ignatandrei ignatandrei deleted the 420-httpsgithubcomcodingflowdecorator-generatorissues82issuecomment-3573571178 branch November 29, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https://github.com/CodingFlow/decorator-generator/issues/82#issuecomment-3573571178

2 participants