home.social

#sourcegenerator — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sourcegenerator, aggregated by home.social.

  1. 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

  2. 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

  3. 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.

  4. 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

  5. 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

  6. 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?

  7. 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

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

    What do you think, yay or nay?

    github.com/RikudouSage/SourceG

    #OpenSource #PHP #SourceGenerator #Programming

  9. 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: #dotnet :csharp: #csharp
    🤓 #sourcegenerator

    nuget.org/packages/Microsoft.E

  10. I'm working on a #dotnet #SourceGenerator (IIncrementalGenerator) and I need to not only look at the assembly referencing the SG, but also a referenced Assembly.

    How can I best achieve this?

    For better understanding: I have Project A, Project B and Project SG (IncrementalGenerator). Project A references Project B and Project SG. Project B has the classes where I want to generate based of.