Autoformat code CTRL+SHIFT+L add a space, between ending quote and parenthesis of string

时间:2016-04-15 15:05:42

标签: intellij-idea

For example when my code says:

System.out.println("Printing demo features");

I use CTRL+SHIFT+L and Intellij make this:

System.out.println("Printing demo features" );

Thanks for your help.

2 个答案:

答案 0 :(得分:2)

It looks like you have custom code styling in place for Java, thus the auto format function tries to match it:

Check Settings > Editor > Code Style > Java > Spaces and look for "Within" grouping. See if you have some options marked like "Method call parentheses". If you don't have any custom style in place, simple reset the Java style to default and it should be "fixed".

Obs.: I am on Intellij14, options might be different.

答案 1 :(得分:0)

  1. 选中Settings > Editor > Code Style > Java > Spaces > Within > Method call parentheses
  2. 如果上面没有帮助:“文件” - > “使高速缓存/重新启动失效...”(听起来无关,但在我的情况下实际上解决了它)
相关问题