dotnet / roslyn-analyzers

MIT License
1.59k stars 466 forks source link

PublicAPIAnalyzer files should capture more information #3047

Open drewnoakes opened 5 years ago

drewnoakes commented 5 years ago

There are quite a few additional things we could capture in the files used by the public API analyzer. For example, changing any of these would be an API "break" that the analyzer currently doesn't capture:

drewnoakes commented 4 years ago

Repos that give IVT access to their internal members should probably capture internal members in their API descriptions too.

dougbu commented 3 years ago

Changing a base type or removing an inherited interface (without changing members)

Had an offline conversation w/ @halter73 about this bullet. Unfortunately, the current generated files do not mention explicitly-implemented members of an interface at all. Tracking the implemented interfaces would avoid that problem.

Somewhat separately, removing an implicitly-implemented member and making it explicit or visa versa is a change (which is breaking only in the implicit to explicit direction) rather than a removal but, right now, it shows up as a complete removal.


Repos that give IVT access to their internal members should probably capture internal members in their API descriptions too.

If this were implemented, I'd appreciate a way to turn it off completely. IVT is often used in a very narrow / localized fashion e.g. just with DynamicProxyGenAssembly2 (for Moq) and associated test assemblies.

Youssef1313 commented 3 years ago

Missing class modifiers looks like a roslyn issue. The analyzer uses SymbolDisplayMemberOptions.IncludeModifiers, but roslyn doesn't handle it for INamedType.

https://github.com/dotnet/roslyn/blob/f23a18008b23d30ba7ce753ff9f562dc9b4785eb/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor.Types.cs#L185