-
-
Notifications
You must be signed in to change notification settings - Fork 6
examples #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples #534
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Just later | ||
|
|
||
| ## Latest Update : 2026-08-23 => 23 August 2026 | ||
| ## Latest Update : 2026-08-24 => 24 August 2026 | ||
|
|
||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
|
|
||
| { | ||
| "$schema": "https://aka.ms/codetour-schema", | ||
| "title": "Pinecone.TypedPath", | ||
| "steps": | ||
| [ | ||
| { | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/FolderToCode.csproj", | ||
| "description": "First, we add Nuget [Pinecone.TypedPath](https://www.nuget.org/packages/Pinecone.TypedPath/) in csproj ", | ||
| "pattern": "Pinecone.TypedPath" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/MyFolder.cs", | ||
| "description": "File MyFolder.cs ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/Program.cs", | ||
| "description": "File Program.cs \r\n>> dotnet run --project rscg_examples/Pinecone.TypedPath/src/FolderToCode/FolderToCode.csproj ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
|
|
||
| ,{ | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/obj/GX/TypedPath.SourceGen/TypedPath.SourceGen.PathGenerator/TypedPathInterface.g.cs", | ||
| "description": "Generated File 3 from 3 : TypedPathInterface.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/obj/GX/TypedPath.SourceGen/TypedPath.SourceGen.PathGenerator/TypedPathAttribute.g.cs", | ||
| "description": "Generated File 2 from 3 : TypedPathAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/Pinecone.TypedPath/src/FolderToCode/obj/GX/TypedPath.SourceGen/TypedPath.SourceGen.PathGenerator/TypedPath.MyFolder.g.cs", | ||
| "description": "Generated File 1 from 3 : TypedPath.MyFolder.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ], | ||
|
|
||
| "ref": "main" | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||||
|
|
||||||||
| <h1>RSCG nr 284 : Pinecone.TypedPath</h1> | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Add the document type declaration. Insert Proposed fix+<!doctype html>
<h1>RSCG nr 284 : Pinecone.TypedPath</h1>📝 Committable suggestion
Suggested change
🧰 Tools🪛 HTMLHint (1.9.2)[error] 2-2: Doctype must be declared before any non-comment content. (doctype-first) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||
|
|
||||||||
| <h2>Info</h2> | ||||||||
| Nuget : <a href="https://www.nuget.org/packages/Pinecone.TypedPath/" target="_blank">https://www.nuget.org/packages/Pinecone.TypedPath/</a> | ||||||||
|
|
||||||||
| <p>You can find more details at : <a href="https://github.com/nickpinecone/typed-path" target="_blank"> https://github.com/nickpinecone/typed-path</a></p> | ||||||||
|
|
||||||||
| <p>Author :Nick Pinecone</p> | ||||||||
|
|
||||||||
| <p>Source: <a href="https://github.com/nickpinecone/typed-path" target="_blank">https://github.com/nickpinecone/typed-path</a> </p> | ||||||||
|
|
||||||||
| <h2>About</h2> | ||||||||
|
|
||||||||
| Generating typed paths for file system navigation and manipulation. | ||||||||
|
|
||||||||
| <h2> | ||||||||
| How to use | ||||||||
| </h2> | ||||||||
| <h3> | ||||||||
| Add reference to the <a href="https://www.nuget.org/packages/Pinecone.TypedPath/" target="_blank">Pinecone.TypedPath</a> in the csproj | ||||||||
| </h3> | ||||||||
| <img src="images/Pinecone.TypedPath/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/Pinecone.TypedPath/csFiles/Program.cs.png" width="580" height="580" /> | ||||||||
| <hr /> | ||||||||
|
|
||||||||
| <br /> | ||||||||
| I have <b>coded</b> the file MyFolder.cs | ||||||||
| <br /> | ||||||||
| <img src="images/Pinecone.TypedPath/csFiles/MyFolder.cs.png" width="580" height="580" /> | ||||||||
| <hr /> | ||||||||
| <h3>And here are the <i>generated</i> files</h3> | ||||||||
|
|
||||||||
| <br /> | ||||||||
| The file <i>generated</i> is TypedPath.MyFolder.g.cs | ||||||||
| <br /> | ||||||||
| <img src="images/Pinecone.TypedPath/generated/TypedPath.MyFolder.g.cs.png" width="580" height="580" /> | ||||||||
|
|
||||||||
| <br /> | ||||||||
| The file <i>generated</i> is TypedPathAttribute.g.cs | ||||||||
| <br /> | ||||||||
| <img src="images/Pinecone.TypedPath/generated/TypedPathAttribute.g.cs.png" width="580" height="580" /> | ||||||||
|
|
||||||||
| <br /> | ||||||||
| The file <i>generated</i> is TypedPathInterface.g.cs | ||||||||
| <br /> | ||||||||
| <img src="images/Pinecone.TypedPath/generated/TypedPathInterface.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/Pinecone.TypedPath'> | ||||||||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/Pinecone.TypedPath | ||||||||
| </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> | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |||||
| </head> | ||||||
| <body> | ||||||
| <h1> | ||||||
| This is the list of 283 RSCG with examples => | ||||||
| This is the list of 284 RSCG with examples => | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Escape the Use Proposed fix-This is the list of 284 RSCG with examples =>
+This is the list of 284 RSCG with examples =>📝 Committable suggestion
Suggested change
🧰 Tools🪛 HTMLHint (1.9.2)[error] 20-20: Special characters must be escaped : [ > ]. (spec-char-escape) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||
| </h1> | ||||||
|
|
||||||
| <table > | ||||||
|
|
@@ -1158,6 +1158,10 @@ <h1> | |||||
| <td>283</td> | ||||||
| <td><a href="examples/IncrementalSourceGenerator.BuilderPattern.html">IncrementalSourceGenerator.BuilderPattern</a></td> | ||||||
| </tr> | ||||||
| <tr> | ||||||
| <td>284</td> | ||||||
| <td><a href="examples/Pinecone.TypedPath.html">Pinecone.TypedPath</a></td> | ||||||
| </tr> | ||||||
| </table> | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "generator":{ | ||
| "name":"Pinecone.TypedPath", | ||
| "nuget":[ | ||
| "https://www.nuget.org/packages/Pinecone.TypedPath/" | ||
| ], | ||
| "link":"https://github.com/nickpinecone/typed-path", | ||
| "author":"Nick Pinecone", | ||
| "source":"https://github.com/nickpinecone/typed-path" | ||
| }, | ||
| "data":{ | ||
| "goodFor":["Generating typed paths for file system navigation and manipulation."], | ||
| "csprojDemo":"FolderToCode.csproj", | ||
| "csFiles":["Program.cs","MyFolder.cs"], | ||
| "excludeDirectoryGenerated":[""], | ||
| "includeAdditionalFiles":[""] | ||
| }, | ||
| "links":{ | ||
| "blog":"", | ||
| "video":"" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .NET source generator for strongly typed file paths |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| # Typed Path | ||||||
|
|
||||||
| [](https://www.nuget.org/packages/Pinecone.TypedPath) | ||||||
| [](https://github.com/nickpinecone/typed-path/blob/main/LICENSE.md) | ||||||
| [](https://github.com/nickpinecone/typed-path) | ||||||
|
|
||||||
| .NET source generator for strongly typed file paths | ||||||
|
|
||||||
| ## Install | ||||||
| Install the package from nuget | ||||||
| ```sh | ||||||
| dotnet add package Pinecone.TypedPath | ||||||
| ``` | ||||||
|
|
||||||
| Make sure to include the package as a source generator | ||||||
| ```xml | ||||||
| <ItemGroup> | ||||||
| <PackageReference Include="Pinecone.TypedPath" Version="..." ReferenceOutputAssembly="false" OutputItemType="Analyzer" /> | ||||||
| </ItemGroup> | ||||||
| ``` | ||||||
|
|
||||||
| ## Configuration | ||||||
| The `Sample` project includes the full example | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Use the actual sample project name. The README refers to a Proposed fix-The `Sample` project includes the full example
+The `FolderToCode` project includes the full example📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| First add the folder to .csproj as AdditionalFiles | ||||||
| ```xml | ||||||
| <ItemGroup> | ||||||
| <AdditionalFiles Include="Assets/**" /> | ||||||
| </ItemGroup> | ||||||
| ``` | ||||||
|
|
||||||
| Then define a partial class with `TypedPath` attribute and `ITypedPath` interface | ||||||
| ```cs | ||||||
| [TypedPath("Assets")] | ||||||
| public partial class Assets : ITypedPath | ||||||
| { | ||||||
| public static string Wrap(string path) | ||||||
| { | ||||||
| return path; | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| After that you can just reference the path you need | ||||||
| ```cs | ||||||
| > Console.WriteLine(Assets.SubFolder.NestedFolder.SuperNested); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Remove the leading The Proposed fix-> Console.WriteLine(Assets.SubFolder.NestedFolder.SuperNested);
+Console.WriteLine(Assets.SubFolder.NestedFolder.SuperNested);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| Assets/SubFolder/NestedFolder/SuperNested.json | ||||||
| ``` | ||||||
|
|
||||||
| ## Note for Rider | ||||||
| Related to [RIDER-75959](https://youtrack.jetbrains.com/issue/RIDER-75959/Rider-doesnt-trigger-IncrementalSourceGenerator-when-changing-AdditionalFiles) | ||||||
|
|
||||||
| While the source generator works with most file types (`.json`, `.png`, etc.), | ||||||
| Rider's IntelliSense may not detect changes with `.txt` and potentially other files. | ||||||
|
|
||||||
| **Builds will still work correctly** (this is purely an IDE issue) | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Solution> | ||
| <Project Path="FolderToCode/FolderToCode.csproj" /> | ||
| </Solution> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <AdditionalFiles Include="MyFolderToShow/**" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Pinecone.TypedPath" Version="1.0.4" /> | ||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
| <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath> | ||
| </PropertyGroup> | ||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
| using TypedPath; | ||
|
Comment on lines
+1
to
+4
|
||
|
|
||
| namespace FolderToCode; | ||
|
|
||
| [TypedPath("MyFolderToShow")] | ||
| public partial class MyFolder: ITypedPath | ||
| { | ||
| public static string Wrap(string path) | ||
| { | ||
| return path; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| using FolderToCode; | ||
|
|
||
| Console.WriteLine(MyFolder.en.A); | ||
| Console.WriteLine(MyFolder.ro.A); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: ignatandrei/RSCG_Examples
Length of output: 50382
🏁 Script executed:
Repository: ignatandrei/RSCG_Examples
Length of output: 50382
🌐 Web query:
CodeTour schema "pattern" step file pattern no match positioning💡 Result:
In the CodeTour schema, the
patternproperty allows you to associate a tour step with a specific line of code by using a regular expression rather than an absolute line number [1][2][3]. Regarding the behavior when apatternhas no match: 1. Positioning Behavior: Thepatternproperty is only evaluated when thelineproperty is not explicitly set [1][2][4]. If apatternis provided but fails to match any content in the specified file, the extension may fail to position the step correctly or may default to a fallback position (often the end of the file or no specific line focus) [4]. 2. Validation: Because CodeTour is designed to be resilient, it does not always strictly block a tour from opening if a pattern fails. However, robust implementations (such as automated validation scripts) check that everypatternregex compiles successfully and matches at least one line in the intended file [5][6]. If a regex is invalid or finds no match, it is considered an error in the tour's integrity [5][6]. 3. Best Practices: To avoid positioning issues caused by code refactoring (commonly referred to as "tour decay"), it is recommended to use patterns for content that is stable or to use explicitstepMarkercomments in the source code if available [7][6]. In summary, thepatternacts as a search-based locator. If the regex does not match, the system lacks a valid coordinate to center the step, leading to inconsistent or default positioning behavior [5][6][4].Citations:
Use patterns that exist in each target file.
The CodeTour
patternproperty is a regex locator.this is the codedoes not occur inMyFolder.csorProgram.cs, so the steps at lines 16 and 22 may not receive their intended source position. Use unique existing tokens, such as[TypedPath("MyFolderToShow")]andMyFolder.en.A. Updatev2/Generator/TourScenario.cshtmltoo, because it emits the same pattern for every content file.🤖 Prompt for AI Agents