Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 237 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
# RSCG - 238 Examples of Roslyn Source Code Generators / 15 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 237 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 238 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.

This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem

## Latest Update : 2025-11-06 => 06 November 2025
## Latest Update : 2025-11-07 => 07 November 2025

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 237 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 238 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 15 from Microsoft )
### 238. [TeCLI](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TeCLI) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category

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

<details>
<summary>Expand</summary>



Author: Tyler Coles

C# CLI source generator tool

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


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

Source: [https://github.com/tyevco/TeCLI](https://github.com/tyevco/TeCLI)

</details>

### 237. [Program](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program) , in the [EnhancementClass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) category

Generated on : 2025-11-06 => 06 November 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-11-06 => 06 November 2025
## Latest Update : 2025-11-07 => 07 November 2025



Expand Down
66 changes: 66 additions & 0 deletions v2/.tours/TeCLI.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "TeCLI",
"steps":
[
{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/ConsoleDemo.csproj",
"description": "First, we add Nuget [TeCLI](https://www.nuget.org/packages/TeCLI/) in csproj ",
"pattern": "TeCLI"
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/CmdForSum.cs",
"description": "File CmdForSum.cs ",
"pattern": "this is the code"
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/TeCLI/src/ConsoleDemo/ConsoleDemo.csproj ",
"pattern": "this is the code"
}


,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI.Extensions.DependencyInjection/TeCLI.Extensions.DependencyInjection.Generators.DependencyInjectionInvokerGenerator/CommandDispatcher.Registrations.cs",
"description": "Generated File 6 from 6 : CommandDispatcher.Registrations.cs ",
"line": 1
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI.Extensions.DependencyInjection/TeCLI.Extensions.DependencyInjection.Generators.DependencyInjectionInvokerGenerator/CommandDispatcher.Invoker.cs",
"description": "Generated File 5 from 6 : CommandDispatcher.Invoker.cs ",
"line": 1
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI/TeCLI.Generators.CommandLineArgsGenerator/CommandDispatcher.Documentation.cs",
"description": "Generated File 4 from 6 : CommandDispatcher.Documentation.cs ",
"line": 1
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI/TeCLI.Generators.CommandLineArgsGenerator/CommandDispatcher.cs",
"description": "Generated File 3 from 6 : CommandDispatcher.cs ",
"line": 1
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI/TeCLI.Generators.CommandLineArgsGenerator/CommandDispatcher.Command.CmdForSum.Documentation.cs",
"description": "Generated File 2 from 6 : CommandDispatcher.Command.CmdForSum.Documentation.cs ",
"line": 1
}

,{
"file": "rscg_examples/TeCLI/src/ConsoleDemo/obj/GX/TeCLI/TeCLI.Generators.CommandLineArgsGenerator/CommandDispatcher.Command.CmdForSum.cs",
"description": "Generated File 1 from 6 : CommandDispatcher.Command.CmdForSum.cs ",
"line": 1
}

],

"ref": "main"

}
Comment on lines +2 to +66
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 patterns used in TeCLI tour exist in referenced files

echo "=== Searching for 'this is the code' in ConsoleDemo sources ==="
rg -n "this is the code" "rscg_examples/TeCLI/src/ConsoleDemo/" || echo "No matches found"

echo -e "\n=== Searching for 'TeCLI' in ConsoleDemo.csproj ==="
rg -n "TeCLI" "rscg_examples/TeCLI/src/ConsoleDemo/ConsoleDemo.csproj" || echo "No matches found"

echo -e "\n=== Checking if CmdForSum.cs exists ==="
ls -la "rscg_examples/TeCLI/src/ConsoleDemo/CmdForSum.cs" 2>/dev/null || echo "File not found"

echo -e "\n=== Checking if Program.cs exists ==="
ls -la "rscg_examples/TeCLI/src/ConsoleDemo/Program.cs" 2>/dev/null || echo "File not found"

echo -e "\n=== Checking if ConsoleDemo.csproj exists ==="
ls -la "rscg_examples/TeCLI/src/ConsoleDemo/ConsoleDemo.csproj" 2>/dev/null || echo "File not found"

Repository: ignatandrei/RSCG_Examples

Length of output: 580


🏁 Script executed:

#!/bin/bash
# Explore repo structure to find TeCLI or rscg_examples
echo "=== Looking for TeCLI-related directories ==="
fd -t d "TeCLI" --max-one-result

echo -e "\n=== Looking for rscg_examples directory ==="
fd -t d "rscg_examples" --max-one-result

