I'm using Visual Studio Code 1.9.0 on Kubuntu and have issues when formatting code manually. From here I learned, that Ctrl + Shift + I is the shortcut for code formatting. But it doesn't format the code well, instead it's more uglified!
As an example, I have the following C# model saved in a .cs file
namespace MyApp
{
public class TimetableSubject
{
public int Id { get; set; }
public string Name { get; set; }
public TimetableSubject(int? id = null, string name = "")
{
Name = name;
Id = id.HasValue ? id.Value : 0;
}
}
}
Now I press the keyboard shortcut and my code is a real mess:
namespace MyApp {
public class TimetableSubject {
public int Id {get; set; }
public string Name {get; set; }
public TimetableSubject(int?id = null, string name = "") {
Name = name;
Id = id.HasValue?id.Value:0;
}
}
}
What am I doing wrong? I want clean format according to the C# conventions, like Visual Studio does on Ctrl+E, Ctrl+D shortcut. I already installed the official C# extension called ms-vscode.csharp
. This gave me VS features like showing the usage of methods/fields, but no working formatting.