Java: Triple Curly Bracing

I've been given some code with commenting unlike anything I've come across before:

//{{{ Imports
import imports;
//}}}

It is the same for each method block,

//{{{ above the code block  
//}}} below the code block

Also see: http://en.wikipedia.org/wiki/Folding_editor


Asked by: Tess552 | Posted: 23-01-2022






Answer 1

A quick search for "triple curly" comment suggests it's "Emacs folding mode".

Or some other code folding marker in any case.

Answered by: Anna926 | Posted: 24-02-2022



Answer 2

jEdit uses {{{ and }}} to mark "explicit" folds.

Answered by: Victoria739 | Posted: 24-02-2022



Answer 3

It may also be for some code generators. Some generators allow you to edit generated code, and use markers like that so the generator knows where it can regenerate.

Answered by: Walter841 | Posted: 24-02-2022



Answer 4

Actually, Vim uses those triple braces in comments, too.

Tell the one you got the code from, that folding this way is a bad idea. Vim can set fold points at syntactic folding hints, defined in the highlighting file.

Answered by: Arthur646 | Posted: 24-02-2022



Answer 5

Maybe it's to emphasize a code block?

shrugs

Answered by: Brad557 | Posted: 24-02-2022



Similar questions





Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top