Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format On Type doesn't work #3128

Closed
interpol-kun opened this issue Jun 19, 2019 · 7 comments
Closed

Format On Type doesn't work #3128

interpol-kun opened this issue Jun 19, 2019 · 7 comments

Comments

@interpol-kun
Copy link

interpol-kun commented Jun 19, 2019

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
@mletterle
Copy link

I'm seeing this behavior with VSCode 1.40 and C# Extension 1.21.6

@mletterle
Copy link

I'm guessing this behavior is essentially a duplicate of #1591 would be fixed by #1906

@DanJ210
Copy link

DanJ210 commented Nov 15, 2019

I'm getting this behavior also. No formatting extension is formatting unless I do a save.

@Ashen-Vaults
Copy link

Also getting this. Any update when this fix will be released?

@dawsno
Copy link

dawsno commented Sep 13, 2020

I'm also getting this behavior with the latest version of vscode and the c# extension

@AkshayRoyal
Copy link

I am also facing this issue with vscode
Version: 1.49.1 (system setup)
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:27:51.792Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18363

and pylance extension

@jmarolf
Copy link

jmarolf commented Sep 22, 2020

duplicate of #1591

@jmarolf jmarolf closed this as completed Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants