Skip to main content
Source: AL0121NormalizeWhitespaceAnalyzer.cs

Description

SyntaxFactory.NormalizeWhitespace() traverses the entire syntax tree to rewrite whitespace, which is expensive in source generators that run frequently. Use raw string literals or manual formatting instead.

Properties

  • Category: Roslyn Utilities
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: True

Configuration

dotnet_diagnostic.AL0121.severity = warning