Code style settings do not apply

已回答

In my company, we have a code style requirement where braces after f.e. if should be on a new line. However, whichever way I try: when I creat an if statement and hit enter, the editor creates the beginning braces on the line of the if. I have tried:

  • to create a new code style config
  • copy the gonfig to the project's config
  • altered the default config

Please, help.

 

0

Hello,

Am I got you right that you have set "Braces Placement - Other" to "Next Line"? Is it possible to share idea.log ("Help | Show Log in...") after restarting IDE and your code style scheme (e.g. via FTP: ftp://ftp.intellij.net/.uploads/)?

 

0

Hi Yaroslav,

thanks for your reply. The Setting in question is 'if() statement': force braces: always (for Settings - Editor - code style - Java). I can't find "Braces Placement - Other". I'd share the files with you, although firefox says "file not found" to your suggested ftp server. On the command line it is unknown - maybe a firewall? For example wetransfer.com I'd need your email address.

0

Please check this screenshot for mentiond option.

"Force braces" only adds them, but don't move to the next line.

You could also use this link to upload files:https://uploads.services.jetbrains.com/

0

Hi Yaroslav,

I uploaded the logs and settings to the URL mentioned. However, I saw no unique identifier I could post here.

The Setting you mentioned is new to me. However, It does not add braces when I finish an if statement and hit ENTER:

0

Does it work with "Edit | Complete Current statement"?

0

Yes, it does. If I hit ENTER after a finished if(), it does not. However, to hit ENTER after a finished if() is much more common...

0

Code style is applied on "Reformat Code" action or after using Code Completion/Complete statement actions.

Feel  free to create feature request on YouTrack for that feature: http://youtrack.jetbrains.com/issues/IDEA.

0

请先登录再写评论。