dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.1k stars 4.04k forks source link

Decompilation feature does not respect editor line endings #28276

Open gundermanc opened 6 years ago

gundermanc commented 6 years ago

Version Used: Visual Studio 2017 15.8 Preview 3.0

Steps to Reproduce:

  1. Create a C# project with a Console.WriteLine()
  2. Enable decompilation feature in Tools > Options
  3. Set caret on Console and Press F12

Expected Behavior: File is decompiled using user's line endings preference.

Actual Behavior: File is decompiled using tabs.

jinujoseph commented 6 years ago

related to #25303

siegfriedpammer commented 4 years ago

I think this can be closed. The source code produced by the decompiler is reformatted using Formatter.FormatAsync. See https://github.com/dotnet/roslyn/blob/7d97db435f1d30285efdc8f77e1d573ea8b5075a/src/EditorFeatures/CSharp/DecompiledSource/CSharpDecompiledSourceService.cs#L83-L86