I have such a code:
class Myclass
{
}
I now want to add some code, e.g. a method. I go right after the } and press enter expecting to get this (| is the place of the cursor):
class Myclass
{
|
}
However I get this:
class Myclass
{
|
}
If I now enter a method it stays like this:
class Myclass
{
public void A()
{ }
}
My configuration for indentation is correct because once I press Ctrl+K, D it gets fixed. Also I checked Options -> Text Editor -> C# -> Formatting -> Indentation and "Indent block contents" is checked.
This is happening on Visual Studio 2013 with Resharper 8.1. I suspended Resharper temporarily and there is no difference. On the same machine I have Visual Studio 2012 with Resharper and it works normally.
Does anyone know what configuration has to be changed to have the indentation work during writing?
Auto formatting settings in Visual Studio Show activity on this post. Select the text you want to automatically indent. Click menu Edit → Advanced → *Format Selection, or press Ctrl + K , Ctrl + F . Format Selection applies the smart indenting rules for the language in which you are programming to the selected text.
I want to indent a specific section of code in Visual Studio Code: Select the lines you want to indent, and. use Ctrl + ] to indent them.
I added this to .editorconfig (resharper config file)
brace_style = next_line
if anyone wants to go through the configurations in editorconfig file https://www.jetbrains.com/help/resharper/2017.1/EditorConfig_CSHARP_BracesPageSchema.html
For VS 2019 remove ".editorconfig" file. Located in project/src/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With