"Reformat Code" doesn't use project settings

Hello,

I can't seem to get the "Reformat Code" feature to use my custom code formatting settings. I can confirm I have changed the project level coding style:
Untitled.jpg

However, it doesn't use the custom settings.

Example:

public void x{
}

vs my custom settings below

public void x
{
}

Any thoughts? Perhaps this is a bug?



Attachment(s):
Untitled.jpg
3 comments

I didn't realize in your StackOverflow post that you were working in Groovy code. What version of IntelliJ IDEA Community Edition are you running? There is/was a bug affecting Groovy Code formatting: Groovy: IDEA-75064 Most code style settings have no effect. That bug was fixed in the IntelliJ IDEA 13 branch which is currently in EAP (i.e. beta) and due to be released in December. I'm not sure if the fix was back ported to IDEA 12. Likely not. The EAP builds are pretty stable. (I've been running IDEA 13 EAP builds since their launch). So you may want to download the latest 13 EAP and see if that works for you. That said, I do not experience the issue in 12.1.6 when I use the (limited) settings you show. The bug report did indicate it was intermittent. So it may be a case of the combination of two settings that cause an issue and we our settings to not line up. If you want to attach your settings configuration file, I can try it. (See below for its location). Does Java code style work OK for you?



Code Style Configuration File Locations:

  • The code style that the project is using is in ${project.root}/.idea/codeStyleSettings.xml
  • The templates you create are stored in:
    • Windows: ${user.home}/.IntelliJIdea/config/codestyles
    • Mac: ~/Library/Preferences/IntelliJIdea/config/codestyles
0

Hi,

Thanks for the reply. I'm very green with this IDE so I didn't realize there was a difference with Groovy. I've attached the the files you mentioned.

Version 12.1.6

For the java code style, I guess you mean using the "set from" >> "java" feature. I tried doing that and then changing the braces to be "next line" but no juice.

Currently installing the latest 13 EAP, I will update once I have my project configured.



Attachment(s):
codeStyleSettings.xml
Default _1_.xml
0

EDIT:

Does Java code style work OK for you?
Yes.......Yes it does.....Because I'm coding in Java :|

I didn't realize Groovy was a programming language, thought it was some plugin to allow code formatting. Issue resolved.

0

Please sign in to leave a comment.