eclipse-cs icon indicating copy to clipboard operation
eclipse-cs copied to clipboard

LeftCurly FormatterSettings missing for LAMBDA

Open MSJones6 opened this issue 7 years ago • 2 comments

Hi,

I use the actual checkstyle plugin (version 8.12.0.201808161509). It seems, that the transformer to codeformatter does not support the token "LAMBDA". No errors in Eclipse message log. The expression will simply be ignored while creating the formatter.

In the code itsself, the curly bracket is marked as wrong formatted. So, this function works correct.

If I'm correct, the following code is missing in the eclipse-cs/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/LeftCurlyTransformer.java (Line 77): } else if (tok.equals("LAMBDA")) { userFormatterSetting("brace_position_for_lambda_body", option); }

I'm using Eclipse Oxygen.3a (Release 4.7.3a)

MSJones6 avatar Aug 29 '18 15:08 MSJones6

https://github.com/checkstyle/eclipse-cs/blob/master/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/LeftCurlyTransformer.java#L55 http://checkstyle.sourceforge.net/config_blocks.html#LeftCurly There are quite a few tokens missing. I'm not sure which is on purpose and which is missed.

https://github.com/checkstyle/eclipse-cs/blob/master/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/RightCurlyTransformer.java#L56 http://checkstyle.sourceforge.net/config_blocks.html#RightCurly Looks the same for right curly too.

If any are missed on purpose, like not supported in eclipse, then a comment should be made in the source so it is clear and not assumed.

rnveach avatar Aug 29 '18 15:08 rnveach

This functionality is part of a contribution made as part of a bachelor thesis. I've never gotten around digging into the code. I had even toyed with the idea removing this feature altogether, since it's effectively unmaintained.

If someone wants to step up, please do.

lkoe avatar Aug 30 '18 15:08 lkoe