Home > OS >  How can I change JetBrains Applications new function formatting
How can I change JetBrains Applications new function formatting

Time:08-22

I prefer my code to be more compact but JetBrains Rider (or any IntelliJ based editor) automatically formats it like this:

void Start() 
{
        
}

How can I change it to the following by default?

void Start() {
        
}

CodePudding user response:

You should not configure this thing manually in settings, just allow Rider to "learn" from your code.

  1. Format code block as you like
  2. Select desired code block and invoke Reformat and cleanup... -> Detect code style settings... from alt enter menu:

Example for p2

  1. Observe changes which Rider detects:

Example for p3

  1. Save settings for all solutions on this machine, or just for the specific (current) solution. There are other options also:

Example for p4

  1. Now your IDE is configured to format code exactly you want :)

P.S. This thing works in JetBrains Rider and R# tools, do not know about other IDEs, probably there you have to find the same settings manually.

  • Related