_
Folding in comment
_This keyword set is new in UDL 2.0. It allows you to fold anything as long as your language supports comments.
Lets demonstrate it by using C++ comments.
Lets demonstrate it by using C++ comments.
_Example 1:
_
Notice how comments that have 'folding in comment' keywords embedded in them, create folding points in your code. I even mixed line comments and normal comments, and it works. So, any comment with 'folding in comment' keywords embedded can become a folding point. And remember, these are just comments, you can put them anywhere you like. In fact, you can use this feature to organize your code. For one way to do it, see example 2.
Example 2:
Lets steal some ideas from C#. Our code will be organized in 'regions'.
One keyword group will be anything that starts with 'at sign' (@), so we need to check Prefix mode option.
We'll define comments as standard C++ comments:
/* cpp comment */
// cpp line comment
The important thing here is to allow nesting of keyword group two (words that start with '@' sign)
Finally, the magic happens.
I organized my code in three logical groups:
- initialization
- execution
- clean up
Notice how 'region' and 'end' keywords have the same color as comments, but region name uses distinct color to be easily noticeable.
Folding in comment keywords support multi-part keywords too.
In the end, I would just like to say that, if used properly, this could be the single most useful feature of UDL 2.0.