unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.81k stars 707 forks source link

Add documentation to publicly generated members #1988

Open jeromelaban opened 4 years ago

jeromelaban commented 4 years ago

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.

Youssef1313 commented 3 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:

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.

GitHub
roslyn-sdk/CSharpSourceGeneratorTest`2.cs at c17587bec0ec9c21936e9a9bbef2693208b1b596 · dotnet/roslyn-sdk
Roslyn-SDK templates and Syntax Visualizer. Contribute to dotnet/roslyn-sdk development by creating an account on GitHub.
jeromelaban commented 3 years ago

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.

Youssef1313 commented 3 years ago

I'm not aware of how much complexity is involved, but in general setting MSBuild properties can be done as follows:

https://github.com/dotnet/roslyn-analyzers/blob/87c20b98866d61c1bbc574ec95da07babc1eb15a/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/QualityGuidelines/MarkMembersAsStaticTests.cs#L903-L908

GitHub
roslyn-analyzers/MarkMembersAsStaticTests.cs at 87c20b98866d61c1bbc574ec95da07babc1eb15a · dotnet/roslyn-analyzers
Contribute to dotnet/roslyn-analyzers development by creating an account on GitHub.
jeromelaban commented 3 years ago

Good to know that properties can be set this way, but I more talking about the proper values to set. Still, it's doeable :)