Additional code folding configuration options
As a user I would like to fold all code blocks in order to improve readability of code.
Comments (20)
-
repo owner -
reporter Given that there is an if, for, while, do-while, try, catch, object initializer block in my current document when the document is loaded in the text editor Then there should be folding icons in the gutter to the left functioning the same as intelliJ's existing folding functionality
Given that there are folding icons in the gutter to the left for a code block When I left click either one Then they should fold the code for that block the same as intelliJ's existing folding functionality
// This is something that I just thought of that is *way* optional and may not be in line with industry standards Given that there are folding icons in the gutter to the left for a code block When I right click either one Then they should recursively fold all blocks within the scope of the block I am folding.
-
reporter The above acceptance criteria the list of code blocks is in no particular order.
if
and
for
are huge for me, but the others would be nice.
-
repo owner Thanks, Brett. I'll definitely keep this in the backlog for consideration once I wrap up my current queue of items.
-
repo owner - removed version
-
repo owner - changed title to Additional code folding configuration options
-
repo owner Issue
#555was marked as a duplicate of this issue. -
I would like this also, but in a different context. I do not like very long methods, so not folding if/while etc although very useful, does not effect the view for me since I can fold whole method, this helps a lot with 1000 line files.
But what I want to see is support for static initializer blocks for static lists/maps etc (outside method context) so we can fold multi line initializers to a single line and improve readability of the code.
Thanks
-
Allegedly IntelliJ supports this kind of code folding but it doesn't work for me either in Apex
https://www.jetbrains.com/help/idea/folding-code-elements.html#folding_predefined
-
repo owner Issue
#798was marked as a duplicate of this issue. -
+1
-
+1
Hello @Scott Wells . Do this feature planed to be delivered soon?
-
repo owner I am planning to circle back around to this but probably not for a bit. I'm just about finished with a big push on metadata management features and enhancements, and next on my list is improved LWC support. Once that's done I'll likely turn back to editor features such as this and new refactorings, new code inspections/intentions, etc.
-
repo owner Issue
#1566was marked as a duplicate of this issue. -
repo owner Issue
#1616was marked as a duplicate of this issue. -
Not sure how it’s implemented in the underlying Intelli-J model, but any place we have curly braces (
{
,}
) in Apex, I’d like to have the option to fold. This should cover all of the stated use cases:for
,if
,while
,do-while
,try
,catch
, static blocks, and static collection intializers, in addition to class and method level folding (which already works). -
repo owner It only took me 4.5 years from when this was originally opened, but I finally got around to adding more code folding regions, specifically all braced code blocks, array/list/map instance initializers, and bracketed queries in query expressions. These changes will be included in the next build which should be released later this week.
-
repo owner I also added support for custom code folding regions in Apex.
-
That's great news. Thanks Scott.
-
repo owner - changed status to resolved
- edited description
Delivered with 2.1.3.8.
- Log in to comment
Brett, first off, love the "As a ... so that I can ..." form of the acceptance criteria! As for the actual request, just wanted to clarify whether you're asking for code folding in general or for the ability to fold more types of blocks than those that are currently available for folding? I'm assuming the latter. If so, could you provide the ones that are most important to you?
FYI, the current code folding options in Illuminated Cloud are directly modeled after the options in IntelliJ IDEA's own Java editor that have analogous concepts in Apex.