google / google/google-java-format

Intellij IDEA: Complete Statement action doesn't put the caret inside the method

Ouverte
#264 1 commentaire 1 réaction 1 personne assignée Réclamée par @plumpy Voir sur GitHub
IntelliJ
Langage dominant
Java
Étoiles
6.2k
Forks
937
Merge moyen
6 min
PR mergées (30 j)
3

Description

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:

```java
public void myMethod() {

}
```

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()`:

```java
public void myMethod() {}
```

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.