<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Source Generators on InternetException</title><link>https://internetexception.com/tags/source-generators/</link><description>Recent content in Source Generators on InternetException</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 24 Apr 2026 19:04:03 +0200</lastBuildDate><atom:link href="https://internetexception.com/tags/source-generators/index.xml" rel="self" type="application/rss+xml"/><item><title>Using Junie agent CLI with local model</title><link>https://internetexception.com/2026/04/24/using-junie-agent-cli-with-local-model/</link><pubDate>Fri, 24 Apr 2026 19:04:03 +0200</pubDate><guid>https://internetexception.com/2026/04/24/using-junie-agent-cli-with-local-model/</guid><description>&lt;p&gt;Jet Brains have their own coding agent. Since I am already using Rider and all coding agents are pretty slow and inefficient with what they do I wanted to test if Junie have better integrations with IDE which would make things much faster.&lt;/p&gt;&#10;&lt;p&gt;For example if you will have following unused namespace in Rider.&lt;/p&gt;&#10;&lt;img src="https://internetexception.com/wp-content/uploads/2026/04/image-1.png" class="wp-image-1250" /&gt;&#10;&lt;p&gt;Removing it all cleaning all unused namespaces in entire project or even entire solution is just few clicks away. Or key strokes.&lt;/p&gt;</description></item><item><title>Writing a simple C# source code generator with Fluent API</title><link>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</link><pubDate>Thu, 02 Oct 2025 16:05:39 +0200</pubDate><guid>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;&#10;&lt;p&gt;Usually in .NET world when you want to write generic code you use generic method or classes. But sometimes it is still not enough when you want to automate some things. I.e. you want to dynamically register in &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-9.0" target="_blank" rel="noopener noreferrer"&gt;DI&lt;/a&gt;&#10; all the classes that implements some interface. Probably, in this case, you would do something like that:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;Assembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Types&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetInterfaces&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddScoped&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And it would be completely fine. Even if Reflection is pretty slow, your application would not be getting significantly slower because of that. Certainly you would not notice the slow down.&lt;/p&gt;</description></item><item><title>HamsterWheel.FluentCodeGenerators is out</title><link>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</link><pubDate>Wed, 01 Oct 2025 16:58:21 +0200</pubDate><guid>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</guid><description>&lt;p&gt;I released today first new Nuget package connected to my new project that I am working on for sometime: dynamically configurable, zero-downtime API, with low-code flows to write small pieces of logic - &lt;a href="https://internetexception.com/why-hamster-wheel/" data-type="page" data-id="666"&gt;Hamster Wheel&lt;/a&gt;.&lt;br&gt;&#10;&lt;br&gt;&#10;System heavily relies on dynamic source code generation. For that I wrote&lt;br&gt;&#10;&lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators&lt;/a&gt;&#10; and &lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions&lt;/a&gt;&#10;&lt;br&gt;&#10;small package that helps with writing C# incremental source code generators for Roslyn compiler.&lt;br&gt;&#10;&lt;br&gt;&#10;Original Roslyn APIs are a bit hard to use so this package helps with that. Also it helps with:&lt;br&gt;&#10;\&lt;/p&gt;</description></item></channel></rss>