The .NET Compiler Platform ("Roslyn") provides open-source C# and Visual Basic compilers with rich code analysis APIs.
syntaxtree.Should().ContainNamespace("Foo.Bar")
Hey people, just a sanity check before I waste more time... can I have a source generator create a class with a partial unimplemented method, and then have the user implement that method in a class they write manually?
Generation works, and the compiler complains afterword's that CS8795 Partial method 'MyClass.MyMethod(CancellationToken)' must have an implementation part because it has accessibility modifiers
.
But when I in the user project create a class in the right namespace with the right name, the CS8795 error goes away but is replaced with a CS0759 No defining declaration found for implementing declaration of partial method 'MyClass.MeMethod(CancellationToken)'
.
So that leads me to think that this approach is not possible?