<p dir="auto">I think some times we need to write things like this, but obviously the auto formatting doesn't support this style well enough (actually it destroys manually formatted code):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="promise
    .then(() =&gt; returnAnotherPromise())
    .then(() =&gt; {
        // do something...
    })
    .then(() =&gt; {
        // do some other thing...
    });"><pre class="notranslate"><span class="pl-s1">promise</span>
    <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">returnAnotherPromise</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-c">// do something...</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-c">// do some other thing...</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Because the style below doesn't seem to be acceptable.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="promise.then(() =&gt; returnAnotherPromise()).then(() =&gt; returnAnotherPromise()).then(() =&gt; {
    //...
});"><pre class="notranslate"><span class="pl-s1">promise</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">returnAnotherPromise</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">returnAnotherPromise</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-c">//...</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I find there's quite a lot bugs related to auto formatting, maybe a thorough test procedure should be designed?</p>
<p dir="auto">I have the following code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    query(id: number) {
        return this.$http
            .get('/api/Entity/' + id)
            .then(function (data) {
            return data.data;     // (a)
        });                       // (b)
    }"><pre class="notranslate">    <span class="pl-en">query</span><span class="pl-kos">(</span><span class="pl-s1">id</span>: <span class="pl-s1">number</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span>
            <span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'/api/Entity/'</span> <span class="pl-c1">+</span> <span class="pl-s1">id</span><span class="pl-kos">)</span>
            <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">return</span> <span class="pl-s1">data</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">;</span>     <span class="pl-c">// (a)</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>                       <span class="pl-c">// (b)</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">When  I type the semi-colon at point (a), it gets correctly indented. When a type a semi-colon at point (b), both lines get 4 columns to the left, which is the same output when a format the whole document.</p>
<p dir="auto">I must add it gets on my nerves.</p>
<p dir="auto">Any way to avoid it? Tks</p>