Skip to content
Merged

first #461

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 - 258 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 259 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 258 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 259 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 : 2026-03-18 => 18 March 2026
## Latest Update : 2026-04-01 => 01 April 2026

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 258 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 259 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 259. [TypedPaths](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedPaths) , in the [FilesToCode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) category

Generated on : 2026-04-01 => 01 April 2026

<details>
<summary>Expand</summary>



Author: Alex Chim

A Roslyn source generator that turns a folder tree into strongly typed path constants at compile time.

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


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

Source: [https://github.com/AlexChim1231/TypedPaths/](https://github.com/AlexChim1231/TypedPaths/)

</details>

### 258. [REslava.ResultFlow](https://ignatandrei.github.io/RSCG_Examples/v2/docs/REslava.ResultFlow) , in the [Documentation](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#documentation) category

Generated on : 2026-03-18 => 18 March 2026
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 : 2026-03-18 => 18 March 2026
## Latest Update : 2026-04-01 => 01 April 2026



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

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

,{
"file": "rscg_examples/TypedPaths/src/FolderToCode/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/TypedPaths/src/FolderToCode/FolderToCode.csproj ",
"pattern": "this is the code"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This CodeTour step uses "pattern": "this is the code", but the referenced Program.cs in this PR doesn’t contain that text, so the step likely won’t resolve/highlight anything. Update the pattern to match actual content (e.g., TypedPaths.Src) or switch to a line-based step.

Suggested change
"pattern": "this is the code"
"pattern": "TypedPaths.Src"

Copilot uses AI. Check for mistakes.
}


,{
"file": "rscg_examples/TypedPaths/src/FolderToCode/obj/GX/TypedPaths.Generator/TypedPaths.Generator.Generator/TypedPathsAttribute.g.cs",
"description": "Generated File 2 from 2 : TypedPathsAttribute.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/TypedPaths/src/FolderToCode/obj/GX/TypedPaths.Generator/TypedPaths.Generator.Generator/TypedPaths.Src.g.cs",
"description": "Generated File 1 from 2 : TypedPaths.Src.g.cs ",
"line": 1
}

],

"ref": "main"

}
12 changes: 11 additions & 1 deletion v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,17 @@ public async Task<long> GrabDescriptionFromNuget()
Console.WriteLine($"grab data from {url}");
var response = await _client.GetAsync(url);
var data=await response.Content.ReadAsStringAsync();
var answer= JsonDocument.Parse(data);
Console.WriteLine($"{namePackage}: {data}");
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Console.WriteLine($"{namePackage}: {data}"); logs the entire NuGet registration JSON for every package. This can be extremely large and will flood logs / slow down runs. Consider removing it, logging only on failures, or truncating/summarizing the payload (e.g., status code + first N chars).

Suggested change
Console.WriteLine($"{namePackage}: {data}");
Console.WriteLine($"{namePackage}: status {(int)response.StatusCode} ({response.StatusCode}), length {data.Length} chars");

Copilot uses AI. Check for mistakes.
JsonDocument answer;
try
{
answer = JsonDocument.Parse(data);
}
Comment on lines +343 to +347
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

JsonDocument implements IDisposable, but answer is not disposed here. Use a using declaration (using var answer = JsonDocument.Parse(data);) so buffers are released promptly, especially since this runs in a loop across many packages.

Copilot uses AI. Check for mistakes.
catch(Exception ex)
{
Console.WriteLine($"cannot parse json from {url} for {namePackage} because {ex.Message}");
return "";
}
var items = answer.RootElement.GetProperty("items");
foreach (var item in items.EnumerateArray())
{
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,4 @@ Nr,Key,Source,Category
256,Sundew.DiscriminatedUnions, https://github.com/sundews/Sundew.DiscriminatedUnions,FunctionalProgramming
257,Pekspro.DataAnnotationValuesExtractor, https://github.com/pekspro/DataAnnotationValuesExtractor,EnhancementClass
258,REslava.ResultFlow, https://github.com/reslava/nuget-package-reslava-result/,Documentation
259,TypedPaths, https://github.com/AlexChim1231/TypedPaths/,FilesToCode
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1564,5 +1564,11 @@
"Category": 46,
"dtStart": "2026-03-18T00:00:00",
"show": true
},
{
"ID":"TypedPaths",
"Category": 8,
"dtStart": "2026-04-01T00:00:00",
"show": true
}
]
58 changes: 58 additions & 0 deletions v2/book/examples/TypedPaths.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

<h1>RSCG nr 259 : TypedPaths</h1>

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

Comment on lines +4 to +6
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The NuGet links and package name in this generated HTML point to https://www.nuget.org/packages/TypedPaths/, but the example and docs use TypedPaths.Generator (https://www.nuget.org/packages/TypedPaths.Generator/). This mismatch will send readers to the wrong package (or a non-existent one). Update the URL/text to the generator package.

Copilot uses AI. Check for mistakes.
<p>You can find more details at : <a href="https://github.com/AlexChim1231/TypedPaths/" target="_blank"> https://github.com/AlexChim1231/TypedPaths/</a></p>

<p>Author :Alex Chim</p>

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

<h2>About</h2>

Generating strongly-typed paths for file system operations in C# projects.

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/TypedPaths/" target="_blank">TypedPaths</a> in the csproj
</h3>
<img src="images/TypedPaths/FolderToCode.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/TypedPaths/csFiles/Program.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

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

<br />
The file <i>generated</i> is TypedPathsAttribute.g.cs
<br />
<img src="images/TypedPaths/generated/TypedPathsAttribute.g.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/TypedPaths'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedPaths
</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 258 RSCG with examples =>
This is the list of 259 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -1058,6 +1058,10 @@ <h1>
<td>258</td>
<td><a href="examples/REslava.ResultFlow.html">REslava.ResultFlow</a></td>
</tr>
<tr>
<td>259</td>
<td><a href="examples/TypedPaths.html">TypedPaths</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 @@ -272,6 +272,7 @@ input-files:
- examples/Sundew.DiscriminatedUnions.html
- examples/Pekspro.DataAnnotationValuesExtractor.html
- examples/REslava.ResultFlow.html
- examples/TypedPaths.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/TypedPaths/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"TypedPaths",
"nuget":[
"https://www.nuget.org/packages/TypedPaths.Generator/"
],
"link":"https://github.com/AlexChim1231/TypedPaths/",
"author":"Alex Chim",
"source":"https://github.com/AlexChim1231/TypedPaths/"
},
"data":{
"goodFor":["Generating strongly-typed paths for file system operations in C# projects."],
"csprojDemo":"FolderToCode.csproj",
"csFiles":["Program.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/TypedPaths/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A Roslyn source generator that turns a folder tree into strongly typed path constants at compile time.
Loading
Loading