A workaround could be to use my source generator to also generate a test helper class with the syntax tree as a string. Feels a bit icky but it seems workable. #dotnet #sourcegenerator #unitest
So am I the only one struggling with using `IncrementalValueProvider<string?>` with `ForAttributeWithMetadataName` in a #dotnet #sourcegenerator? I would have loved to alter the namespace of my attribute using an MSBuild prop, but it seems like that is not possible?

So made a source generator - ended up rather complex.
But I find unit testing it very tedious when verifying the generated output via Verify.

Is it not possible to load a class/instance as source in the testing, and use it as foundation for the generator. Instead of having to manually writing (and maintaining) the source as a string to then parse into a syntax tree to verify output? I mean it can generate on compile time, so why not at test? :D

#dotnet #sourcegenerator #unittest

Just published static view locator source generator for Avalonia so you don't have to use reflection anymore #Avalonia #dotnet #charp #xaml #sourcegenerator https://www.nuget.org/packages/StaticViewLocator/0.0.1
StaticViewLocator 0.0.1

A C# source generator that automatically implements static view locator for Avalonia without using reflection.

This library is a C# source generator designed to automatically generate string length constants from Entity Framework configurations and data annotations.

#sourcegenerator #entityframework #stringlength #dotnet

https://github.com/TarasKovalenko/EntityLengths.Generator

GitHub - TarasKovalenko/EntityLengths.Generator: Source generator for EF Core entity length constants

Source generator for EF Core entity length constants - TarasKovalenko/EntityLengths.Generator

GitHub
SourceGenerators/examples/dependency-injection at master · RikudouSage/SourceGenerators

Contribute to RikudouSage/SourceGenerators development by creating an account on GitHub.

GitHub

I've just created a PHP source generators package. It's still work-in-progress.

What do you think, yay or nay?

https://github.com/RikudouSage/SourceGenerators

#OpenSource #PHP #SourceGenerator #Programming

GitHub - RikudouSage/SourceGenerators

Contribute to RikudouSage/SourceGenerators development by creating an account on GitHub.

GitHub

Creating a #SourceGenerator is not worth it (I think).

Manually converting #JavaScript modules to #CSharp.

https://gist.github.com/AliveDevil/264cc53132d064c4561f5fbf84bfabc4

1-Original.js

GitHub Gist: instantly share code, notes, and snippets.

Gist
最近やってる source generator 使って brainfuck を 指定したメソッドの中を brainfuck を元にしたコードで実装するやつ。これが安定したら次は piet でやる。 #csharplang #visualstudio #sourcegenerator #dotnet

Earlier this year, around //build — some NuGet packages shipped. One of which is named AutoClient. It relies on a source-generator, emitting interface implementations and DI hooks for REST API HTTP clients, check it out:

 #dotnet  #csharp
🤓 #sourcegenerator

https://www.nuget.org/packages/Microsoft.Extensions.Http.AutoClient

Microsoft.Extensions.Http.AutoClient 8.0.0-preview.7.23407.5

Makes it easy to automatically create efficient and easy to use client code to invoke REST HTTP APIs.