echo -e "\n=== Checking v2 directory structure ==="
ls -la v2/ 2>/dev/null | head -20 || echo "v2/ not found"

echo -e "\n=== Listing .tours directory ==="
ls -la v2/.tours/ 2>/dev/null || echo "v2/.tours not found"

echo -e "\n=== Finding all .tour files ==="
fd -e tour

Repository: ignatandrei/RSCG_Examples

Length of output: 1928


🏁 Script executed:

#!/bin/bash
# Check TeCLI example structure under v2/rscg_examples
echo "=== Checking v2/rscg_examples for TeCLI ==="
ls -la v2/rscg_examples/ | grep -i tecli

echo -e "\n=== Exploring TeCLI structure if it exists ==="
if [ -d "v2/rscg_examples/TeCLI" ]; then
  find v2/rscg_examples/TeCLI -type f -name "*.cs" -o -name "*.csproj" | head -20
fi

echo -e "\n=== Checking for ConsoleDemo ==="
find v2/rscg_examples -type d -name "ConsoleDemo" 2>/dev/null

echo -e "\n=== Looking for CmdForSum.cs ==="
find v2/rscg_examples -name "CmdForSum.cs" 2>/dev/null

echo -e "\n=== Checking if generated files exist under obj/GX ==="
find v2/rscg_examples -path "*/obj/GX/*" -type f 2>/dev/null | head -5

Repository: ignatandrei/RSCG_Examples

Length of output: 645


🏁 Script executed:

#!/bin/bash
# Read source files to check for patterns referenced in tour
echo "=== Checking CmdForSum.cs for 'this is the code' ==="
cat v2/rscg_examples/TeCLI/src/ConsoleDemo/CmdForSum.cs

echo -e "\n=== Checking Program.cs for 'this is the code' ==="
cat v2/rscg_examples/TeCLI/src/ConsoleDemo/Program.cs

echo -e "\n=== Checking ConsoleDemo.csproj for 'TeCLI' ==="
cat v2/rscg_examples/TeCLI/src/ConsoleDemo/ConsoleDemo.csproj

Repository: ignatandrei/RSCG_Examples

Length of output: 1737


Tour file contains broken file references and missing patterns

The tour references files at incorrect paths and uses patterns that don't exist in the source code:

  1. File paths missing v2/ prefix: Tour references rscg_examples/TeCLI/src/ConsoleDemo/... but files are located at v2/rscg_examples/TeCLI/src/ConsoleDemo/.... CodeTour won't locate these files.

  2. Missing patterns:

    • "this is the code" does not exist in CmdForSum.cs or Program.cs. These files contain actual C# code, not this placeholder text.
    • "TeCLI" does exist in ConsoleDemo.csproj (in PackageReference lines), so that one is valid.
  3. Generated files don't exist: The tour references multiple generated files under obj/GX/ directories, but these don't exist in the repository (generated files are typically build artifacts excluded from version control).

Fix required: Update all file paths to include v2/ prefix, replace the placeholder patterns with actual code snippets that exist in the files, or remove references to non-existent generated files.

🤖 Prompt for AI Agents
In v2/.tours/TeCLI.tour around lines 2-66 the tour references incorrect paths
and non-existent patterns/files: prepend "v2/" to every referenced file path
(e.g., v2/rscg_examples/...), replace placeholder pattern "this is the code"
with actual unique text/snippet that exists in CmdForSum.cs and Program.cs (or
use a line number/regex that matches real code), and remove any entries that
point to build-generated obj/GX/ files (or replace them with source files that
are checked into the repo); ensure the ConsoleDemo.csproj step keeps the valid
"TeCLI" pattern and verify the final tour file references only existing repo
paths and valid patterns.

8 changes: 4 additions & 4 deletions v2/Generator/CategoryDisplay.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inherits RazorBlade.PlainTextTemplate<KeyValuePair<string,Description[]>>;
@inherits RazorBlade.PlainTextTemplate<KeyValuePair<string,Description[]>>
<h1>@Model.Key</h1>

Number RSCG: @Model.Value.Count()
Expand All @@ -9,8 +9,8 @@ Number RSCG: @Model.Value.Count()
@foreach (var rscgV in values)
{
string data = $"[{rscgV.Generator?.Name}](/docs/{rscgV.Generator?.Name})";
<text>
@(i++) @data
</text>
<text>
@(i++) @data @rscgV.Generator?.MarkDownNugetDownloads @(rscgV.Generator?.MarkDownStars) @(rscgV.generatedDate.ToString("yyyy-MM-dd"))
</text>
}

