<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Collapse&#x2F;Extend switch&#x2F;case]]></title><description><![CDATA[<p dir="auto">Hello, in *.py or *.js file is it possible to collapse/extend ‘case’ block as for switch-if-else-… ?<br />
Thanks for help</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27022/collapse-extend-switch-case</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 12:26:22 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27022.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Jul 2025 20:28:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Collapse&#x2F;Extend switch&#x2F;case on Mon, 08 Sep 2025 06:16:42 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">Thanks a lot for your great and swift answer</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103154</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103154</guid><dc:creator><![CDATA[francis Baudoux]]></dc:creator><pubDate>Mon, 08 Sep 2025 06:16:42 GMT</pubDate></item><item><title><![CDATA[Reply to Collapse&#x2F;Extend switch&#x2F;case on Sun, 20 Jul 2025 21:20:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/francis-baudoux" aria-label="Profile: francis-Baudoux">@<bdi>francis-Baudoux</bdi></a> ,</p>
<p dir="auto">Python:</p>
<pre><code>match subject:
    case pattern1:
        # Code to execute if subject matches pattern1
        pass
    case pattern2:
        # Code to execute if subject matches pattern2
        pass
    case _:
        # Code to execute if no other pattern matches (the default case)
        pass
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1753046208708-8e84e298-3f00-4195-999b-6391d382153d-image.png" alt="8e84e298-3f00-4195-999b-6391d382153d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">So yes, Python will fold on case statements.</p>
<p dir="auto">JavaScript:</p>
<pre><code>switch (expression) {
  case value1:
    // Code to be executed if expression === value1
    break;
  case value2:
    // Code to be executed if expression === value2
    break;
  // ... more case clauses
  default:
    // Code to be executed if no case matches
}
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1753046316009-da795ee6-0f62-435a-a461-60a616d05e53-image.png" alt="da795ee6-0f62-435a-a461-60a616d05e53-image.png" class=" img-fluid img-markdown" /><br />
… doesn’t fold on <code>case</code></p>
<p dir="auto">… <strong>BUT</strong>, that’s because it folds on BLOCKS, not STATEMENTS:</p>
<pre><code>switch (expression) {
  case value1:
  {
    // Code to be executed if expression === value1
    break;
  }
  case value2:
  {
    // Code to be executed if expression === value2
    break;
  }
  // ... more case clauses
  default:
  {
    // Code to be executed if no case matches
  }
}
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1753046362292-d87299b8-2d0b-40d7-afce-c28090211dd6-image.png" alt="d87299b8-2d0b-40d7-afce-c28090211dd6-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/102628</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102628</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 20 Jul 2025 21:20:30 GMT</pubDate></item></channel></rss>