iderider

Moving to a new line does not use indentation


I've been working in Visual Studio all the time and I'm very poorly versed in Rider settings. When I move a line, I don't create an indent when it clearly should be.:

public async Task<string> SendMessage()
{
using HttpClient client = new HttpClient(); // where is the indentation on the left?
}

Yes, the Sharpier extension fixes the issue when saving, but I would like to solve the problem itself. There are no other extensions.


Solution

  • If you want to auto-indent after hitting Enter, make sure to enable Smart indent on enter under Settings | Editor | General | Typing Assistance.

    If you are pasting a code snippet, you might want to configure Auto-format on Paste in the same Typing Assistance settings section (with value Indent if you do not want to reformat the snippet completely and only indent it)