How do I get this formatting to work properly

Beginning with
4-16-2011 9-14-47 PM.png

My rules say that anything that goes past the right margin must wrap.

This leads to:

4-16-2011 9-15-42 PM.png

If I add my own linefeed (manually) before "createExpression...." then formatting the text does not change it, and it looks like:
4-16-2011 9-16-08 PM.png

How do I make the formatter generate this formatting given the original input.

0
Avatar
Permanently deleted user

Hi Jon,

Please try the following:

  • Project Settings - Code Style - Wrapping and Braces - Method call arguments - Wrap if long;
  • Project Settings - Code Style - Wrapping and Braces - Keep when reformatting - Line breaks - unchecked;


Denis

0

Thanks Dennis, I think this might be a bug here is a before and after with the settings you gave. See how the slightly longer line has an issue with the comma ending up on its own line.


4-18-2011 2-12-51 AM.png

formats to:

4-18-2011 2-13-09 AM.png

0
Avatar
Permanently deleted user

Please attach exact file that contains target code snippet and your code style settings (the settings are stored at *.xml file with the corresponding name under '$IDEA_CONFIG_HOME/config/codestyles' directory. IDEA_CONFIG_HOME is defined at 'idea.config.path' property from '$IDEA_HOME/bin/idea.properties' file).

Denis

0

I have attached the settings and the source file. The code is around line 163.

I tried this on both 10.0.3 and 106.491



Attachment(s):
UnbalancedAssignmentInspection.java.zip
Default _1_.xml
0
Avatar
Permanently deleted user

Thanks for providing the info!

There is a bug at formatter that will be fixed at the next 10.5 EAP. Feel free to track the progress of IDEA-68348.

Denis

0

请先登录再写评论。