-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
Milestone
Description
Describe the bug
Razor (cshtml) file formatting breaks in a very strange way when using LF end of lines.
It doesn't happen if file EOL is CRLF. It's independent of BOM-encoded file (tested this).
To Reproduce
Repository: https://github.com/bryanjhv/aspnet-vscode-issues
(including the steps above and some extra files in the GIF below)
- Create a new
webappproject usingdotnet new. - Open any
.cshtmlfile with Razor expressions (Index.cshtml, etc). - Change its end of line to LF and save it.
- Enable format on save.
- Modify the file (add a space or something).
- Save the file.
Exceptions (if any)
None.
Further technical details
-
ASP.NET Core version: 5.0.5
-
Include the output of
dotnet --info.NET SDK (reflecting any global.json): Version: 5.0.202 Commit: db7cc87d51 Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.202\ Host (useful for support): Version: 5.0.5 Commit: 2f740adc14 .NET SDKs installed: 5.0.202 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download -
The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
- VSCode version: 1.55.2
- C# Extension: 1.23.11
Additional notes
Migrated from dotnet/vscode-csharp#4503 as requested.
Reactions are currently unavailable
