#47384·roslyn

.editorconfig diagnostic suppressions don't apply to source-generated files

Author: jasonmalinowskiCreated Sep 2, 2020Updated Sep 17, 2026
LabelsBugArea-CompilersFeature - Source Generators

The failures in https://github.com/dotnet/roslyn/pull/47252 demonstrate this, I think. We have this set in our .editorconfig:

https://github.com/dotnet/roslyn/blob/4602d5d227f19c59665deb3583d7c2abfe8e8611/.editorconfig#L221-L222

When we had the file checked in explicitly, then I'm guessing this took effect; when it's converted to source generator output, we're now getting warnings from the source-generated file.

It's not clear to me if the real fix here is we need to switch some of those settings to be global suppressions so they apply everywhere.