This Question is Answered

2 "helpful" answers available (2 pts)
3 Replies Last post: Oct 30, 2013 10:22 PM by Adam Saunders  
Adam Saunders Newbie 3 posts since
Oct 30, 2013
Currently Being Moderated

Oct 30, 2013 6:49 PM

"Reformat Code" doesn't use project settings



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:



However, it doesn't use the custom settings.




public void x{



vs my custom settings below


public void x




Any thoughts? Perhaps this is a bug?

Mark Vedder Apprentice 1,076 posts since
Dec 10, 2003
Currently Being Moderated
Oct 30, 2013 7:53 PM in response to: Adam Saunders
Re: "Reformat Code" doesn't use project settings

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

More Like This

  • Retrieving data ...