I want to see if it's possible to replace runtime reflection in @xunit v3 with #Roslyn source generators (for better performance and to support NativeAOT), but I think I've already hit the first blocking point: no support for #FSharp? Only #CSharp and #VB? #dotnet
@bradwilson @xunit instead of Roslyn source generators you can have a regular MSBuild code generator that generates code during the build, and it can be any code and support C# and F# equally well. I often find that people use Roslyn source generators when all they want is any code generator.
@KirillOsenkov @bradwilson @xunit What would be the difference against Roslyn ones? (besides support for F#). A cons is probably not running during design time?
@mihamarkic @bradwilson @xunit yes, not running on every keystroke in the IDE and not having access to the compilation and syntax trees/documents/semantic models
@KirillOsenkov @bradwilson @xunit So, basically, here are raw .cs files and do what you want during build?
@mihamarkic @bradwilson @xunit sure, or any other inputs you need. Granted, Roslyn Source Generators are great when you need to understand the .cs files, but in many cases I've seen them abused to just generate .cs files out of say .xml or .json, without the need to understand .cs. If you want to generate C# you may not need source generators, but if you want to read or understand C# you probably need them (unless you host Roslyn yourself and pay the perf penalty of reading the project twice)
@KirillOsenkov @bradwilson @xunit Yep, absolutely, plenty of times there is just xml->sources. Whatever happend to T4?
GitHub - mono/t4: T4 text templating engine

T4 text templating engine. Contribute to mono/t4 development by creating an account on GitHub.

GitHub
@KirillOsenkov @bradwilson @xunit Oh, nice and interesting naming - Mono. Btw, did we ever get a decent editor for .t4 files?
@KirillOsenkov @mihamarkic @bradwilson @xunit years ago there were some decent third party proprietary ones but they never got ported to VS2022. More recently there was https://marketplace.visualstudio.com/items?itemName=bricelam.T4Language which is OSS and used to have an LSP based on mono/t4. The LSP got removed a couple commits ago and I'm not sure why.
T4 Language - Visual Studio Marketplace

Extension for Visual Studio - Basic language support for .tt files

@mhutch @mihamarkic @bradwilson @xunit fun fact: in 2006 a fellow summer intern at Microsoft was tasked with building a language service for T4. Wish I remembered his name. I remember he got something working, and after he left I still had two weeks, so they asked me to quickly light up C# support :) This was pre-Roslyn obviously. Nobody understood how hard it was. I just used the time to fix some minor bugs in it. I don't think it ever shipped.
@KirillOsenkov @mhutch @mihamarkic @bradwilson @xunit even with Roslyn, as the owner of an LSP editor for a language with C# embedded, it’s still hard 😛
@davidwengier @KirillOsenkov @mihamarkic @bradwilson @xunit yeah, embedded languages are tricky. Back when MonoDevelop used NRefactory we had (somewhat flaky) support for C# in Razor, and I had some initial work to use that infrastructure to add C# completion in T4 and aspx, but it didn't survive the Roslyn port.
@davidwengier @KirillOsenkov @mihamarkic @bradwilson @xunit I would still like to add C# completion for inline MSBuild tasks in my MSBuild Editor but it's sooo far down the backlog 😓
@mihamarkic @bradwilson @xunit unfortunately nothing official
@KirillOsenkov @bradwilson @xunit And that's a huge pity. Back in the days I was using CodeSmith generator and I just checked it now - it's still there, though it's (still) commercial. @mhutch