Skip to content

Commit bfb2bb9

Browse files
committed
Restrict EnableGenerateDocumentationFile to .NET 8 warning wave
Fixes #70460
1 parent 81d9274 commit bfb2bb9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/compilers/CSharp/Warnversion Warning Waves.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The compiler shipped with .NET 8 (the C# 12 compiler) contains the following war
2020
| Warning ID | Description |
2121
|------------|-------------|
2222
| CS9123 | [Taking address of local or parameter in async method can create a GC hole](https://github.com/dotnet/roslyn/issues/63100) |
23+
| EnableGenerateDocumentationFile | [Helper diagnostic for enforcing IDE0005 on build](https://github.com/dotnet/roslyn/issues/70460) |
2324

2425
## Warning level 7
2526

src/Analyzers/Core/Analyzers/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ private void AnalyzeCompilation(CompilationAnalysisContext context)
114114
// in their project file to enable IDE0005 on build.
115115

116116
var compilation = context.Compilation;
117+
if (compilation.Options.WarningLevel < 8)
118+
return;
119+
117120
var tree = compilation.SyntaxTrees.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken));
118121
if (tree is null || tree.Options.DocumentationMode != DocumentationMode.None)
119122
return;

0 commit comments

Comments
 (0)