1

couple of weeks ago I installed Visual Studio Code on my Windows machine. It is lightweight and I love it. But there is one problem that drives me crazy. The program cannot format .cs files. If I open .Net Core project, there is no problem on formatting. I changed the language from bottom right to C# and saved the file locally still no success. Is there any way to format code in single .cs file? I know there is already an asked question here for this problem but the solutions does not apply if there is no project created.

Community
  • 1
  • 1
Hasan Hasanov
  • 1,129
  • 2
  • 15
  • 23

1 Answers1

2

Use the command pallet (crtl-shift-P), type "format" and select "format code". Assuming the extension for the current language supports that.

TypeScript does, but C# does not.

You could raise an issue (if one does not already exist).

Richard
  • 106,783
  • 21
  • 203
  • 265