Format code returns: Sorry, but there is no formatter for 'csharp'-files installed.
Environment data
dotnet --info output:
.NET Command Line Tools (2.1.2)
Product Information:
Version: 2.1.2
Commit SHA-1 hash: 5695315371
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.3
Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
VS Code version: Version 1.19.2 Commit 490ef761b76b3f3b3832eff7a588aac891e5fe80 Date 2018-01-10T16:16:25.767Z Shell 1.7.9 Renderer 58.0.3029.110 Node 7.9.0 Architecture ia32 C# Extension version: 1.13.1
Steps to reproduce
I did got extension C# FixFormat installed. I uninstalled it and after that i constantly just receive "Sorry, but there is no formatter for 'csharp'-files installed". Feels like omnisharp doesn't install that part any more, i tried to reinstall omnisharp without success.
I didn't find any errors or messages from omnisharp log or vscode developer console. Didn't try debugmodes though.
Expected behavior
Format is invoked.
Actual behavior
Format is not invoked and error "Sorry, but there is no formatter for 'csharp'-files installed." appear in vscode.
@savpek Have you tried installing and uninstalling the C# extension?
Yes i tried that, i will test this case more later this week. With another computer etc if this is reproducible in other environments.
I don't use the FixFormat extension. Perhaps it hijacks the formatting command in some way? Does the issue still repro with that extension disabled?
I have the same issue right now and i have never had FixFormat installed.
There other features of omnisharp seem to work correctly (i.e. autocompletion). It started out of nowhere - i was working on a project and at some point autoformatting stopped working. Tried to reinstall OmniSharp but with no luck.
Thanks @pushist1y. @rchande : It sounds like we'll need to take a look here. If it happened recently, maybe something happening in our formatting code?
It happened after the latest VSCode upgrade for me. Version 1.19.3
I just updated to 1.19.3 and couldn't reproduce the issue. @rchande: Have you seen this?
Tested on work and home, repro in both. I also tested so that i cleared vscode, omnisharp etc folders from my user and installed just C# extension to vscode and issue occurred again. I could test with clean machine later
Ah got it, there was line "csharp.format.enable": false, in my user config, after cleared that it started working again. C# fixformat extensions seems to set it, tested to install it after cleared user settings ...

However other issues mentioned here may not be releated to this. Should this issue be closed or?
ah ha! Thanks @savpek!
@RobCannon, @pushist1y, do you have the same setting?
@savpek yes, c#fixformat ask you to make change in settings on first start - looks like you agreed without reading message. :)
I will close this issue, if @RobCannon, @pushist1y still has it i will reopen 😄
resolved after updating to vs.code 1.20.1 and re-enabling omni-sharp.
issue occurred on vs.code Version 1.21.1 Commit 79b44aa704ce542d8ca4a3cc44cfca566e7720f1 Date 2018-03-14T14:46:47.128Z Shell 1.7.9 Renderer 58.0.3029.110 Node 7.9.0 Architecture x64
dotnet --info: Product Information: Version: 2.1.101 Commit SHA-1 hash: 6c22303bf0
Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.101\
Microsoft .NET Core Shared Framework Host
Version : 2.0.6 Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d
I know this issue is closed but I am getting the same error on visual studio code 1.22.2 on Windows 10. Version 1.22.2 Commit 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9 Date 2018-04-12T16:38:45.278Z Shell 1.7.12 Renderer 58.0.3029.110 Node 7.9.0 Architecture x64
I uninstalled all the extensions, reinstalled Visual Studio Code and still getting the same error.
@ZeinSleiman
Ah got it, there was line "csharp.format.enable": false, in my user config, after cleared that it started working again. C# fixformat extensions seems to set it, tested to install it after cleared user settings ...
I checked that and it is true. I don’t have any other extensions installed. When u install it by default it should be set true. I removed any data related to extensions before I installed.
For those who've confirmed that "csharp.format.enable" is set to true and you're still having the issue, it's being tracked over here: https://github.com/OmniSharp/omnisharp-vscode/issues/2391
For me helped when I switched from workspace project to folder project
CaosEngine is correct. When opening a workspace project, or opening a lone .cs file outside of a folder project, it refuses to format the code. I doubt this is the intended behaviour. Somehow omnisharp needs to be registered as the default provider for formating, even when not using a folder project.