google / google/google-java-format

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

Đang mở
#264 1 bình luận 1 reaction 1 người được giao Được @plumpy nhận Xem trên GitHub
IntelliJ
Ngôn ngữ chính
Java
Star
6.2k
Fork
937
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
3

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.