I have begun to use // *INDEX-ONand // *INDEX-OFF to disable formatting and to keep previous formatting.
This work well ... until another user reformat the Java code using another style !
If I use Artistic Style again to format using my specific style, the INDEX-ON bloc dosen't restore the situation as is was before my colleague format java code.
I have this problem with following code ...
public enum ParameterEnum
{ INDIVIDUAL_RISK (ParameterGroup.RISK ,'Default Value' )
, BRACKET_VALUE (ParameterGroup.RISK ,'YES' )
, INPUT_TYPE (ParameterGroup.RISK ,'Comment' )
...
};
After another user reformat the same code, I have following source lines
public enum ParameterEnum {
INDIVIDUAL_RISK(ParameterGroup.RISK),
BRACKET_VALUE(ParameterGroup.RISK),
INPUT_TYPE(ParameterGroup.RISK),
...
};
As you can see, my original tabular format has been lost :-( !
I would have the possibility to format some lines of code in adding some inline command as in following example:
// *FORMAT:ENUM-COMMA-FIRST
public enum ParameterEnum {
INDIVIDUAL_RISK(ParameterGroup.RISK),
BRACKET_VALUE(ParameterGroup.RISK),
INPUT_TYPE(ParameterGroup.RISK),
...
};
// *FORMAT:*
to retreive my original formatting :-)
// *FORMAT:ENUM-COMMA-FIRST
public enum ParameterEnum
{ INDIVIDUAL_RISK (ParameterGroup.RISK ,'Default Value' )
, BRACKET_VALUE (ParameterGroup.RISK ,'YES' )
, INPUT_TYPE (ParameterGroup.RISK ,'Comment' )
...
};
// *FORMAT:*
Currently to do same thing, I execute Artistic Style program and when it is terminated I start a second script that reformat *FORMAT blocs !
I know that this ENUM format style can also be define at file level, but I'm interesting to have it at line level.
BUT, there is perhaps already a solution to my problem :-)
I don't find how to modify/correct my FIRST post to
Can somebody make that for me ?
Last edit: Bernard Schleich 2018-10-03