Visual Studio 2013 Indentation Doesn't Work When Writing

I have a code like this:

class Myclass { } 

Now I want to add code, for example. method. I go right after} and press Enter, expecting to get this (| is the cursor location):

 class Myclass { | } 

However, I get the following:

 class Myclass { | } 

If I introduce a method now, it will look like this:

 class Myclass { public void A() { } } 

My indentation configuration is correct, because when I press Ctrl + K, D is committed. I also checked the options β†’ Text Editor β†’ C # β†’ Formatting β†’ Indents and β€œEdited Block Content”.

This happens on Visual Studio 2013 using Resharper 8.1. I temporarily suspended Resharper, and there is no difference. On the same machine, I have Visual Studio 2012 with Resharper, and it works fine.

Does anyone know which configuration needs to be changed to work with indentation during recording?

+8
c # indentation visual-studio-2013 resharper
source share
3 answers

I found a setting that messed this up: these are Options-> Text Editor-> All Languages-> Tabs-> Indents. I had Block installed and it should be Smart

+14
source share

I added this to the .editorconfig (resharper configuration file)

brace_style = next_line

if someone wants to go through the configuration in the editorconfig file https://www.jetbrains.com/help/resharper/2017.1/EditorConfig_CSHARP_BracesPageSchema.html

0
source share

For VS 2019, delete the .editorconfig file. Located in project / src /

0
source share

All Articles