<p dir="auto">On testing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="133425257" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/2994" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/2994/hovercard" href="https://github.com/microsoft/vscode/issues/2994">#2994</a></p>
<p dir="auto">In the following snippet place the caret on 'hello' and perform a 'Fold' operation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class xyz {
    foo() {
        if (a == b) {   
            hello
        } else {
            world
        }
    }
}"><pre class="notranslate"><code class="notranslate">class xyz {
    foo() {
        if (a == b) {   
            hello
        } else {
            world
        }
    }
}
</code></pre></div>
<p dir="auto">Observe: 'foo()' get collapsed but I would expect that the 'if' gets collapsed.</p>
<p dir="auto">Testing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="133425257" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/2994" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/2994/hovercard" href="https://github.com/microsoft/vscode/issues/2994">#2994</a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/22350/13283270/3de70c92-daed-11e5-84dd-766846602e2a.gif"><img src="https://cloud.githubusercontent.com/assets/22350/13283270/3de70c92-daed-11e5-84dd-766846602e2a.gif" alt="bug" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">When my cursor is at line <code class="notranslate">266</code> and run the Fold action, the folding block that starts at line <code class="notranslate">263</code> gets folded. I expected that the block that starts at line <code class="notranslate">265</code> to be folded instead.</p>
<p dir="auto">When the cursor is at line <code class="notranslate">265</code>, behaviour is as expected, by the way.</p>