-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Generators: Documents with generated content doesn't permit code fix execution #49533
Comments
This shoudl likely go to https://github.com/DotNetAnalyzers/PublicApiAnalyzer. They will need to be updated to analyze these files. |
@CyrusNajmabadi they do analyze the files. That's not the problem. The problem is roslyn won't show me code fixes in the generated file so I can fix those diagnostics. |
Ah, gotcha. Yeah, that makes sense. |
Yeah, this is due to the work that generated files still open in as Miscellaneous Files. Once that's fixed we expect this to work. |
Closing this in favor of primary tracking bug #50676. |
Reopening since this one is going to require some more work than is being tracked by the original bug. |
Version Used: VS 16.9 (30718.196.main)
Steps to Reproduce:
When using the
Microsoft.CodeAnalysis.PublicApiAnalyzers
analyzer in a project in combination with a source generator that produces public members, we get RS0016 warnings about public API that "is not part of the declared API."Normally I'd fix this by navigating to that symbol and using a Code Fix provided by the PublicApiAnalyzers to add the necessary lines to the PublicAPI.Unshipped.txt file.
Expected Behavior:
The code fix is offered and can be executed.
Actual Behavior:
But (presumably because the generated code document is readonly) the code fixes are not available. While that may make sense from a "you can't change this doc anyway" perspective, it makes adding new lines to PublicAPI.Unshipped.txt very tedious.
The text was updated successfully, but these errors were encountered: