dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.09k stars 867 forks source link

chore: Remove `IgnoresAccessChecksToGenerator` dependencies #10370

Closed filzrev closed 1 week ago

filzrev commented 2 weeks ago

This PR intended to remove depencency to IgnoresAccessChecksToGenerator library.

There are two reasons for this changes.

.NET 8 or later supports UnsafeAccessor attribute. And it can safely expose internal/private members via static extern method.


What's changed

1. Catalog::NamedDestinations / NamedDestinations::TryGetNamedDestinations Replace to extension methods. And access internal implementation via UnsafeAccessor.

2. ISymbol::GetParameters / ISymbol::GetTypeParameters

Replaced with custom extension methods that equivalent to original methods.

3. symbol.GetDocumentationComment(args).FullXmlFragment

Replaced with custom delegate that is generated by ILGenerator.

These logics will be replaced by UnsafeAccessor in future. It require private type access supports (See: https://github.com/dotnet/runtime/issues/90081)