dotnet / roslyn-analyzers

MIT License
1.58k stars 465 forks source link

PublicAPI analyzer should give the signature for the member that is missing. #6432

Closed CyrusNajmabadi closed 1 year ago

CyrusNajmabadi commented 1 year ago

Spawned from https://github.com/dotnet/roslyn/issues/66414.

The public-api analyzer is crashing within roslyn. This means it's codefixprovider cannot be run to fix issues. Running hte analyzer from teh command line produces messages like:

C:\github\roslyn\src\Compilers\CSharp\Portable\CSharpSyntaxGenerator\CSharpSyntaxGenerator.SourceGenerator\Syntax.xml.Main.Generated.cs(3361,50): error RS0016: Symbol 'CollectionExpression' is not part of the declared public API [C:\gi
thub\roslyn\src\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=netstandard2.0]

however, this is not actionable as one has to figure out the exact string to add to PublicAPI.unshipped.txt to make things ok. This is extremely difficult and error-prone to try to do manually. These error messages should include exactly teh symbol-string that would be needed to make things ok.

CyrusNajmabadi commented 1 year ago

@mavasani @sharwell . Thanks!