6 changes: 4 additions & 2 deletions v2/Generator/InTheSameCategory.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inherits RazorBlade.PlainTextTemplate<KeyValuePair<string,Description[]>>;
@inherits RazorBlade.PlainTextTemplate<KeyValuePair<string,Description[]>>
@{
string linkCategory = $"[{Model.Key}](/docs/Categories/{Model.Key})";
}
Expand All @@ -10,8 +10,10 @@
@foreach (var rscgV in values)
{
string data = $"[{rscgV.Generator?.Name}](/docs/{rscgV.Generator?.Name})";
string packageName = rscgV.Generator?.NugetFirst ?? "";

<text>
@(i++) @data
@(i++) @data @rscgV.Generator?.MarkDownNugetDownloads @(rscgV.Generator?.MarkDownStars) @(rscgV.generatedDate.ToString("yyyy-MM-dd"))
</text>
}

Expand Down
4 changes: 4 additions & 0 deletions v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public string[] SourceNoRSCG()
text = text.Replace("(README_IMAGE.png)", $"({d.Generator!.Source}/README_IMAGE.png)");
text = text.Replace("[this]()", $"[this]({d.Generator!.Source})");
text = text.Replace("(README", $"({d.Generator!.Source}/README");

text = text.Replace("(COVERAGE", $"({d.Generator!.Source}/COVERAGE");
text = text.Replace("(TeCLI.", $"({d.Generator!.Source}/TeCLI.");

text = text.Replace("(integ-tests/", $"({d.Generator!.Source}/integ-tests/");
text = text.Replace("(./samples", $"({d.Generator!.Source}/samples");
text = text.Replace("(./tests", $"({d.Generator!.Source}/tests");
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,4 @@ Nr,Key,Source,Category
235,CsvCsharp, https://github.com/nuskey8/Csv-CSharp,Serializer
236,Validly, https://github.com/Hookyns/validly,Validator
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1435,5 +1435,11 @@
"Category":5,
"dtStart": "2025-11-06T00:00:00",
"show": true
},
{
"ID":"TeCLI",
"Category":32,
"dtStart": "2025-11-07T00:00:00",
"show": true
}
]
84 changes: 84 additions & 0 deletions v2/book/examples/TeCLI.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

<h1>RSCG nr 238 : TeCLI</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/TeCLI/" target="_blank">https://www.nuget.org/packages/TeCLI/</a>

<p>You can find more details at : <a href="https://github.com/tyevco/TeCLI" target="_blank"> https://github.com/tyevco/TeCLI</a></p>

<p>Author :Tyler Coles</p>

<p>Source: <a href="https://github.com/tyevco/TeCLI" target="_blank">https://github.com/tyevco/TeCLI</a> </p>

<h2>About</h2>

Parse Command line arguments

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/TeCLI/" target="_blank">TeCLI</a> in the csproj
</h3>
<img src="images/TeCLI/ConsoleDemo.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/TeCLI/csFiles/Program.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file CmdForSum.cs
<br />
<img src="images/TeCLI/csFiles/CmdForSum.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is CommandDispatcher.Command.CmdForSum.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.Command.CmdForSum.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is CommandDispatcher.Command.CmdForSum.Documentation.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.Command.CmdForSum.Documentation.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is CommandDispatcher.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is CommandDispatcher.Documentation.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.Documentation.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is CommandDispatcher.Invoker.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.Invoker.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is CommandDispatcher.Registrations.cs
<br />
<img src="images/TeCLI/generated/CommandDispatcher.Registrations.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/TeCLI'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/TeCLI
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 237 RSCG with examples =>
This is the list of 238 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -974,6 +974,10 @@ <h1>
<td>237</td>
<td><a href="examples/Program.html">Program</a></td>
</tr>
<tr>
<td>238</td>
<td><a href="examples/TeCLI.html">TeCLI</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ input-files:
- examples/Csvcsharp.html
- examples/validly.html
- examples/Program.html
- examples/TeCLI.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/TeCLI/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"TeCLI",
"nuget":[
"https://www.nuget.org/packages/TeCLI/"
],
"link":"https://github.com/tyevco/TeCLI",
"author":"Tyler Coles",
"source":"https://github.com/tyevco/TeCLI"
},
"data":{
"goodFor":["Parse Command line arguments "],
"csprojDemo":"ConsoleDemo.csproj",
"csFiles":["Program.cs","CmdForSum.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/TeCLI/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C# CLI source generator tool
Loading
Loading