PublicAPIAnalyzer CodeFix does not respect existing newline style #4749
Labels
Area-Microsoft.CodeAnalysis.PublicApiAnalyzers
Bug
The product is not behaving according to its current intended design
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
roslyn-analyzers/src/PublicApiAnalyzers/Core/CodeFixes/DeclarePublicApiFix.cs
Line 110 in 62f71ea
Instead of reading the line endings that already exist in the file, the public API analyzers use the default from the environment. This is a problem on Windows when autocrlf is off, or when the source is shared with a Linux partition (such as WSL or when running Windows in a VM) and the line endings are set to just
\n
. Instead, it should be looking at the existing line endings in the file and, if they are just\n
, only using that, instead of unconditionally using the environment-default newline.The text was updated successfully, but these errors were encountered: