How can I make CLion respect code style while typing?

Answered

Hi. I'm using CLion 2017.3, and my code style settings say "newline after the return type of a function". However, when I use auto completion for an out-of-class definition, this is what happens:

Is there any way of making it already respect my coding style while it's auto-completing? The same holds for long lists of function arguments. I would like my arguments to be aligned with the opening brace, which is what my code style settings say. However, while typing:

I know I can just hit Ctrl-Alt-L, but that's a bit annoying, and also it reformats the whole file, which is not what I want.

 

Is there any way of making CLion respect my code style settings while typing / auto-formatting? 
 

1
1 comment

Hello!

Thank you for the detailed description.

The first problem is a bug. We have the related issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-12467. 

As for the second case: there is no such functionality for now. I've created the feature request: https://youtrack.jetbrains.com/issue/CPP-12496.

Feel free to comment or upvote the mentioned issues, follow them to get updates.

0

Please sign in to leave a comment.