title: Intellij indentation format - method definition with/without braces (in scala)
body: <p>I am having a minor annoyance with intellij indentation which I hope someone can help me with.</p>
  
  <p>If I write a method declaration with braces, indenting works properly:</p>
  
  <pre><code>def function(a:A): B = {  //  When I hit return on this line...
      //  the cursor goes here (4 spaces in)
  }
  </code></pre>
  
  <p>However, if I don't include braces, I don't get any indentation:</p>
  
  <pre><code>def function(a:A): B = // When I hit return on this line...
  //  the cursor goes here (0 spaces in)
  </code></pre>
  
  <p>To make matters stranger, if I already have some code on the first line before hitting return, I <em>do</em> get the correct spacing</p>
  
  <p>Before:</p>
  
  <pre><code>def function(a:A): B = some.code.here  //cursor is immediately after the = sign
  </code></pre>
  
  <p>After:</p>
  
  <pre><code>def function(a:A): B =
      some.code.here   // Correct indentation behavior.
  </code></pre>
  
  <p>So what I want to know is this: is there a setting which will result in an auto-indent if I hit return at the end of a method declaration without any code behind the cursor?</p>
  
  <p>Thanks!</p>