Open jeromelaban opened 4 years ago
Create a project that uses all generators and has the same documentation and errors requirements, so that it does not break when a new generator is added.
I'd suggest using Microsoft CodeAnalysis testing packages. It provides more functionality than what we have now:
Ability to test intentional error scenarios, and seems like it also includes DocumentationMode.Diagnose by default: https://github.com/dotnet/roslyn-sdk/blob/c17587bec0ec9c21936e9a9bbef2693208b1b596/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing/CSharpSourceGeneratorTest%602.cs#L38-L39
This is part of https://github.com/unoplatform/uno/issues/6646
Ability to verify the actual generated code, not just that it compiles.
The only blocker to using the library is I was unable to easily have a test which includes all the needed libraries/packages. Especially from Mono.Android.dll
. But if this is something you'd be interested in, I can try to think of various approaches to do that and/or try to get support from roslyn team on this use case.
GitHubRoslyn-SDK templates and Syntax Visualizer. Contribute to dotnet/roslyn-sdk development by creating an account on GitHub.
Many of the generators now need some complex msbuild properties/items setup to run properly, and we'll have to emulate that behavior as well.
I'm not aware of how much complexity is involved, but in general setting MSBuild properties can be done as follows:
GitHubContribute to dotnet/roslyn-analyzers development by creating an account on GitHub.
Good to know that properties can be set this way, but I more talking about the proper values to set. Still, it's doeable :)
In all source generators, public members are not yet documented, and exclusions such as this one https://github.com/unoplatform/uno/pull/1987 are required for the code to compile properly when documentation is mandatory, and warnings are set as errors.
It would be required to:
See the related PR for information about those generators.