Skip to content

Format On Type doesn't work #3128

@interpol-kun

Description

@interpol-kun

Issue Description

Editor option "Format on Type" does not work. Typing is ignored and formatting could be applied only via Save or Paste (if they are toggled on).

Steps to Reproduce

Install fresh VSC, toggle on "Format On Type" option in settings, install C# extension from the marketplace. Open up the C# solution, start writing any method with curly braces. After you hit enter it wont format the braces. Hit Ctrl+S and formatting will be applied.

Here is the GIF of that behaviour. (I opened curly braces, pressed ENTER and then pressed CTRL+S -- this is the moment the formatting was applied).

More to say, I have reproduced the same error on both Ubuntu 19.04 and Windows 10, on both Insider and Stable VSC builds.

I did a fresh installation of VSC and the C# extension (I removed any settings and config files associated with VSC and extensions). It didn't help.

Expected Behavior

Code formatting should be applied on typing.

Actual Behavior

Code formatting only applied on Save or Paste

Environment information

VSCode version: 1.35.1
C# Extension: 1.20.0

Dotnet Information ????? SDK ??? .NET Core (?????????? ????? global.json): Version: 2.1.503 Commit: 4c506e0f35

????? ??????????:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.503\

Host (useful for support):
Version: 2.1.7
Commit: cca5d72d48

.NET Core SDKs installed:
2.1.3 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.302 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
cpptools ms-vscode 0.23.1
csharp ms-vscode 1.20.0
eppz-code eppz 1.2.41
horizon-theme-vscode jolaleye 2.0.1
markdown-all-in-one yzhang 2.4.0
quicktype quicktype 12.0.46
shaderlabvscodefree amlovey 1.1.3
theme-boxythemekit trongthanh 0.3.0
unity-debug Unity 2.7.2
unity-tools Tobiah 1.1.1
vscode-install-vsix fabiospampinato 1.4.0
vscode-nuget-package-manager jmrog 1.1.6
vscode-solution-explorer fernandoescolar 0.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions