Skip to content

Source Generators: Documents with generated content doesn't permit code fix execution #49533

@AArnott

Description

@AArnott

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.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions