You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear .NET Documentation Team,
I am writing to provide feedback on the documentation for the AnalysisContext.ConfigureGeneratedCodeAnalysis() method. Currently, the documentation states:
Configure analysis mode of generated code for this analyzer. Non-configured analyzers will default to an appropriate default mode for generated code. It is recommended for the analyzer to invoke this API with the required GeneratedCodeAnalysisFlags setting.
The file name starts with any of the following strings:
TemporaryGeneratedFile_
The file name (excluding the extension) ends with any of the following strings:
.designer
.generated
.g
.g.i
The comment at the beginning of the file contains any of the following strings:
<autogenerated
<auto-generated
Since these criteria are not documented, it is common to encounter cases where files with names that do not meet these criteria (e.g., .gen.cs) are unintentionally subjected to analysis. I believe it would be beneficial to include these criteria in the documentation to help users avoid such issues.
Type of issue
Missing information
Description
Dear .NET Documentation Team,
I am writing to provide feedback on the documentation for the AnalysisContext.ConfigureGeneratedCodeAnalysis() method. Currently, the documentation states:
However, the criteria for determining whether a piece of code is considered "generated code" are not specified in the documentation.
Upon reviewing the Roslyn source code, it appears that the following criteria are used to identify generated code:
https://github.com/dotnet/roslyn/blob/9951cebdc4f5581a0a06c1355f9f8c033ba0cb70/src/Compilers/Core/Portable/SourceGeneration/GeneratedCodeUtilities.cs
Since these criteria are not documented, it is common to encounter cases where files with names that do not meet these criteria (e.g., .gen.cs) are unintentionally subjected to analysis. I believe it would be beneficial to include these criteria in the documentation to help users avoid such issues.
Thank you for considering this suggestion.
Page URL
https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.diagnostics.analysiscontext.configuregeneratedcodeanalysis?view=roslyn-dotnet-4.7.0
Content source URL
https://github.com/dotnet/roslyn-api-docs/blob/live/dotnet/xml/Microsoft.CodeAnalysis.Diagnostics/AnalysisContext.xml
The text was updated successfully, but these errors were encountered: