This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269386 - allow editor folds to define formatting rule for enclosed code aka formatter-keepoff
Summary: allow editor folds to define formatting rule for enclosed code aka formatter-...
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: Dev
Hardware: PC All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 14:38 UTC by homberghp
Modified: 2016-12-18 14:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description homberghp 2016-12-18 14:38:44 UTC
Code folding and automatic formatting are very nice, certainly if formatting is configured correctly to the proper and agreed style. 

Sometime, you want a small part of you code to be formatted differently and would accept hand tweaking of the formatting of such code, if only you could tell the formatter to stay off such hand-formatted part.

Use cases are:
* Showing bad versus good code style.
* Formatting code in almost tabular format with intervening spaces, even if it extends the set right border. 
* keeping code compact and on one line.
example:

   // <editor-fold formatter-rule="keep-off">
    default void e1( Context ctx ) { ctx.superState( this ).e1( ctx ); }
    default void e2( Context ctx ) { ctx.superState( this ).e2( ctx ); }
    default void e3( Context ctx ) { ctx.superState( this ).e3( ctx ); }
    default void e4( Context ctx ) { ctx.superState( this ).e4( ctx ); }
    default void e5( Context ctx ) { ctx.superState( this ).e5( ctx ); }
    // </editor-fold>

which is declares the default actions of a state machine. 

or this,
static TestSet[] testData = {
        //           mb  filled     insert   ,bal,clm,dep,edep,ret
        ts( "a", in( mb( 0, 0, 0 ), 0, 0, 1 ), 20, 0, 0, 0, 20 ),
        ts( "b", in( mb( 0, 0, 0 ), 0, 2, 0 ), 20, 0, 0, 0, 20 ),
        ts( "c", in( mb( 0, 0, 0 ), 2, 2, 1 ), 50, 0, 0, 0, 50 ),
        ts( "d", in( mb( 3, 3, 3 ), 2, 2, 1 ), 35, 15, 0, 0, 35 ),
        ts( "e", in( mb( 0, 3, 3 ), 0, 0, 1 ), 5, 15, 0, 5, 0 ),
        ts( "f", in( mb( 1, 3, 3 ), 0, 0, 1 ), 5, 15, 0, 0, 5 ),
        ts( "g", in( mb( 1, 3, 3 ), 0, 1, 1 ), 15, 15, 0, 0, 15 ),
        ts( "h", in( mb( 0, 0, 3 ), 0, 0, 1 ), 5, 15, 0, 5, 0 ),
        // 20 cents in, buys=15, pre changeLeft=15, 0 returned, post changeleft 10
        ts( "i", in( mb( 0, 0, 3 ), 0, 0, 1 ), 5, 15, 15, 5, 0 ),
        ts( "j", in( mb( 0, 0, 3 ), 0, 0, 2 ), 40, 0, 5, 0, 40 ), };