You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intellij IDEA: Complete Statement action doesn't put the caret inside the method #264
There's a feature in Intellij IDEA: Complete Statement. Start typing method declaration, like: public void myMethod() and press Ctrl-Shift-A, that will open curly braces and will put the caret inside those curly braces with respective indentation. So the code will look as follows:
publicvoidmyMethod() {
}
But with google-java-formatter installed and enabled, version 1.5, this shortcut and action doesn't open curly braces and doesn't put the caret inside the method. Instead, the code looks like follows when I press the shortcut after typing ... myMethod():
publicvoidmyMethod() {}
So the method is closed and the caret is below outside the method.
The expected behaviour would be to open the curly braces and have the caret inside the method as was described in a first example.
CodeStyleManagerImpl has a (complicated, and private) CaretPositionKeeper class for this. We could maybe do something similar. To be honest, it's not likely to be something I'm going to be able to get to anytime soon, sorry. It would be nice, though.
Activity
plumpy commentedon Jun 4, 2018
CodeStyleManagerImpl has a (complicated, and private) CaretPositionKeeper class for this. We could maybe do something similar. To be honest, it's not likely to be something I'm going to be able to get to anytime soon, sorry. It would be nice, though.